From 349724b3b612351daa1616daa79beca8897839ab Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Sun, 4 Oct 2026 03:42:11 +0200 Subject: [PATCH] Record independent ray geometry results and disclose excluded CLI frames --- .../linux-applied-hooks.json | 57 +++++++++++++++++++ .../local-applied-hooks.json | 54 ++++++++++++++++++ docs/culling-rays.md | 11 +++- tests/test_packs.py | 10 ++++ tools/compare_benchmarks.py | 2 + 5 files changed, 132 insertions(+), 2 deletions(-) create mode 100644 benchmarks/culling-rays-2026-10-04/linux-applied-hooks.json create mode 100644 benchmarks/culling-rays-2026-10-04/local-applied-hooks.json diff --git a/benchmarks/culling-rays-2026-10-04/linux-applied-hooks.json b/benchmarks/culling-rays-2026-10-04/linux-applied-hooks.json new file mode 100644 index 000000000..c7273503e --- /dev/null +++ b/benchmarks/culling-rays-2026-10-04/linux-applied-hooks.json @@ -0,0 +1,57 @@ +{ + "schema": 1, + "platform": "Linux-6.17.0-1022-azure-x86_64-with-glibc2.39", + "architecture": "x86_64", + "minecraft": "26.3", + "entity_culling": "1.11.2", + "original_mod_sha256": "7351b417fc83460def5947636444413874ee812e949342f091ef03674e0c0e58", + "results": [ + { + "enabled": false, + "public_boxes": 12800, + "provider_reads": 105239, + "edge_rays": 2197, + "visibility_digest": "da7286327283ce854dca2ab798d97c3b1cde55ac67112bd231c48df6d9388e00", + "query_digest": "124074ad764ab680b93896d47fa347a15f0b17ef41d2f8af5bd8e75f75208e12", + "intersection_digest": "f311c0b608b44b9eab2bb1e6347c3e18b003d05c939a8fbea9ba81fb16c8e8ae", + "allocated_bytes": 1040, + "cpu_ns": 101807697, + "wall_ns": 162651689, + "measured_checks": 2000000, + "checksum": 0, + "input_unchanged": true, + "scratch_ownership_checked": true + }, + { + "enabled": true, + "public_boxes": 12800, + "provider_reads": 105239, + "edge_rays": 2197, + "visibility_digest": "da7286327283ce854dca2ab798d97c3b1cde55ac67112bd231c48df6d9388e00", + "query_digest": "124074ad764ab680b93896d47fa347a15f0b17ef41d2f8af5bd8e75f75208e12", + "intersection_digest": "f311c0b608b44b9eab2bb1e6347c3e18b003d05c939a8fbea9ba81fb16c8e8ae", + "allocated_bytes": 920, + "cpu_ns": 118540489, + "wall_ns": 235470173, + "measured_checks": 2000000, + "checksum": 0, + "input_unchanged": true, + "scratch_ownership_checked": true + } + ], + "notes": [ + "Actual upstream culling methods inside Fabric; private fixture invokers do not enter production packs.", + "Two interleaved instances and several occluder patterns; matching boolean and query digests.", + "Signed zero, tiny/large values, infinities and NaN are exercised directly in ray intersection.", + "Unchanged input vectors, independent instance scratch and upstream arithmetic values are checked.", + "Allocation and CPU are single warmed caller-loop observations; JIT folding can vary.", + "Not a game FPS, visual-equivalence proof, whole-game RAM or Mac GPU benchmark." + ], + "provenance": { + "source_commit": "7cbe37b60594fb1631bc308f126d7925c4264a18", + "command": "python tools/test_culling_rays.py", + "workflow_run": "https://github.com/ludovic111/minecraft-optimization-lab/actions/runs/37168352974", + "job": "portable-mod (ubuntu-latest)", + "artifact": "horizon-ubuntu-latest" + } +} diff --git a/benchmarks/culling-rays-2026-10-04/local-applied-hooks.json b/benchmarks/culling-rays-2026-10-04/local-applied-hooks.json new file mode 100644 index 000000000..4f2f8cda9 --- /dev/null +++ b/benchmarks/culling-rays-2026-10-04/local-applied-hooks.json @@ -0,0 +1,54 @@ +{ + "schema": 1, + "platform": "Linux-7.0.0-31-generic-x86_64-with-glibc2.43", + "architecture": "x86_64", + "minecraft": "26.3", + "entity_culling": "1.11.2", + "original_mod_sha256": "7351b417fc83460def5947636444413874ee812e949342f091ef03674e0c0e58", + "results": [ + { + "enabled": false, + "public_boxes": 12800, + "provider_reads": 105239, + "edge_rays": 2197, + "visibility_digest": "da7286327283ce854dca2ab798d97c3b1cde55ac67112bd231c48df6d9388e00", + "query_digest": "124074ad764ab680b93896d47fa347a15f0b17ef41d2f8af5bd8e75f75208e12", + "intersection_digest": "f311c0b608b44b9eab2bb1e6347c3e18b003d05c939a8fbea9ba81fb16c8e8ae", + "allocated_bytes": 24318096, + "cpu_ns": 166989515, + "wall_ns": 239648128, + "measured_checks": 2000000, + "checksum": 0, + "input_unchanged": true, + "scratch_ownership_checked": true + }, + { + "enabled": true, + "public_boxes": 12800, + "provider_reads": 105239, + "edge_rays": 2197, + "visibility_digest": "da7286327283ce854dca2ab798d97c3b1cde55ac67112bd231c48df6d9388e00", + "query_digest": "124074ad764ab680b93896d47fa347a15f0b17ef41d2f8af5bd8e75f75208e12", + "intersection_digest": "f311c0b608b44b9eab2bb1e6347c3e18b003d05c939a8fbea9ba81fb16c8e8ae", + "allocated_bytes": 920, + "cpu_ns": 149367051, + "wall_ns": 165549458, + "measured_checks": 2000000, + "checksum": 0, + "input_unchanged": true, + "scratch_ownership_checked": true + } + ], + "notes": [ + "Actual upstream culling methods inside Fabric; private fixture invokers do not enter production packs.", + "Two interleaved instances and several occluder patterns; matching boolean and query digests.", + "Signed zero, tiny/large values, infinities and NaN are exercised directly in ray intersection.", + "Unchanged input vectors, independent instance scratch and upstream arithmetic values are checked.", + "Allocation and CPU are single warmed caller-loop observations; JIT folding can vary.", + "Not a game FPS, visual-equivalence proof, whole-game RAM or Mac GPU benchmark." + ], + "provenance": { + "source_commit": "7cbe37b60594fb1631bc308f126d7925c4264a18", + "command": "python tools/test_culling_rays.py" + } +} diff --git a/docs/culling-rays.md b/docs/culling-rays.md index 86b090074..86c7e111d 100644 --- a/docs/culling-rays.md +++ b/docs/culling-rays.md @@ -37,8 +37,15 @@ with the original constructors versus 920 with scratch reuse. Single caller CPU observations were about 167 versus 149 ms. Another unchanged run allocated only 6,259,360 bytes, illustrating how JIT compilation and escape analysis vary during these loops. No fixed per-check allocation or statistical speedup is inferred. -This is not a whole-game FPS/RAM or Mac GPU benchmark; repeated real hardware -comparisons and live allocation profiles are required. +The independent Linux CI run allocated only 1,040 bytes upstream versus 920 +with scratch reuse, and its caller CPU observation was about 102 versus 119 ms. +That run provides no useful allocation reduction and is slower in this loop. +The hook therefore stays isolated and disabled in every recommended profile. +Raw [local](../benchmarks/culling-rays-2026-10-04/local-applied-hooks.json) and +[CI](../benchmarks/culling-rays-2026-10-04/linux-applied-hooks.json) observations +include source and workflow provenance. This is not a whole-game FPS/RAM or Mac +GPU benchmark; repeated real hardware comparisons and live allocation profiles +are required. The factory hook follows the upstream [Mixin constructor redirect contract](https://github.com/SpongePowered/Mixin/blob/master/src/main/java/org/spongepowered/asm/mixin/injection/Redirect.java). Compilation uses a checksum-verified publisher JAR; the release mod contains only diff --git a/tests/test_packs.py b/tests/test_packs.py index 31f947100..20e8b0537 100644 --- a/tests/test_packs.py +++ b/tests/test_packs.py @@ -188,6 +188,16 @@ class ComparisonTests(unittest.TestCase): with self.assertRaises(ValueError): compare_benchmarks.compare(self.report(), other) + def test_excluded_frames_disclose_that_process_counters_cover_inactive_time(self): + baseline = self.report() + candidate = copy.deepcopy(baseline) + candidate["excluded_frames"] = 28 + result = compare_benchmarks.compare(baseline, candidate) + self.assertEqual(result["mismatches"], []) + self.assertTrue(any("candidate excluded 28" in warning and "Process CPU still spans" in warning + for warning in result["warnings"])) + self.assertFalse(any("baseline excluded" in warning for warning in result["warnings"])) + def test_jvm_experiment_warns_without_rejecting_an_intentional_change(self): baseline = self.report() baseline.update(compact_object_headers=False, garbage_collectors=["G1 Young Generation"]) diff --git a/tools/compare_benchmarks.py b/tools/compare_benchmarks.py index c9adebc9b..87655513d 100644 --- a/tools/compare_benchmarks.py +++ b/tools/compare_benchmarks.py @@ -50,6 +50,8 @@ def compare(baseline, candidate): 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.") + if report["kind"] == "frames" and report.get("excluded_frames", 0): + warnings.append(f"{name} excluded {report['excluded_frames']} menu, paused or unfocused frame starts. Process CPU still spans the whole recording.") if report.get("elapsed_seconds", 0) < 60: warnings.append(f"{name} is shorter than 60 seconds; use longer repeated runs for decisions.") if baseline["kind"] == "ticks" and baseline.get("peak_players") != candidate.get("peak_players"):