From 26e8da07bd20c053d961d0f76d966d57e4fb4286 Mon Sep 17 00:00:00 2001
From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com>
Date: Sat, 3 Oct 2026 22:08:05 +0200
Subject: [PATCH] Add offline frame and server benchmark comparison viewer
---
README.md | 4 +-
.../src/main/resources/fabric.mod.json | 2 +-
packs/START-HERE.txt | 8 +
packs/mods.lock.json | 2 +-
tools/Compare-Benchmarks.html | 183 ++++++++++++++++++
tools/build_release.py | 7 +-
tools/compare_benchmarks.py | 3 +
7 files changed, 205 insertions(+), 4 deletions(-)
create mode 100644 tools/Compare-Benchmarks.html
diff --git a/README.md b/README.md
index ebd3d8b1b..914723970 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ Client-first performance research for Minecraft Java **26.3**, preserving vanill
## Play on your Mac
-Download **horizon-mac-starter-0.3.0.zip** from [Releases](https://github.com/ludovic111/minecraft-optimization-lab/releases), extract it and open `Mac-Start.command`. It verifies and installs official universal Prism Launcher in `~/Applications` if needed, then opens the balanced pack import. Sign into Microsoft **inside Prism yourself**. This project needs no credentials.
+Download **horizon-mac-starter-0.5.0.zip** from [Releases](https://github.com/ludovic111/minecraft-optimization-lab/releases), extract it and open `Mac-Start.command`. It verifies and installs official universal Prism Launcher in `~/Applications` if needed, then opens the balanced pack import. Sign into Microsoft **inside Prism yourself**. This project needs no credentials.
Use native **Java 25 ARM64**, maximum heap **6144 MiB**, minimum **512 MiB** on your 16 GB M2 Pro. Prism can download Java automatically. Start at 1280×800 or 1920×1200; full Retina resolution is a larger GPU workload. [START-HERE.txt](packs/START-HERE.txt) has details. The same `.mrpack` files import into Prism on Windows and Linux.
@@ -47,6 +47,8 @@ The instance's `horizon-benchmarks/` folder receives JSON/CSV frame and integrat
python3 tools/compare_benchmarks.py baseline-frames.json optimized-frames.json --strict
```
+Open `Compare-Benchmarks.html` from the starter ZIP or [the source file](tools/Compare-Benchmarks.html) in your browser to compare without Python. Select each JSON and optionally its matching CSV. It exports summary JSON, flags settings and duration differences, and charts frames by recorded active time or ticks by sample number. It is self-contained and makes no network requests.
+
The comparison flags captured setting differences, but cannot verify route, world, shader state or cache warm-up. See [validation evidence](docs/playable-validation.md). Software-renderer test FPS is not evidence of a Mac/GPU speedup.
## Build and run
diff --git a/mods/horizon-lab/src/main/resources/fabric.mod.json b/mods/horizon-lab/src/main/resources/fabric.mod.json
index 8c8e27675..e2354e2fd 100644
--- a/mods/horizon-lab/src/main/resources/fabric.mod.json
+++ b/mods/horizon-lab/src/main/resources/fabric.mod.json
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "horizonlab",
- "version": "0.4.0",
+ "version": "0.5.0",
"name": "Horizon Lab",
"description": "Client frame pacing and server tick measurements for reproducible optimization experiments.",
"authors": [
diff --git a/packs/START-HERE.txt b/packs/START-HERE.txt
index 90e244184..eb7dd71cc 100644
--- a/packs/START-HERE.txt
+++ b/packs/START-HERE.txt
@@ -80,6 +80,14 @@ MEASURE ON YOUR M2 PRO
5. Repeat at least three times, alternating baseline/optimized. For daily play
turn VSync back on or cap FPS to your display; uncapped FPS spends more power.
+COMPARE WITHOUT PYTHON
+Open Compare-Benchmarks.html from this ZIP in Safari, Chrome, Firefox or Edge.
+Choose one baseline JSON and one candidate JSON from horizon-benchmarks. You can
+select each JSON together with its matching CSV to see duration charts. Frame and
+tick reports are compared separately. Files stay on your device; the viewer needs
+no server, account, installation or network access. Check its settings/route/warm-up
+warnings before drawing conclusions. Save comparison exports a summary JSON.
+
DH changes clouds, chunk fade and transparency to blend its distant renderer;
assess visual differences as well as speed. For collector experiments test
Java 25's -XX:+UseZGC against its default G1 in both profiles; ZGC trades some
diff --git a/packs/mods.lock.json b/packs/mods.lock.json
index c58091a1f..7157a8c72 100644
--- a/packs/mods.lock.json
+++ b/packs/mods.lock.json
@@ -3,7 +3,7 @@
"minecraft": "26.3",
"java_major": 25,
"fabric_loader": "0.19.5",
- "pack_version": "0.4.0",
+ "pack_version": "0.5.0",
"projects": {
"sodium": {
"slug": "sodium",
diff --git a/tools/Compare-Benchmarks.html b/tools/Compare-Benchmarks.html
new file mode 100644
index 000000000..6ed2c25bf
--- /dev/null
+++ b/tools/Compare-Benchmarks.html
@@ -0,0 +1,183 @@
+
+
+
+
+
+
Horizon Lab — Compare runs
+
+
+
Horizon Lab
Offline · files stay on your device
+
Compare your runs.
+
Choose two Horizon benchmark JSON files from your instance’s horizon-benchmarks folder. Add each matching CSV to see frame spikes. Compare frames with frames, or server ticks with server ticks.
+
+
Baseline
Vanilla or your previous configuration.
No report selected.
+
Candidate
The configuration you want to evaluate.
No report selected.
+
+
Your measurements go here.
Record with F8 in the game. Keep the world, route, graphics settings and warm-up consistent.
+
+
+
Frame comparison
+
+
Measurement
Baseline
Candidate
Change
+
Changes are candidate versus baseline. Higher FPS is better; lower frame/tick duration, memory and CPU use is usually better. Check workload differences before attributing any change to an optimization.
+
Frame pacing
BaselineCandidate
Move over the chart to inspect a time bucket.
+
+
+
+
+
+
diff --git a/tools/build_release.py b/tools/build_release.py
index cdd548ec0..7773488c9 100644
--- a/tools/build_release.py
+++ b/tools/build_release.py
@@ -23,8 +23,12 @@ def main():
client["START-HERE.txt"] = (ROOT / "packs/START-HERE.txt").read_text().replace("@PACK_VERSION@", version).encode()
client["Mac-Start.command"] = (ROOT / "packs/Mac-Start.command").read_text().replace("@PACK_VERSION@", version).encode()
client["LICENSE"] = (ROOT / "LICENSE").read_bytes()
+ viewer = (ROOT / "tools/Compare-Benchmarks.html").read_bytes()
+ client["Compare-Benchmarks.html"] = viewer
+ (ROOT / "dist/Compare-Benchmarks.html").write_bytes(viewer)
build_pack.write_zip(ROOT / "dist" / f"horizon-mac-starter-{version}.zip", client)
server = {"LICENSE": client["LICENSE"], "dist/" + mod.name: mod.read_bytes(),
+ "Compare-Benchmarks.html": viewer,
"START-HERE.txt": (ROOT / "docs/server-quickstart.txt").read_bytes(),
"research-lock.json": (ROOT / "research-lock.json").read_bytes()}
for name in ["lab.py", "runtime.py", "server.py", "compare_benchmarks.py"]:
@@ -33,9 +37,10 @@ def main():
server["packs/" + name] = (ROOT / "packs" / name).read_bytes()
build_pack.write_zip(ROOT / "dist" / f"horizon-server-starter-{version}.zip", server)
artifacts = sorted(path for path in (ROOT / "dist").glob("*") if version in path.name)
+ artifacts.append(ROOT / "dist/Compare-Benchmarks.html")
checksums = []
for path in artifacts:
- if path.suffix in [".jar", ".mrpack", ".zip"]:
+ if path.suffix in [".jar", ".mrpack", ".zip", ".html"]:
checksums.append(hashlib.sha256(path.read_bytes()).hexdigest() + " " + path.name)
(ROOT / "dist/SHA256SUMS.txt").write_text("\n".join(checksums) + "\n")
print("Built client/server starters and SHA256SUMS.txt")
diff --git a/tools/compare_benchmarks.py b/tools/compare_benchmarks.py
index 6f024d3e7..587020a4d 100644
--- a/tools/compare_benchmarks.py
+++ b/tools/compare_benchmarks.py
@@ -23,6 +23,9 @@ def compare(baseline, candidate):
mismatches = [f"{key}: {baseline.get(key)!r} vs {candidate.get(key)!r}" for key in MATCH_FIELDS
if baseline.get(key) != candidate.get(key)]
warnings = ["World, route, warm-up, shader state and LOD cache must also match; these are not verified by this tool."]
+ if abs(baseline.get("elapsed_seconds", 0) - candidate.get("elapsed_seconds", 0)) > max(
+ 2, min(baseline.get("elapsed_seconds", 0), candidate.get("elapsed_seconds", 0)) * 0.1):
+ warnings.append("Recording durations differ; match durations when comparing memory peaks and collection totals.")
for name, report in [("baseline", baseline), ("candidate", candidate)]:
if report.get("dropped_samples", 0):
warnings.append(f"{name} exceeded the recording buffer: {report['dropped_samples']} dropped samples.")