[PR #2175] [MERGED] Keep block-breaking cracks aligned between stages #4073

Closed
opened 2026-11-03 04:14:29 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2175
Author: @rdbtCVS
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: t3/fix-breaking-crack-jitter


📝 Commits (1)

  • 6e0a490 Keep block-breaking cracks aligned between stages

📊 Changes

3 files changed (+205 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/entity.wgsl (+12 -1)
📝 crates/horizon-client/src/gfx.rs (+2 -0)
➕ crates/horizon-client/src/gfx/crumbling_tests.rs (+191 -0)

📄 Description

🤖 Opened by rdbt's AI agent (Codex, GPT-6.1 Sol), not by rdbt himself.

What and why

Fixes #1882.

Crack stages carry their atlas origin in normalized 16-bit light bytes. Decoding that origin introduces a stage-dependent fractional texel error: with the entity atlas's nearest filtering, the same projected block coordinate can select a neighbouring texel when the stage changes.

Restore the integer sprite origin, select the local texel independently, and sample its center. This applies to opaque/translucent block cracks and block-entity cracks through their shared shader path. Model geometry, projected decal UVs, and destroy-stage progression stay unchanged.

Add an explicit GPU regression test that samples the production WGSL using a synthetic coordinate atlas and the production sampler settings. It covers 2,340 samples across six atlas origins, 16px/32px sprites, exact texel boundaries, nearby coordinates, negative UVs, wrapping, and sprite edges. On NVIDIA RTX 4060/Vulkan, all 2,340 corrected samples match; the original addressing control mis-samples 780 cases. Command (exit 0): cargo test -p horizon-client --lib crack_samples_stay_aligned_between_stages -- --ignored --nocapture.

Vanilla reference

Checked the pinned 26.3 bytecode through tools/rea_vanilla.py: SheetedDecalTextureGenerator.setNormal projects model coordinates and TextureAtlasSprite.getU maps local UVs into the selected sprite. The existing breaking_model parity harness covers geometry and projection; this repair addresses Horizon's packed atlas origins and nearest sampling, covered by the new GPU test.

Self-check

pr_ready (tools/pr_ready.py --quick on archlinux, against origin/main at 9c26db87e, 2 min 29 s)

Check Result
Scope ✅ 3 files, +205 −1
Cargo.lock ✅ unchanged
Public tree ✅ (2 s)
Python tests ➖ no Python change
rustfmt ✅ (6 s)
clippy ✅ (14 s)
tests: horizon-client ✅ 1307 passed (1 min 50 s)
doc tests ✅ 0 passed (2 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 79 affected, to run in CI (--quick): arrow, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, breaking_model, cauldron, chat_screen, command_exec, command_parse and 67 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Screenshots

No game screenshots captured; the reporter's Discord video attachment returned HTTP 403. Validation uses actual GPU texture samples with a synthetic atlas; no Mojang assets or player data are required. The existing geometry parity checks remain for CI.

Maintainer edits enabled. No release labels added (bug fix).

🤖 Generated with Codex (GPT-6.1 Sol).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2175 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `t3/fix-breaking-crack-jitter` --- ### 📝 Commits (1) - [`6e0a490`](https://github.com/horizon-rust/horizon/commit/6e0a49029fb4b28465bf8256bed71e44448643e3) Keep block-breaking cracks aligned between stages ### 📊 Changes **3 files changed** (+205 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity.wgsl` (+12 -1) 📝 `crates/horizon-client/src/gfx.rs` (+2 -0) ➕ `crates/horizon-client/src/gfx/crumbling_tests.rs` (+191 -0) </details> ### 📄 Description > 🤖 Opened by rdbt's AI agent (Codex, GPT-6.1 Sol), not by rdbt himself. ## What and why Fixes #1882. Crack stages carry their atlas origin in normalized 16-bit light bytes. Decoding that origin introduces a stage-dependent fractional texel error: with the entity atlas's nearest filtering, the same projected block coordinate can select a neighbouring texel when the stage changes. Restore the integer sprite origin, select the local texel independently, and sample its center. This applies to opaque/translucent block cracks and block-entity cracks through their shared shader path. Model geometry, projected decal UVs, and destroy-stage progression stay unchanged. Add an explicit GPU regression test that samples the production WGSL using a synthetic coordinate atlas and the production sampler settings. It covers 2,340 samples across six atlas origins, 16px/32px sprites, exact texel boundaries, nearby coordinates, negative UVs, wrapping, and sprite edges. On NVIDIA RTX 4060/Vulkan, all 2,340 corrected samples match; the original addressing control mis-samples 780 cases. Command (exit 0): `cargo test -p horizon-client --lib crack_samples_stay_aligned_between_stages -- --ignored --nocapture`. ## Vanilla reference Checked the pinned 26.3 bytecode through `tools/rea_vanilla.py`: `SheetedDecalTextureGenerator.setNormal` projects model coordinates and `TextureAtlasSprite.getU` maps local UVs into the selected sprite. The existing `breaking_model` parity harness covers geometry and projection; this repair addresses Horizon's packed atlas origins and nearest sampling, covered by the new GPU test. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on archlinux, against origin/main at 9c26db87e, 2 min 29 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +205 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (2 s) | | Python tests | ➖ no Python change | | rustfmt | ✅ (6 s) | | clippy | ✅ (14 s) | | tests: horizon-client | ✅ 1307 passed (1 min 50 s) | | doc tests | ✅ 0 passed (2 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 79 affected, to run in CI (--quick): arrow, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, breaking_model, cauldron, chat_screen, command_exec, command_parse and 67 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | ## Screenshots No game screenshots captured; the reporter's Discord video attachment returned HTTP 403. Validation uses actual GPU texture samples with a synthetic atlas; no Mojang assets or player data are required. The existing geometry parity checks remain for CI. Maintainer edits enabled. No release labels added (bug fix). 🤖 Generated with [Codex](https://openai.com/codex/) (GPT-6.1 Sol). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:14:29 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4073
No description provided.