{"record":{"id":"7f4684fd2d0f1d5b","repo":"oracle/graal","slug":"failed-to-parse-experiment-experimentid-in-reso-7f4684","errorCode":null,"errorMessage":"Failed to parse experiment {experimentId} in {resource}: unexpected compilation kind: {compilationKind}","messagePattern":"Failed to parse experiment (.+?) in (.+?): unexpected compilation kind: (.+?)","errorType":"exception","errorClass":"ExperimentParserError","httpStatus":null,"severity":"error","filePath":"compiler/src/org.graalvm.profdiff/src/org/graalvm/profdiff/parser/ExperimentParser.java","lineNumber":327,"sourceCode":"    /**\n     * Parses proftool logs from a file view.\n     *\n     * @param fileView a view of a JSON file with the proftool log\n     * @return the parsed proftool logs\n     * @throws IOException failed to read the file\n     * @throws ExperimentParserError failed to parse the file\n     */\n    private ProftoolLog parseProftoolLog(FileView fileView) throws IOException, ExperimentParserError {\n        ExperimentJSONParser parser = new ExperimentJSONParser(experimentFiles.getExperimentId(), fileView);\n        ProftoolLog proftoolLog = new ProftoolLog();\n        ExperimentJSONParser.JSONMap map = parser.parse().asMap();\n        String compilationKind = map.property(COMPILATION_KIND).asNullableString();\n        if (COMPILATION_AOT.equals(compilationKind)) {\n            proftoolLog.compilationKind = Experiment.CompilationKind.AOT;\n        } else if (compilationKind == null || COMPILATION_JIT.equals(compilationKind)) {\n            proftoolLog.compilationKind = Experiment.CompilationKind.JIT;\n        } else {\n            throw new ExperimentParserError(experimentFiles.getExperimentId(), fileView.getSymbolicPath(), \"unexpected compilation kind: \" + compilationKind);\n        }\n        proftoolLog.executionId = map.property(EXECUTION_ID).asNullableString();\n        proftoolLog.totalPeriod = map.property(TOTAL_PERIOD).asLong();\n        for (ExperimentJSONParser.JSONLiteral codeObject : map.property(CODE).asList()) {\n            ExperimentJSONParser.JSONMap code = codeObject.asMap();\n            String compilationId = code.property(COMPILE_ID).asNullableString();\n            if (compilationId != null && compilationId.endsWith(OSR_MARKER)) {\n                compilationId = compilationId.substring(0, compilationId.length() - 1);\n            }\n            String name = code.property(NAME).asString();\n            int colonIndex = name.indexOf(NAME_SEPARATOR);\n            if (colonIndex != -1) {\n                name = name.substring(colonIndex + NAME_SEPARATOR.length());\n            }\n            long period = code.property(PERIOD).asLong();\n            Integer level = code.property(LEVEL).asNullableInteger();\n            proftoolLog.methods.add(new ProftoolMethod(compilationId, name, level, period));\n        }","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/org.graalvm.profdiff/src/org/graalvm/profdiff/parser/ExperimentParser.java#L309-L345","documentation":"parseProftoolLog reads the proftool JSON's compilation-kind field and accepts only null (defaults to JIT), the JIT marker, or the AOT marker. Any other string in that field raises ExperimentParserError('unexpected compilation kind: X') naming the experiment and file.","triggerScenarios":"A proftool log whose compilation-kind field contains an unrecognized value — e.g. from a newer GraalVM that introduced a new kind, or a hand-edited/renamed field value. null and the known JIT string fall through safely; everything else aborts.","commonSituations":"Version skew: proftool output from a newer JDK/GraalVM parsed by an older profdiff that only knows jit/aot; manual edits of the log; future kinds like 'libgraal' logs on old tooling.","solutions":["Regenerate the proftool output with the same GraalVM version as profdiff.","Upgrade profdiff (via mx/GraalVM) to a version that knows the new compilation kind.","If the run was actually JIT/AOT, fix the field in the log to the matching marker or remove it (null means JIT)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Whitelist the kind value before parsing\nString kind = (String) proftoolMap.get(\"compilationKind\");\nif (kind != null && !kind.equals(\"jit\") && !kind.equals(\"aot\")) {\n    throw new IllegalStateException(\"Unsupported compilation kind in log: \" + kind);\n}","typeGuard":"static boolean isKnownCompilationKind(String kind) {\n    return kind == null || kind.equals(\"jit\") || kind.equals(\"aot\");\n}","tryCatchPattern":"try {\n    ExperimentParser.parseOrPanic(...);\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"unexpected compilation kind\")) { /* upgrade profdiff or regenerate log */ }\n}","preventionTips":["Keep proftool and profdiff from the same GraalVM build.","After upgrading GraalVM, regenerate all experiment inputs."],"tags":["profdiff","version-skew","proftool","configuration"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}