{"record":{"id":"cb6e6865eb67b672","repo":"oracle/graal","slug":"unexpected-value-name","errorCode":null,"errorMessage":"Unexpected value: ${name}","messagePattern":"Unexpected value: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/JsonReplayCodec.java","lineNumber":1638,"sourceCode":"        }\n\n        @Override\n        public void serialize(Object instance, JsonBuilder.ObjectBuilder objectBuilder, RecursiveSerializer serializer) throws IOException {\n            Architecture architecture = (Architecture) instance;\n            objectBuilder.append(\"name\", architecture.getName());\n            serializer.serialize(architecture.getFeatures(), objectBuilder.append(\"features\"));\n        }\n\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            EnumSet<?> features = (EnumSet<?>) deserializer.deserialize(json.get(\"features\"), proxyFactory);\n            Architecture architecture = switch (name) {\n                case \"AMD64\" -> new AMD64((EnumSet<AMD64.CPUFeature>) features);\n                case \"riscv64\" -> new RISCV64((EnumSet<RISCV64.CPUFeature>) features);\n                case \"aarch64\" -> new AArch64((EnumSet<AArch64.CPUFeature>) features);\n                default -> throw new IllegalStateException(\"Unexpected value: \" + name);\n            };\n            deserializer.setArchitecture(architecture);\n            return architecture;\n        }\n    }\n\n    private static final class RegisterConfigSerializer implements ObjectSerializer {\n        private final boolean isHostWindowsOS;\n\n        private final TargetDescription hostTarget;\n\n        private RegisterConfigSerializer(Platform platform, TargetDescription hostTarget) {\n            this.isHostWindowsOS = platform.osName().equals(\"windows\");\n            this.hostTarget = hostTarget;\n        }\n\n        @Override\n        public boolean serializesSubclasses() {","sourceCodeStart":1620,"sourceCodeEnd":1656,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/JsonReplayCodec.java#L1620-L1656","documentation":"ArchitectureSerializer.deserialize reconstructs the Architecture from a 'name' string; only 'AMD64', 'riscv64', and 'aarch64' are recognized. An unknown name throws IllegalStateException('Unexpected value: ...'). Note this happens during deserialization of the replay file's architecture section, so it fails before any compilation replay starts.","triggerScenarios":"Replaying a JSON replay file whose architecture.name is anything but the three supported strings — recorded on another architecture (e.g. a future RISC-V variant name), written by a newer codec, or corrupted.","commonSituations":"Cross-architecture replay attempts; GraalVM version where Architecture.name() strings changed or new targets were added; hand-edited files.","solutions":["Replay the file on a JVM whose architecture matches the file's name field","Re-record the file with the same build","For fork maintainers adding a target: add a case to the switch and mirror it in the register-config deserializer"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"static final Set<String> SUPPORTED_ARCHITECTURES = Set.of(\"AMD64\", \"riscv64\", \"aarch64\");\n\nString archName = (String) replayJson.getArchitectureName();\nif (!SUPPORTED_ARCHITECTURES.contains(archName)) {\n    throw new IllegalArgumentException(\"Unsupported replay architecture: \" + archName);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate replay ingestion on an explicit architecture allow-list check","Run replay on the same CPU architecture the file was recorded on"],"tags":["graalvm","replay","architecture","deserialization"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}