{"record":{"id":"088e90d408b0ec01","repo":"oracle/graal","slug":"unexpected-kind-of-register-config-name","errorCode":null,"errorMessage":"Unexpected kind of register config: ${name}","messagePattern":"Unexpected kind of register config: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/JsonReplayCodec.java","lineNumber":1702,"sourceCode":"\n        @Override\n        @SuppressWarnings(\"unchecked\")\n        public Object deserialize(EconomicMap<String, Object> json, RecursiveDeserializer deserializer, CompilationProxies.ProxyFactory proxyFactory) throws DeserializationException {\n            String name = (String) json.get(\"name\");\n            TargetDescription targetDescription = (TargetDescription) deserializer.deserialize(json.get(\"target\"), proxyFactory);\n            List<Register> allocatable = (List<Register>) deserializer.deserialize(json.get(\"allocatable\"), proxyFactory);\n            switch (name) {\n                case \"AMD64\" -> {\n                    boolean windowsOS = (boolean) json.get(\"windowsOS\");\n                    return new AMD64HotSpotRegisterConfig(targetDescription, allocatable, windowsOS);\n                }\n                case \"RISCV64\" -> {\n                    return new RISCV64HotSpotRegisterConfig(targetDescription, allocatable);\n                }\n                case \"AArch64\" -> {\n                    return new AArch64HotSpotRegisterConfig(targetDescription, allocatable);\n                }\n                default -> throw new IllegalStateException(\"Unexpected kind of register config: \" + name);\n            }\n        }\n    }\n\n    private static final class ThrowableSerializer implements ObjectSerializer {\n\n        @Override\n        public boolean serializesSubclasses() {\n            return true;\n        }\n\n        @Override\n        public Class<?> clazz() {\n            return Throwable.class;\n        }\n\n        @Override\n        public String tag() {","sourceCodeStart":1684,"sourceCodeEnd":1720,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/JsonReplayCodec.java#L1684-L1720","documentation":"Deserialization counterpart of 151: the registerConfig entry's 'name' must be 'AMD64', 'RISCV64', or 'AArch64'; anything else throws IllegalStateException('Unexpected kind of register config: ...'). Note the casing differs from the Architecture names ('AMD64' vs 'riscv64'/'aarch64' lowercase), a common trip-up when editing files by hand.","triggerScenarios":"Replaying a JSON replay file whose registerConfig.name is unknown or wrongly cased — e.g. hand-edited from 'aarch64' (architecture spelling) instead of 'AArch64' (register-config spelling), or written by a codec with additional backends.","commonSituations":"Manual JSON edits with case mismatch; cross-version replay; fork architectures not upstreamed.","solutions":["Fix the name casing/values: AMD64, RISCV64, AArch64 (note uppercase here, lowercase in the architecture name)","Re-record the file on the same build and architecture","For new backends, extend both this switch and the serializer in error 151"],"exampleFix":"// before (hand-edited file): { \"tag\": \"registerConfig\", \"name\": \"aarch64\", ... }\n// after: { \"tag\": \"registerConfig\", \"name\": \"AArch64\", ... }","handlingStrategy":"validation","validationCode":"static final Set<String> VALID_REGISTER_CONFIG_KINDS = Set.of(\"AMD64\", \"RISCV64\", \"AArch64\");\n\nif (!VALID_REGISTER_CONFIG_KINDS.contains(name)) {\n    throw new IllegalArgumentException(\"Unsupported register config kind in replay file: \" + name);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember casing differs: architecture names are lowercase ('riscv64') but register-config kinds are uppercase ('RISCV64')","Validate replay JSON with a schema checker that enforces these enumerations before deserialization"],"tags":["graalvm","replay","deserialization","register-config"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}