From 4052f2040d484bd261ca19d87893eee6b8662e13 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Sat, 3 Oct 2026 21:11:30 +0200 Subject: [PATCH] Add optional precise distant terrain worker pacing --- .github/workflows/ci.yml | 3 + README.md | 10 ++- docs/worker-pacing.md | 59 +++++++++++++++++ .../dev/horizonlab/budget/WorkerPacer.java | 35 ++++++++++ .../dev/horizonlab/client/HorizonClient.java | 1 + .../horizonlab/mixin/DhWorkerPacingMixin.java | 42 ++++++++++++ .../horizonlab/mixin/HorizonMixinPlugin.java | 45 +++++++++++++ .../src/main/resources/fabric.mod.json | 2 +- .../src/main/resources/horizonlab.mixins.json | 3 +- .../horizonlab/budget/WorkerPacerTest.java | 46 +++++++++++++ .../budget/WorkerPacingBenchmark.java | 64 +++++++++++++++++++ packs/START-HERE.txt | 8 +++ packs/mods.lock.json | 2 +- tools/build_mod.py | 29 +++++++++ tools/build_pack.py | 7 +- 15 files changed, 350 insertions(+), 6 deletions(-) create mode 100644 docs/worker-pacing.md create mode 100644 mods/horizon-lab/src/main/java/dev/horizonlab/budget/WorkerPacer.java create mode 100644 mods/horizon-lab/src/main/java/dev/horizonlab/mixin/DhWorkerPacingMixin.java create mode 100644 mods/horizon-lab/src/main/java/dev/horizonlab/mixin/HorizonMixinPlugin.java create mode 100644 mods/horizon-lab/src/test/java/dev/horizonlab/budget/WorkerPacerTest.java create mode 100644 mods/horizon-lab/src/test/java/dev/horizonlab/budget/WorkerPacingBenchmark.java diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 609f4d456..f4ce0661f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,6 +44,8 @@ jobs: run: python tools/build_mod.py - name: Build pinned portable packs run: python tools/build_pack.py + - name: Measure isolated worker pacing on this platform + run: python -c "from tools.build_mod import benchmark_workers; benchmark_workers()" - name: Test pack integrity and comparisons run: python -m unittest discover -s tests -v - name: Upload original mod and pack manifests only @@ -53,3 +55,4 @@ jobs: path: | dist/*.mrpack dist/horizon-lab-*.jar + dist/worker-pacing-benchmark.txt diff --git a/README.md b/README.md index 23f9e4e6f..ebd3d8b1b 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.2.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.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. 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. @@ -15,6 +15,8 @@ Use native **Java 25 ARM64**, maximum heap **6144 MiB**, minimum **512 MiB** on | baseline | 12 | none | 6144 MiB | | m2-balanced | 12 | 128 | 6144 MiB | | adaptive (experiment) | 12 | 128 | 6144 MiB | +| worker-pacing (experiment) | 12 | 128 | 6144 MiB | +| adaptive-pacing (experiment) | 12 | 128 | 6144 MiB | | low-memory | 8 | none | 3072 MiB | | far-distance | 12 | 256 | 8192 MiB, with sufficient physical RAM | | cinematic | 12 | 128 | 6144 MiB | @@ -31,6 +33,10 @@ terrain background work when frames slow down or heap pressure rises, keeping th balanced profile's view distances and simulation settings. It remains opt-in until real hardware demonstrates a benefit. +The additional [precise worker pacing experiment](docs/worker-pacing.md) makes short +terrain tasks respect their duty-cycle budget and avoids boxed worker timestamps. +It changes generation speed and CPU use, so it stays separate from balanced. + Press **F8** during gameplay to start a 120-second recording, or again to stop early. Rebind in Controls if needed. This also works with restricted chat accounts. Alternatively: `/horizon bench