From 1f97a8e48795be99c7239b21156730ce49931f99 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Sun, 4 Oct 2026 02:17:00 +0200 Subject: [PATCH] Record actual world difficulty and preserve sanitized culling fixture evidence --- .../linux-applied-hooks.json | 47 +++++++++++++++++++ docs/culling-empty.md | 11 +++++ .../dev/horizonlab/client/HorizonClient.java | 1 + tests/test_packs.py | 5 +- tools/Compare-Benchmarks.html | 3 +- tools/compare_benchmarks.py | 2 +- 6 files changed, 65 insertions(+), 4 deletions(-) create mode 100644 benchmarks/culling-empty-2026-10-04/linux-applied-hooks.json diff --git a/benchmarks/culling-empty-2026-10-04/linux-applied-hooks.json b/benchmarks/culling-empty-2026-10-04/linux-applied-hooks.json new file mode 100644 index 000000000..5a3a31a0d --- /dev/null +++ b/benchmarks/culling-empty-2026-10-04/linux-applied-hooks.json @@ -0,0 +1,47 @@ +{ + "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", + "results": [ + { + "enabled": false, + "empty_iterator_calls": 1, + "live_registration_checked": true, + "block_callback_order_checked": true, + "type_guard_checked": true, + "allocated_bytes": 128001272, + "cpu_ns": 29632156, + "wall_ns": 49712014, + "measured_calls": 4000000, + "result": false + }, + { + "enabled": true, + "empty_iterator_calls": 0, + "live_registration_checked": true, + "block_callback_order_checked": true, + "type_guard_checked": true, + "allocated_bytes": 208, + "cpu_ns": 809881, + "wall_ns": 801517, + "measured_calls": 4000000, + "result": false + } + ], + "notes": [ + "Actual publisher whitelist methods inside Fabric; live registration and block-entity callbacks checked.", + "Nonempty iteration, callback order, short circuit, null/wrong-type inputs and clearing retain upstream behavior.", + "Empty-state iterator counts use a private instrumented set; allocation loop uses normal empty HashSets.", + "Entity callbacks with a valid game entity are not exercised by this menu-only fixture.", + "JIT escape analysis can remove allocations in an isolated loop; real culling-thread profiles are needed.", + "Not a game FPS, whole-game RAM, visual equivalence or Mac GPU benchmark.", + "Much of an empty warmed loop may be folded by the JIT; CPU timings are not per-check costs or game speed estimates." + ], + "provenance": { + "source_commit": "35dd69e9a6279fa89d762a0d24e49b0dbdb11b51", + "ci_run": "https://github.com/ludovic111/minecraft-optimization-lab/actions/runs/37164002916", + "artifact": "horizon-ubuntu-latest" + } +} diff --git a/docs/culling-empty.md b/docs/culling-empty.md index 679802511..7c0e1bfdf 100644 --- a/docs/culling-empty.md +++ b/docs/culling-empty.md @@ -31,3 +31,14 @@ observation. These counts isolate this allocation path; JIT escape analysis can produce different results in other calling contexts. They are not game FPS, whole-game RAM, statistical speed estimates or Mac GPU results. Live culling thread profiles, matching workloads and repeated hardware tests remain needed. + +For local world smoke checks, the baseline and candidate use separate copies of +the same peaceful demo-world snapshot. An earlier capture was interrupted by a +zombie killing the player and is excluded from performance comparisons. Release +packs do not change world difficulty. Frame reports now capture actual world +difficulty at their start/end boundaries so comparison tools can flag a mismatch. + +The [sanitized Linux CI result](../benchmarks/culling-empty-2026-10-04/linux-applied-hooks.json) +includes its source/workflow provenance and independently checks live registration +and the applied shortcut. CPU timings can include JIT folding of this empty loop; +they are not per-check costs or estimates of game speed. diff --git a/mods/horizon-lab/src/main/java/dev/horizonlab/client/HorizonClient.java b/mods/horizon-lab/src/main/java/dev/horizonlab/client/HorizonClient.java index 4fd4cb7bd..2a7442ea9 100644 --- a/mods/horizon-lab/src/main/java/dev/horizonlab/client/HorizonClient.java +++ b/mods/horizon-lab/src/main/java/dev/horizonlab/client/HorizonClient.java @@ -116,6 +116,7 @@ public final class HorizonClient implements ClientModInitializer { private static Map visualSettings(Minecraft client) { Map context = new LinkedHashMap<>(); + if (client.level != null) context.put("world_difficulty", client.level.getDifficulty().name()); context.put("render_distance", client.options.renderDistance().get()); context.put("simulation_distance", client.options.simulationDistance().get()); context.put("vsync", client.options.enableVsync().get()); diff --git a/tests/test_packs.py b/tests/test_packs.py index b10e6e1d9..ffe754910 100644 --- a/tests/test_packs.py +++ b/tests/test_packs.py @@ -185,13 +185,14 @@ class ComparisonTests(unittest.TestCase): def test_terrain_quality_and_shader_changes_cannot_look_like_equal_workloads(self): baseline = self.report() baseline.update(dh_capture_status="available", dh_lod_radius_chunks=128, dh_horizontal_quality="MEDIUM", - iris_capture_status="available", iris_shaders_enabled=False, dh_thread_count=2) + iris_capture_status="available", iris_shaders_enabled=False, dh_thread_count=2, world_difficulty="NORMAL") candidate = copy.deepcopy(baseline) candidate.update(dh_lod_radius_chunks=256, iris_shaders_enabled=True, iris_shader_pack="Example pack", - dh_thread_count=1, visual_settings_changed=["render_distance"]) + dh_thread_count=1, world_difficulty="PEACEFUL", visual_settings_changed=["render_distance"]) result = compare_benchmarks.compare(baseline, candidate) self.assertTrue(any("dh_lod_radius_chunks" in field for field in result["mismatches"])) self.assertTrue(any("iris_shaders_enabled" in field for field in result["mismatches"])) + self.assertTrue(any("world_difficulty" in field for field in result["mismatches"])) self.assertTrue(any("dh_thread_count differs" in warning for warning in result["warnings"])) self.assertTrue(any("changed between capture boundaries" in warning for warning in result["warnings"])) legacy = self.report() diff --git a/tools/Compare-Benchmarks.html b/tools/Compare-Benchmarks.html index 0df12a094..1df766bce 100644 --- a/tools/Compare-Benchmarks.html +++ b/tools/Compare-Benchmarks.html @@ -30,7 +30,7 @@