oracle/graal · error · ExperimentParserError

Failed to parse experiment {experimentId} in {resource}: une

Error message

Failed to parse experiment {experimentId} in {resource}: unexpected compilation kind: {compilationKind}

What it means

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.

Source

Thrown at compiler/src/org.graalvm.profdiff/src/org/graalvm/profdiff/parser/ExperimentParser.java:327

    /**
     * Parses proftool logs from a file view.
     *
     * @param fileView a view of a JSON file with the proftool log
     * @return the parsed proftool logs
     * @throws IOException failed to read the file
     * @throws ExperimentParserError failed to parse the file
     */
    private ProftoolLog parseProftoolLog(FileView fileView) throws IOException, ExperimentParserError {
        ExperimentJSONParser parser = new ExperimentJSONParser(experimentFiles.getExperimentId(), fileView);
        ProftoolLog proftoolLog = new ProftoolLog();
        ExperimentJSONParser.JSONMap map = parser.parse().asMap();
        String compilationKind = map.property(COMPILATION_KIND).asNullableString();
        if (COMPILATION_AOT.equals(compilationKind)) {
            proftoolLog.compilationKind = Experiment.CompilationKind.AOT;
        } else if (compilationKind == null || COMPILATION_JIT.equals(compilationKind)) {
            proftoolLog.compilationKind = Experiment.CompilationKind.JIT;
        } else {
            throw new ExperimentParserError(experimentFiles.getExperimentId(), fileView.getSymbolicPath(), "unexpected compilation kind: " + compilationKind);
        }
        proftoolLog.executionId = map.property(EXECUTION_ID).asNullableString();
        proftoolLog.totalPeriod = map.property(TOTAL_PERIOD).asLong();
        for (ExperimentJSONParser.JSONLiteral codeObject : map.property(CODE).asList()) {
            ExperimentJSONParser.JSONMap code = codeObject.asMap();
            String compilationId = code.property(COMPILE_ID).asNullableString();
            if (compilationId != null && compilationId.endsWith(OSR_MARKER)) {
                compilationId = compilationId.substring(0, compilationId.length() - 1);
            }
            String name = code.property(NAME).asString();
            int colonIndex = name.indexOf(NAME_SEPARATOR);
            if (colonIndex != -1) {
                name = name.substring(colonIndex + NAME_SEPARATOR.length());
            }
            long period = code.property(PERIOD).asLong();
            Integer level = code.property(LEVEL).asNullableInteger();
            proftoolLog.methods.add(new ProftoolMethod(compilationId, name, level, period));
        }

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Regenerate the proftool output with the same GraalVM version as profdiff.
  2. Upgrade profdiff (via mx/GraalVM) to a version that knows the new compilation kind.
  3. If the run was actually JIT/AOT, fix the field in the log to the matching marker or remove it (null means JIT).
Defensive patterns

Strategy: try-catch

Validate before calling

// Whitelist the kind value before parsing
String kind = (String) proftoolMap.get("compilationKind");
if (kind != null && !kind.equals("jit") && !kind.equals("aot")) {
    throw new IllegalStateException("Unsupported compilation kind in log: " + kind);
}

Type guard

static boolean isKnownCompilationKind(String kind) {
    return kind == null || kind.equals("jit") || kind.equals("aot");
}

Try / catch

try {
    ExperimentParser.parseOrPanic(...);
} catch (RuntimeException e) {
    if (e.getMessage().contains("unexpected compilation kind")) { /* upgrade profdiff or regenerate log */ }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Related errors


AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14). Data as JSON: /api/errors/7f4684fd2d0f1d5b. Report an issue: GitHub.