From 702e59372f14696ac7d6436120d7ea7be351766e Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Sat, 3 Oct 2026 20:06:01 +0200 Subject: [PATCH] Ship portable optimization packs with original frame and tick measurement --- .github/workflows/ci.yml | 28 ++ .gitignore | 2 + README.md | 110 +++--- docs/optimization-plan.md | 4 +- docs/playable-validation.md | 28 ++ docs/server-quickstart.txt | 42 +++ .../main/java/dev/horizonlab/HorizonLab.java | 64 ++++ .../dev/horizonlab/client/HorizonClient.java | 130 +++++++ .../dev/horizonlab/metrics/Recording.java | 83 +++++ .../java/dev/horizonlab/metrics/Reports.java | 43 +++ .../dev/horizonlab/metrics/SampleStats.java | 36 ++ .../java/dev/horizonlab/mixin/FrameMixin.java | 16 + .../dev/horizonlab/mixin/ServerTickMixin.java | 25 ++ .../assets/horizonlab/lang/en_us.json | 3 + .../src/main/resources/fabric.mod.json | 21 ++ .../src/main/resources/horizonlab.mixins.json | 8 + .../dev/horizonlab/metrics/MetricsTest.java | 35 ++ packs/Mac-Start.command | 32 ++ packs/START-HERE.txt | 79 +++++ packs/config/cinematic.toml | 18 + packs/config/far-distance.toml | 17 + packs/config/m2-balanced.toml | 18 + packs/config/vulkan.toml | 18 + packs/fabric.lock.json | 75 ++++ packs/mods.lock.json | 322 ++++++++++++++++++ tests/test_lab.py | 4 +- tests/test_packs.py | 88 +++++ tools/build_mod.py | 81 +++++ tools/build_pack.py | 153 +++++++++ tools/build_release.py | 45 +++ tools/check_public_tree.py | 3 + tools/compare_benchmarks.py | 69 ++++ tools/runtime.py | 141 ++++++++ tools/server.py | 74 ++++ 34 files changed, 1868 insertions(+), 47 deletions(-) create mode 100644 docs/playable-validation.md create mode 100644 docs/server-quickstart.txt create mode 100644 mods/horizon-lab/src/main/java/dev/horizonlab/HorizonLab.java create mode 100644 mods/horizon-lab/src/main/java/dev/horizonlab/client/HorizonClient.java create mode 100644 mods/horizon-lab/src/main/java/dev/horizonlab/metrics/Recording.java create mode 100644 mods/horizon-lab/src/main/java/dev/horizonlab/metrics/Reports.java create mode 100644 mods/horizon-lab/src/main/java/dev/horizonlab/metrics/SampleStats.java create mode 100644 mods/horizon-lab/src/main/java/dev/horizonlab/mixin/FrameMixin.java create mode 100644 mods/horizon-lab/src/main/java/dev/horizonlab/mixin/ServerTickMixin.java create mode 100644 mods/horizon-lab/src/main/resources/assets/horizonlab/lang/en_us.json create mode 100644 mods/horizon-lab/src/main/resources/fabric.mod.json create mode 100644 mods/horizon-lab/src/main/resources/horizonlab.mixins.json create mode 100644 mods/horizon-lab/src/test/java/dev/horizonlab/metrics/MetricsTest.java create mode 100644 packs/Mac-Start.command create mode 100644 packs/START-HERE.txt create mode 100644 packs/config/cinematic.toml create mode 100644 packs/config/far-distance.toml create mode 100644 packs/config/m2-balanced.toml create mode 100644 packs/config/vulkan.toml create mode 100644 packs/fabric.lock.json create mode 100644 packs/mods.lock.json create mode 100644 tests/test_packs.py create mode 100644 tools/build_mod.py create mode 100644 tools/build_pack.py create mode 100644 tools/build_release.py create mode 100644 tools/compare_benchmarks.py create mode 100644 tools/runtime.py create mode 100644 tools/server.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb9bc85b9..609f4d456 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,3 +25,31 @@ jobs: cargo +stable clippy --workspace --all-targets -- -D warnings - name: Test voxel kernel correctness run: cargo +stable test --workspace + portable-mod: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-26, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '25' + - name: Compile original mod and test metrics + run: python tools/build_mod.py + - name: Build pinned portable packs + run: python tools/build_pack.py + - name: Test pack integrity and comparisons + run: python -m unittest discover -s tests -v + - name: Upload original mod and pack manifests only + uses: actions/upload-artifact@v4 + with: + name: horizon-${{ matrix.os }} + path: | + dist/*.mrpack + dist/horizon-lab-*.jar diff --git a/.gitignore b/.gitignore index 732d42083..d50bc8051 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ /assets/ /run/ /logs/ +/dist/ +/mods/horizon-lab/build/ diff --git a/README.md b/README.md index 2a7c089b0..abe495e8d 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,65 @@ -# Minecraft Optimization Lab +# Minecraft Optimization Lab / Horizon Lab -A personal research workspace for understanding Minecraft Java Edition and testing original performance improvements, including Rust kernels. Not affiliated with Mojang or Microsoft. +Client-first performance research for Minecraft Java **26.3**, preserving vanilla gameplay rules. Any language or renderer may be used when measured gains justify it. Not affiliated with Mojang or Microsoft. -**Current scope:** complete local client/server decompilation for pinned Java Edition **26.3**, class inventories and output checks, and a tested Rust occupancy experiment. This is not a playable Rust port, a rebuilt Minecraft distribution, or proof of a game-level speedup. +**First playable release:** pinned Java performance packs, distant terrain, an original frame/tick recorder, and Mac/client/server starter downloads. The M2 Pro/16 GB Mac is the first testing target. A Rust rewrite or custom renderer has not been completed; no M2 FPS improvement has been measured yet. -The game JARs, libraries, decompiled Java, inventories, and logs live **inside this checkout** under **`.local/`**, which is gitignored. GitHub contains only our tooling, original Rust code, and research documentation. A fresh clone regenerates the local game workspace from official downloads. +## Play on your Mac -## Prepare and inspect the game +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. -Requires Python 3.11+, JDK 25+, and Git. No Microsoft account credentials are needed for these downloads or decompilation. Use your normal licensed launcher and sign-in when playing or collecting client performance measurements. +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. + +| Profile | Full-detail chunks | Distant LOD radius | Suggested maximum heap | +| --- | ---: | ---: | ---: | +| baseline | 12 | none | 6144 MiB | +| m2-balanced | 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 | +| vulkan | 12 | 128 | 6144 MiB | + +Balanced combines [Sodium](https://modrinth.com/mod/sodium), [Lithium](https://modrinth.com/mod/lithium), [FerriteCore](https://modrinth.com/mod/ferrite-core), [ImmediatelyFast](https://modrinth.com/mod/immediatelyfast), [EntityCulling](https://modrinth.com/mod/entityculling), and [Distant Horizons](https://modrinth.com/mod/distanthorizons). Cinematic adds [Iris](https://modrinth.com/mod/iris) and [Complementary Reimagined](https://modrinth.com/shader/complementary-reimagined), initially disabled. Vulkan independently experiments with the game's own backend and fallback, without Iris. + +Distant LOD is simplified terrain. Nearby blocks retain full detail. Initial generation costs CPU/disk/memory and needs warm-up. DH adjusts clouds, chunk fade and transparency to blend its renderer; assess appearance as well as speed. Shaders cost GPU time and have [Mac-specific limits](https://shaders.properties/current/reference/miscellaneous/macos/). Universal CPU/GPU support and exact vanilla equivalence remain validation goals. Simulation distance stays 12 in every profile; normal 20 TPS rules are retained. + +## Measure on your hardware + +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