[PR #3337] [MERGED] perf_bench: compile the driver mod with JAVA_HOME's javac #4910

Closed
opened 2026-11-03 05:08:51 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3337
Author: @degepie
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: fix/perf-bench-javac-java-home


📝 Commits (1)

  • de25583 perf_bench: compile the driver mod with JAVA_HOME's javac

📊 Changes

1 file changed (+2 additions, -1 deletions)

View changed files

📝 tools/perf_bench.py (+2 -1)

📄 Description

🤖 Opened by degepie's AI agent (Claude Code), not by degepie personally.

What

tools/perf_bench.py --game vanilla (and vanilla-mods) stops before any game starts on a machine where JAVA_HOME points at a JDK 25 but an older JDK comes first on PATH, which is common: Ubuntu 24.04's default JDK is 21.

error: release version 25 not supported
subprocess.CalledProcessError: Command '['javac', '--release', '25', …]' returned non-zero exit status 2.

Why

build_bench_mod runs a bare javac from PATH, while the game launches below (run_vanilla, and the NeoForge run around line 667) use $JAVA_HOME/bin/java. docs/benchmark.md asks for "Java 25 with javac", and JAVA_HOME is how a reader points the script at it, but only half the script follows it.

How

Use $JAVA_HOME/bin/javac when JAVA_HOME is set, with the same one-line lookup as the java ones. Without JAVA_HOME, javac comes from PATH as before. Two lines changed in tools/perf_bench.py.

Verified

On Linux, I called build_bench_mod(vanilla_classpath(vanilla_manifest()) + runtime.fabric_libraries()), exactly as run_vanilla does, against prepared 26.3 resources:

main (a1e56a4d) this branch
JAVA_HOME=JDK 25, PATH javac=21 (Temurin 21.0.13) ❌ release version 25 not supported ✅ horizon-bench.jar built
no JAVA_HOME, PATH javac=21 ❌ ❌ same error (unchanged, expected)
no JAVA_HOME, PATH javac=25 ✅ ✅

No harness imports perf_bench (it only appears in a docstring in tools/neoforge_oracle.py). parity.py --changed still selects 355 harnesses for a tools/ change, so I ran --quick and leave the selection to CI. pr_ready suggests skip-release, since players see no change. I can't set labels from a fork.

pr_ready (tools/pr_ready.py --quick on b550, against origin/main at b7df7bd9e, 30 s)

Check Result
Scope ✅ 1 files, +2 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 402 passed (30 s)
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label skip-release

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3337 **Author:** [@degepie](https://github.com/degepie) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/perf-bench-javac-java-home` --- ### 📝 Commits (1) - [`de25583`](https://github.com/horizon-rust/horizon/commit/de25583ee5ed2d5c40b6e0ee91982da31084c4bd) perf_bench: compile the driver mod with JAVA_HOME's javac ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tools/perf_bench.py` (+2 -1) </details> ### 📄 Description > 🤖 Opened by degepie's AI agent (Claude Code), not by degepie personally. ## What `tools/perf_bench.py --game vanilla` (and `vanilla-mods`) stops before any game starts on a machine where `JAVA_HOME` points at a JDK 25 but an older JDK comes first on `PATH`, which is common: Ubuntu 24.04's default JDK is 21. ``` error: release version 25 not supported subprocess.CalledProcessError: Command '['javac', '--release', '25', …]' returned non-zero exit status 2. ``` ## Why `build_bench_mod` runs a bare `javac` from `PATH`, while the game launches below (`run_vanilla`, and the NeoForge run around line 667) use `$JAVA_HOME/bin/java`. `docs/benchmark.md` asks for "Java 25 with `javac`", and `JAVA_HOME` is how a reader points the script at it, but only half the script follows it. ## How Use `$JAVA_HOME/bin/javac` when `JAVA_HOME` is set, with the same one-line lookup as the `java` ones. Without `JAVA_HOME`, `javac` comes from `PATH` as before. Two lines changed in `tools/perf_bench.py`. ## Verified On Linux, I called `build_bench_mod(vanilla_classpath(vanilla_manifest()) + runtime.fabric_libraries())`, exactly as `run_vanilla` does, against prepared 26.3 resources: | | `main` (a1e56a4d) | this branch | |---|---|---| | `JAVA_HOME`=JDK 25, `PATH` javac=21 (Temurin 21.0.13) | ❌ `release version 25 not supported` | ✅ `horizon-bench.jar` built | | no `JAVA_HOME`, `PATH` javac=21 | ❌ | ❌ same error (unchanged, expected) | | no `JAVA_HOME`, `PATH` javac=25 | ✅ | ✅ | No harness imports `perf_bench` (it only appears in a docstring in `tools/neoforge_oracle.py`). `parity.py --changed` still selects 355 harnesses for a `tools/` change, so I ran `--quick` and leave the selection to CI. `pr_ready` suggests `skip-release`, since players see no change. I can't set labels from a fork. **pr_ready** (`tools/pr_ready.py --quick` on b550, against origin/main at b7df7bd9e, 30 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +2 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 402 passed (30 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | `skip-release` | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:08:51 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4910
No description provided.