{"record":{"id":"3ffc96e73a1bd5b0","repo":"oracle/graal","slug":"unknown-replay-singleton-kind","errorCode":null,"errorMessage":"Unknown replay singleton kind ","messagePattern":"Unknown replay singleton kind ","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/BinaryReplayCodec.java","lineNumber":1094,"sourceCode":"            default -> throw new IOException(\"Invalid replay boolean flag \" + value);\n        };\n    }\n\n    private int registrationIndex(CompilerInterfaceDeclarations.Registration registration) {\n        Integer index = registrationIndices.get(registration.clazz());\n        if (index == null) {\n            throw new IllegalArgumentException(\"Unknown registration \" + registration.clazz().getName());\n        }\n        return index;\n    }\n\n    private static Object readSpecialSingleton(int kind) throws IOException {\n        return switch (kind) {\n            case SINGLETON_NULL_POINTER -> JavaConstant.NULL_POINTER;\n            case SINGLETON_COMPRESSED_NULL -> HotSpotCompressedNullConstant.COMPRESSED_NULL;\n            case SINGLETON_NO_SPECULATION -> SpeculationLog.NO_SPECULATION;\n            case SINGLETON_ILLEGAL_VALUE_KIND -> ValueKind.Illegal;\n            default -> throw new IOException(\"Unknown replay singleton kind \" + kind);\n        };\n    }\n\n    private Class<?> arrayComponentType(Object[] array) {\n        Class<?> componentType = array.getClass().getComponentType();\n        Class<?> registeredSupertype = declarations.findRegisteredSupertype(componentType);\n        return (registeredSupertype != null) ? registeredSupertype : componentType;\n    }\n\n    private static String requireNonNullString(String value, String description) throws IOException {\n        if (value == null) {\n            throw new IOException(\"Required replay field \" + description + \" is null\");\n        }\n        return value;\n    }\n\n    private static Register findRegister(Architecture architecture, int number) throws IOException {\n        for (Register register : architecture.getRegisters()) {","sourceCodeStart":1076,"sourceCodeEnd":1112,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/BinaryReplayCodec.java#L1076-L1112","documentation":"readSpecialSingleton maps a small int kind to well-known singleton constants (JavaConstant.NULL_POINTER, HotSpotCompressedNullConstant.COMPRESSED_NULL, SpeculationLog.NO_SPECULATION, ValueKind.Illegal). Any other kind value throws IOException 'Unknown replay singleton kind <kind>'. The kind byte is only ever written from this fixed set, so an unknown kind indicates corruption or reader/writer format divergence.","triggerScenarios":"Replaying a stream written by a build with additional singleton kinds; stream misalignment after an earlier parse discrepancy; corrupted file.","commonSituations":"Cross-version replay after the singleton set was extended without bumping the file VERSION; partially-written replay files.","solutions":["Regenerate the replay file on the same GraalVM build used for replay","If extending the singleton set in a fork, add the kind symmetrically and bump VERSION","Validate the version header first to fail fast"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    result = codec.readReplay(in);\n} catch (IOException e) {\n    if (\"Unknown replay singleton kind\".equals(e.getMessage())) {\n        // reader/writer singleton set mismatch: re-record\n    } else throw e;\n}","preventionTips":["Use identical builds for record and replay","When extending the singleton set, bump the file VERSION"],"tags":["graalvm","replay-compilation","deserialization","singleton","version-skew"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}