From 9c2100563e17bd83a58271d44bcc022db499fd6e Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Sat, 3 Oct 2026 20:38:34 +0200 Subject: [PATCH] Add optional adaptive distant terrain budget and resource telemetry --- README.md | 8 +- docs/adaptive-terrain.md | 54 ++++++++++++++ .../dev/horizonlab/budget/TerrainBudget.java | 38 ++++++++++ .../client/DistantTerrainBudget.java | 73 +++++++++++++++++++ .../dev/horizonlab/client/HorizonClient.java | 56 ++++++++++++-- .../dev/horizonlab/metrics/Recording.java | 36 ++++++++- .../src/main/resources/fabric.mod.json | 18 +++-- .../horizonlab/budget/TerrainBudgetTest.java | 30 ++++++++ .../dev/horizonlab/metrics/MetricsTest.java | 6 ++ packs/Mac-Start.command | 2 +- packs/START-HERE.txt | 15 +++- packs/mods.lock.json | 2 +- tests/test_packs.py | 3 +- tools/build_mod.py | 7 ++ tools/build_pack.py | 9 ++- tools/build_release.py | 6 +- tools/compare_benchmarks.py | 3 +- tools/server.py | 5 +- 18 files changed, 342 insertions(+), 29 deletions(-) create mode 100644 docs/adaptive-terrain.md create mode 100644 mods/horizon-lab/src/main/java/dev/horizonlab/budget/TerrainBudget.java create mode 100644 mods/horizon-lab/src/main/java/dev/horizonlab/client/DistantTerrainBudget.java create mode 100644 mods/horizon-lab/src/test/java/dev/horizonlab/budget/TerrainBudgetTest.java diff --git a/README.md b/README.md index abe495e8d..23f9e4e6f 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ 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 | | low-memory | 8 | none | 3072 MiB | | far-distance | 12 | 256 | 8192 MiB, with sufficient physical RAM | | cinematic | 12 | 128 | 6144 MiB | @@ -25,6 +26,11 @@ Distant LOD is simplified terrain. Nearby blocks retain full detail. Initial gen ## Measure on your hardware +The optional [adaptive terrain experiment](docs/adaptive-terrain.md) throttles distant +terrain background work when frames slow down or heap pressure rises, keeping the +balanced profile's view distances and simulation settings. It remains opt-in until +real hardware demonstrates a benefit. + 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