Merge remote-tracking branch 'origin/fix/st-cursor-close' into feat/st-default
This commit is contained in:
+10
-2
@@ -137,10 +137,17 @@ proposal, no profiling. Its cranelift backend generates native code for x86-64
|
||||
and ARM64 on Windows, macOS and Linux, which is why one `.hmod` serves them
|
||||
all.
|
||||
|
||||
The game links it only with its `mods` feature: every release build turns it
|
||||
on (`release.yml`), and a build from source needs
|
||||
`cargo build --release -p horizon-client --features mods` to run code mods.
|
||||
Without it (the tests and probes) wasmtime and cranelift aren't built, a
|
||||
quarter of a clean build; content mods still load, and the game logs why the
|
||||
code mods don't start.
|
||||
|
||||
### Performance
|
||||
|
||||
Measured on the Mac mini (M4 Pro), release build, `cargo test -p
|
||||
horizon-mods --release --test sandbox -- --ignored --nocapture`:
|
||||
horizon-mods --features runtime,pack --release --test sandbox -- --ignored --nocapture`:
|
||||
|
||||
| | per call |
|
||||
|---|---|
|
||||
@@ -180,7 +187,8 @@ chat (`Mod Test Guest stopped: it took too long (an endless loop?)`), marks it
|
||||
on the Mods page and carries on; the other mods keep running. Host functions
|
||||
clip what a mod hands back (chat lines per call, HUD lines and lengths). Tests:
|
||||
`crates/horizon-mods/tests/sandbox.rs` (an endless loop, a panic and a 1 GiB
|
||||
allocation, next to a healthy mod).
|
||||
allocation, next to a healthy mod; `cargo test -p horizon-mods --features
|
||||
runtime,pack`).
|
||||
|
||||
## Playing with mods
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ Vanilla oracle runs are reused as well. `tools/parity_shim.py` stands in for `ja
|
||||
|
||||
Probes build into `.local/parity-target/` with release optimisation but no LTO and 16 codegen units. On ludodesktop that rebuilds every `horizon-world` probe in 3 seconds after a one-line change, against 122 seconds with the release profile. Rust gives these settings identical results (no fast-math; overflow checks as in release), and the full harness suite passes under them. Probes that harnesses build in the dev profile get `opt-level = 3` too, keeping their overflow checks and debug assertions. Harnesses must locate binaries through `cargo metadata` or `lab.cargo_target()`, never a hard-coded `target/`.
|
||||
|
||||
The probes of `horizon-world` and of `horizon-client` are one binary per crate, `cargo build --release -p <crate> --example probe`: a harness runs `probe <name> [arguments]`, and `<name>` is a module in `crates/<crate>/examples/probe/` (add it to the `mod` list and the `probes!` list in its `main.rs`; read arguments with `crate::args()` or `crate::args_os()`, which drop the name). Code several probes share goes in `examples/probe/support/` or a module of its own. Linking one binary instead of ~250 examples is most of what a probe build used to cost. The runner counts only the probes a harness ran, the probes and support modules they name, their own subdirectories and `dispatch.rs` as its dependencies, not `main.rs`, which only lists the probes: editing one probe reruns only its harnesses, and adding one reruns none.
|
||||
|
||||
Passes are shared between worktrees. A harness's key depends only on the content of its dependencies, not on where they are, so every pass is also written to `parity-shared/` beside the shared vanilla data (`PARITY_SHARED` overrides it). A worktree whose files match those a harness passed with, in any worktree, counts that pass without running the harness: after merging the integration branch, an agent's gate only runs the harnesses its own changes affect.
|
||||
|
||||
Every runner on the machine shares `PARITY_MACHINE_JOBS` slots (default: half the CPU threads), so several agents' runs together can't overload it. Parallel harnesses are also admitted by memory: each harness's recorded peak is reserved, within three quarters of the memory available at the start, and a harness starts only if the memory free at that moment still leaves 2 GB. `-j` caps the count here (default: `PARITY_LOCAL_JOBS`, else 3 while other machines help or a third of the CPU threads alone, within `$FLEET_LOAD_JOBS`).
|
||||
|
||||
@@ -20,7 +20,7 @@ emit for the same scenes.
|
||||
`FluidRenderer.tesselate`, then `RenderShape.MODEL` blocks through
|
||||
`ModelBlockRenderer.tesselateBlock` with smooth lighting on, culling on,
|
||||
cutout leaves, `BlockColors.createDefault()` and `state.getSeed(pos)`.
|
||||
- **Horizon side**: `crates/horizon-client/examples/section_mesh_fixture.rs`
|
||||
- **Horizon side**: `crates/horizon-client/examples/probe/section_mesh_fixture.rs`
|
||||
loads the prepared resources (`Assets`, `BlockFacts`, `Biomes`,
|
||||
`load_visibility`, `MeshTables`), builds the same blocks and light in real
|
||||
client `Chunk`s (a 3x3 chunk region), sets every biome's colours to the
|
||||
|
||||
+2
-2
@@ -1471,7 +1471,7 @@ the `hp` text when they no longer fit; and the header and footer wrapped by
|
||||
the list in single player unless a `list` objective is set.
|
||||
`tools/test_tab_list_parity.py` runs vanilla's own `extractRenderState` frame
|
||||
after frame (`VanillaTabListOracle`: stand-in connection, level and options,
|
||||
real `Scoreboard`) against `examples/tab_list_fixture` and compares every fill,
|
||||
real `Scoreboard`) against `examples/probe/tab_list_fixture.rs` and compares every fill,
|
||||
styled text run, sprite and face blit (as `hud_layout::GuiDraw` calls, painted
|
||||
like the rest of the HUD): **1,000 cases, 3,476 frames and 844,758
|
||||
calls match**. The game draws the same layout while the player-list key is
|
||||
@@ -1492,7 +1492,7 @@ nearest first. `WorldBorder::warning_strength` feeds `hud_overlays::vignette`
|
||||
the border's warning strength at the camera. `tools/test_world_border_render_parity.py` drives vanilla's border,
|
||||
renderer and vignette (`VanillaWorldBorderRenderOracle`, with a stand-in GPU
|
||||
device, dynamic-uniform writer and render pass) against
|
||||
`examples/world_border_render_fixture`: **1,500 cases and 16,859 frames match
|
||||
`examples/probe/world_border_render_fixture.rs`: **1,500 cases and 16,859 frames match
|
||||
bit for bit** (8,513 with the wall drawn). The game draws the wall with
|
||||
`RenderPipelines.WORLD_BORDER`'s overlay blend and the mipmapped forcefield
|
||||
texture, and follows the server's border packets. One border is kept for all
|
||||
|
||||
+39
-16
@@ -24,7 +24,8 @@ Both are off by default. With no pack selected the renderer draws exactly what i
|
||||
| Java shader packs: full-screen pass plan (`horizon_shaderpack::pipeline`: `DRAWBUFFERS`/`RENDERTARGETS`, `colortexN` formats and clearing, buffer flips, `blend.*`) | done: planned for the three test packs |
|
||||
| Java shader packs: full-screen passes drawn (`java_pack.rs`, `gfx/java_stages.rs`: `begin`, `prepare`, `deferred*`, `composite*`, `final` over Horizon's world) | first slice: BSL and Complementary run (below); `depthtex1`/`depthtex2` before translucent geometry, `blend.*`, PNG `texture.<stage>.*` and `texture.noise` |
|
||||
| Java shader packs: custom uniforms (`horizon_shaderpack::uniforms`), `sunPathRotation`, `clouds`/`sun`/`moon`, eye light, `wetness` | done for the full-screen passes (below) |
|
||||
| Java shader packs: `gbuffers_*`, `shadow`, `.dat` and resource-location textures, images, compute | planned |
|
||||
| Java shader packs: `gbuffers_terrain`, `gbuffers_water` (`gfx/java_terrain.rs`: Horizon's terrain fed to the pack's programs) | first slice: MakeUp Ultra Fast, Chocapic13' and BSL draw their own terrain and water (below) |
|
||||
| Java shader packs: other `gbuffers_*`, `shadow`, `.dat` and resource-location textures, images, compute | planned |
|
||||
|
||||
## How the renderer draws a frame today
|
||||
|
||||
@@ -396,6 +397,25 @@ Picking one translates every planned pass of each dimension folder (`java_pack.r
|
||||
4. `final` draws into a target that replaces the world's picture, where Horizon packs' `composite` output goes: the
|
||||
hand, menus and HUD are drawn over it.
|
||||
|
||||
When the pack has a `gbuffers_terrain` (or `textured_lit`, `textured`, `basic`, the program Iris falls back to), the
|
||||
pack draws the terrain itself (`gfx/java_terrain.rs`): Horizon's world pass skips its own solid and translucent
|
||||
terrain, then
|
||||
|
||||
- at step 2, after Horizon's sky, entities and the rest enter `colortex0` and depth, the pack's terrain program draws
|
||||
every visible section into its `RENDERTARGETS` (the side the next pass reads), tested against that depth; the
|
||||
depth is then copied into `depthtex0` and `depthtex1`;
|
||||
- before the first `composite`, as Iris does, `gbuffers_water` (or the terrain program) draws the translucent
|
||||
layer with the pack's `blend.*` or vanilla's blending; the depth goes into `depthtex0` only.
|
||||
|
||||
The pack's vertex program reads Horizon's own terrain vertices (the arena pages, instanced or flat draws): a glue
|
||||
function written before `main` decodes them into Iris's attributes (`vaPosition`/`gl_Vertex` relative to the camera,
|
||||
`gl_Color` with vanilla's face shading undone, `gl_MultiTexCoord0/1`, the normal and `at_tangent` from the quad's
|
||||
four corners, `mc_midTexCoord`, `at_midBlock`), and `mc_Entity.x` is the block's id from the pack's
|
||||
`block.properties`, matched to the sprite's block by name. `gtexture`/`texture` is a 2D atlas built from Horizon's
|
||||
sprite arrays (animated sprites copied in each frame), `lightmap` is Horizon's lightmap with Iris's texture matrix,
|
||||
and fragments under alpha 0.1 are discarded (`alphaTestRef`). `RGBA16` targets are 16-bit unorm where the GPU can
|
||||
render them (Chocapic13' packs its G-buffer into them; half floats broke it).
|
||||
|
||||
What makes Horizon look like OpenGL to the pack:
|
||||
|
||||
- **Layout.** The translator ends every vertex shader by flipping `gl_Position.y` and moving depth from `[-w, w]` to
|
||||
@@ -426,12 +446,15 @@ What makes Horizon look like OpenGL to the pack:
|
||||
|
||||
Measured on the Mac mini (M4 Pro) with the packs' default options: BSL v10.1.8 and Complementary Reimagined r5.9.3
|
||||
grade and light Horizon's world as their post-processing would. Sildur's Vibrant v2.02 draws only its sky: its
|
||||
`deferred` reads the albedo `gbuffers_*` write to `colortex4`. Without `gbuffers_*` and `shadow`, no pack has its
|
||||
shadows, water or sky look yet; Distant Horizons' and Voxy's depth read as far. Horizon's world goes into the target
|
||||
the pack's `gbuffers_terrain` (or the program Iris falls back to) draws to first: `colortex0` for most packs,
|
||||
`colortex1` for MakeUp. Not supported yet: images and compute (`.csh`; a pack that needs them doesn't load),
|
||||
mipmapped targets (`colortexNMipmapEnabled` is read but ignored), `.dat` and resource-location custom textures (PNG
|
||||
files in the pack only); shadow matrices are identity.
|
||||
`deferred` reads the albedo `gbuffers_*` write to `colortex4` (not checked again since the terrain programs run).
|
||||
Without the other `gbuffers_*` and `shadow`, no pack has its shadows or sky look yet; Distant Horizons' and Voxy's
|
||||
depth read as far. Horizon's world goes into the target the pack's `gbuffers_terrain` (or the program Iris falls back
|
||||
to) draws to first: `colortex0` for most packs, `colortex1` for MakeUp. Not supported yet: images and compute (`.csh`;
|
||||
a pack that needs them doesn't load), mipmapped targets (`colortexNMipmapEnabled` is read but ignored), `.dat` and
|
||||
resource-location custom textures (PNG files in the pack only); shadow matrices are identity. With the pack's terrain:
|
||||
entities, the sky, the hand, weather and clouds are still Horizon's (in that first target only), GPU occlusion culling
|
||||
is off, block ids come from sprite names rather than block states, distant (LOD) terrain doesn't repeat its textures,
|
||||
and only the overworld has been checked.
|
||||
|
||||
### Compatibility
|
||||
|
||||
@@ -439,19 +462,19 @@ Tested on 2026-10-22 on the Mac mini (M4 Pro, Metal) with each pack's default op
|
||||
the authors' pages (dev-only test inputs, kept outside the repository). "Loads" means every pass the pack enables for
|
||||
the overworld, Nether and End is preprocessed, translated and validated, as the game does when the pack is picked
|
||||
(`java_pack::tests::real_packs_load` with `HORIZON_TEST_SHADERPACKS`); "drawn" means it was also picked in the game
|
||||
and screenshotted. Only full-screen passes run (above), so no pack has its own terrain, water, shadows or sky yet.
|
||||
The MakeUp, Chocapic13' and Photon rows are from 2026-10-23, on Metal and on Vulkan (RTX 4080).
|
||||
and screenshotted. Full-screen passes, `gbuffers_terrain` and `gbuffers_water` run (above); no pack has its own
|
||||
shadows, entities or sky yet.
|
||||
|
||||
| Pack | Version | Result | First thing that stops it |
|
||||
| --- | --- | --- | --- |
|
||||
| BSL | v10.1.8 | drawn: 26 passes | |
|
||||
| BSL | v10.1.8 | drawn: 26 passes and its terrain and water programs | |
|
||||
| Complementary Reimagined | r5.9.3 | drawn: 27 passes | |
|
||||
| Complementary Unbound | r5.8 | loads: 27 passes | |
|
||||
| Sildur's Vibrant Extreme | 2.02 | drawn: 18 passes, only its sky (above) | |
|
||||
| Steadfast | 0.8.0 | drawn: 3 passes | |
|
||||
| MakeUp Ultra Fast | 9.6 | drawn: 6 passes, its fog, light shafts and grade over Horizon's world | |
|
||||
| Chocapic13' | V9 High | drawn: 16 passes; its default TAA upscaling shrinks the world in its `gbuffers_*` vertex programs, which don't run, so the picture is magnified 1/0.7: turn TAA Upscaling off in its settings | |
|
||||
| Photon | v1.4 | loads: 27 passes; draws black: it lights the scene from the G-buffer its `gbuffers_*` write | |
|
||||
| Chocapic13' | V9 High | drawn: 16 passes and its terrain and water programs | |
|
||||
| MakeUp Ultra Fast | 9.6 | drawn: 6 passes and its terrain and water programs | |
|
||||
| Photon | v1.4 | loads: 27 passes and its terrain and water programs; draws black | its sky and light come from a compute pass and `.dat` look-up tables, not loaded yet |
|
||||
| Bliss | 2.1.2 | fails | `world0/composite1.fsh`: a vector component passed to an `inout` parameter (WGSL can't point at one) |
|
||||
| Bloop | 1.8.0-Alpha-3 | fails | `world0/prepare1.fsh`: `mat2(vec4)` and other constructors naga's GLSL front end refuses |
|
||||
| Noble | v1.9.9 | fails (Apple and NVIDIA) | `world0/deferred4.vsh`: a `vec3[9][9]` varying (nested arrays between stages) |
|
||||
@@ -492,9 +515,9 @@ What the translator does for these packs, as Iris (JCPP and its GLSL transformer
|
||||
3. **Full-screen programs**: `deferred*`, `composite*`, `final` with `colortex0..15` (formats from the pack),
|
||||
`depthtex0..2`, `noisetex` and the uniforms (most are already computed for the world shaders). This alone runs
|
||||
Sildur's and BSL post-processing over Horizon's own world.
|
||||
4. **`gbuffers_terrain`, `gbuffers_water`, `gbuffers_sky*`**: Horizon's terrain vertices extended with Iris's
|
||||
attributes (`mc_Entity` from `block.properties`, `mc_midTexCoord`, `at_tangent`, lightmap), a second set of
|
||||
terrain pipelines writing the pack's render targets.
|
||||
4. **`gbuffers_terrain`, `gbuffers_water`** (done, above), **`gbuffers_sky*`**: Horizon's terrain vertices decoded
|
||||
into Iris's attributes (`mc_Entity` from `block.properties`, `mc_midTexCoord`, `at_tangent`, lightmap), a second
|
||||
set of terrain pipelines writing the pack's render targets.
|
||||
5. **Entities, block entities, hand, weather, clouds, particles** `gbuffers_*`.
|
||||
6. **Shadow pass**: terrain and entities from the sun into `shadowtex0/1` and `shadowcolor0/1`, culled from the
|
||||
light's view, with the pack's distortion.
|
||||
|
||||
@@ -195,7 +195,7 @@ above remains a record of its narrower tested source snapshot.
|
||||
|
||||
`tools/test_chunk_generation_parity.py` generates chunks in actual vanilla classes (`VanillaChunkGenerationOracle`: structure starts and
|
||||
references, biomes, noise, surface, carvers, then biome decoration and structure pieces through real `WorldGenRegion`s) and with
|
||||
`crates/horizon-world/examples/chunk_dump.rs`, and compares every block state, quart biome and block entity (canonical NBT) of each target
|
||||
`crates/horizon-world/examples/probe/chunk_dump.rs`, and compares every block state, quart biome and block entity (canonical NBT) of each target
|
||||
chunk, and the scheduled block and fluid ticks each proto chunk carries into the live world. Cases are terrain sites for several seeds
|
||||
across the overworld, Nether and End, plus rectangles around every structure kind found by scanning the seed. `--phase structures`
|
||||
isolates terrain plus structure pieces, `--phase terrain` stops before features. `HORIZON_ORDER` (a file of `x z` lines) makes both sides
|
||||
|
||||
Reference in New Issue
Block a user