[PR #6906] [MERGED] Redstone: apply the experimental wire behavior when enabled #7182

Closed
opened 2026-11-03 06:35:21 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6906
Author: @masa-masa-0314
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: feat/redstone-experiments


📝 Commits (2)

  • ba04314 Redstone: implement the experimental wire evaluator and oriented updates
  • c66d168 Merge upstream/main into feat/redstone-experiments

📊 Changes

16 files changed (+643 additions, -51 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+9 -0)
📝 crates/horizon-client/src/game/block_entity_anims.rs (+1 -3)
📝 crates/horizon-client/src/game/books.rs (+1 -2)
📝 crates/horizon-client/src/game/lightning.rs (+10 -0)
📝 crates/horizon-world/src/level/hooks.rs (+23 -7)
📝 crates/horizon-world/src/level/interact.rs (+7 -1)
📝 crates/horizon-world/src/level/mod.rs (+37 -0)
➕ crates/horizon-world/src/level/orientation.rs (+184 -0)
📝 crates/horizon-world/src/level/pistons.rs (+9 -6)
📝 crates/horizon-world/src/level/rails.rs (+3 -2)
📝 crates/horizon-world/src/level/redstone.rs (+59 -9)
➕ crates/horizon-world/src/level/redstone/experimental.rs (+214 -0)
📝 crates/horizon-world/src/level/tick.rs (+3 -5)
📝 crates/horizon-world/src/level/update.rs (+75 -8)
📝 tools/port_map/classes-07.tsv (+1 -1)
📝 tools/port_map/classes-08.tsv (+7 -7)

📄 Description

🤖 Opened by masa-masa-0314's AI agent (ZCode, GPT-6), not by masa-masa-0314 personally.

What and why

Fixes #6895.

Selecting the redstone_experiments pack previously enabled the feature metadata while the server continued to use the default wire evaluator. This change selects the experimental evaluator from the world's enabled features and carries its orientation through neighbor updates.

The implementation covers the 48 orientation contexts and transformations, the turn-off/turn-on queues, first-discovery ordering, staged power writes, and directional neighbor notifications. Direction sources include switches, torches, diodes, observers, lecterns, lightning rods, trapped chests, tripwire hooks and pistons. Feature-disabled worlds retain the default evaluator and its RNG behavior.

The change is kept together because the evaluator depends on orientation propagation and the actual server-world feature flag. Splitting those into independently enabled behaviors would expose an incomplete experiment.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players
  • extra: Horizon-only, off by default
  • tooling
  • docs

Vanilla reference

Independently inspected the shipped 26.3 bytecode and decompiled Orientation, ExperimentalRedstoneUtils, ExperimentalRedstoneWireEvaluator, RedstoneWireEvaluator, RedstoneWireBlock, CollectingNeighborUpdater, ServerLevel, and their direction-producing block callers. In particular, immediate initial-orientation generation and lazy generation in a null-oriented MultiNeighborUpdate remain distinct.

Other projects' code

None.

Behavior verification

Temporary Java/Rust comparisons used the installed 26.3 client jar (checked against its local manifest), its dependencies and prepared resources. The Java side invoked vanilla behavior; Rust used the existing block-update probe with temporary experimental inputs. Temporary validation changes were removed from the final diff in accordance with the contributor's requested workflow; existing tests remain.

  • Default redstone: 4,000/4,000 cases matched.
  • Default block updates: 40,000/40,000 cases matched.
  • Experimental redstone: 4,000/4,000 cases matched.
  • Experimental block updates: 39,959/39,959 valid cases matched. The other 41 inputs raised vanilla exceptions and are not counted as passes.
  • Per-write ordering: 4,000 default and 4,000 experimental cases matched.
  • Orientation: all 48 contexts, four transformations for each of 288 direction inputs, mirrors, and 7,000 random draws with trailing RNG fingerprints matched.

Limitations

  • The REDSTONE_WIRE_ORIENTATIONS debug-subscription broadcast is not implemented; the repository lacks that debug synchronization infrastructure. This PR covers simulation rather than that visualization.
  • The headless integrated-server attempt connected the player but stopped at the command harness's initial terrain-settle step. No script commands ran, so it is not reported as an end-to-end world-toggle pass.
  • The standard local vanilla ledger index is absent (No ledger yet). The changed port-map entries were checked separately; no formal ledger-check pass is claimed.
  • A pre-existing lightning-rod strike path lacks an extra neighbor notification. This PR supplies it for the experiment and preserves the default path; it does not claim to fix every default-mode discrepancy.

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on DESKTOP-3050AHP, against upstream/main at c1f308fe6, 11 min 9 s)

Check Result
Scope ⚠️ 16 files, +643 −51; 694 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 610 run, FAILED (failures=1, skipped=1) (2 min 55 s)
rustfmt ✅ (17 s)
clippy ✅ (2 min 26 s)
tests: horizon-client, horizon-world ✅ 1023 passed (4 min 41 s)
doc tests ✅ 0 passed (6 s)
content root tests ➖ content root untouched
mod API up to date ✅ (40 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The one Python failure, test_native_split_mouse_turns_only_its_owner, also reproduces using the clean upstream c1f308fe6 test and its source inputs: the generated fixture lacks input_trace / Game::note_input. It is not counted as a pass. Post-merge all-target check and explicit world tests (302 passed, 2 ignored) also passed. The earlier behavior comparisons above were run before the upstream merge; the feature patch was unchanged by that merge.

Screenshots

No UI changes. No visible game window was launched; this machine's offscreen rendering is unsuitable for screenshots.

🤖 Generated with ZCode (GPT-6).


🔄 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/6906 **Author:** [@masa-masa-0314](https://github.com/masa-masa-0314) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/redstone-experiments` --- ### 📝 Commits (2) - [`ba04314`](https://github.com/horizon-rust/horizon/commit/ba04314c12c5cbb2962573e52a1a8a8d5ba868e9) Redstone: implement the experimental wire evaluator and oriented updates - [`c66d168`](https://github.com/horizon-rust/horizon/commit/c66d16827c34b1e26c711e300a9ebe525cfa1257) Merge upstream/main into feat/redstone-experiments ### 📊 Changes **16 files changed** (+643 additions, -51 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+9 -0) 📝 `crates/horizon-client/src/game/block_entity_anims.rs` (+1 -3) 📝 `crates/horizon-client/src/game/books.rs` (+1 -2) 📝 `crates/horizon-client/src/game/lightning.rs` (+10 -0) 📝 `crates/horizon-world/src/level/hooks.rs` (+23 -7) 📝 `crates/horizon-world/src/level/interact.rs` (+7 -1) 📝 `crates/horizon-world/src/level/mod.rs` (+37 -0) ➕ `crates/horizon-world/src/level/orientation.rs` (+184 -0) 📝 `crates/horizon-world/src/level/pistons.rs` (+9 -6) 📝 `crates/horizon-world/src/level/rails.rs` (+3 -2) 📝 `crates/horizon-world/src/level/redstone.rs` (+59 -9) ➕ `crates/horizon-world/src/level/redstone/experimental.rs` (+214 -0) 📝 `crates/horizon-world/src/level/tick.rs` (+3 -5) 📝 `crates/horizon-world/src/level/update.rs` (+75 -8) 📝 `tools/port_map/classes-07.tsv` (+1 -1) 📝 `tools/port_map/classes-08.tsv` (+7 -7) </details> ### 📄 Description > 🤖 Opened by masa-masa-0314's AI agent (ZCode, GPT-6), not by masa-masa-0314 personally. ## What and why Fixes #6895. Selecting the `redstone_experiments` pack previously enabled the feature metadata while the server continued to use the default wire evaluator. This change selects the experimental evaluator from the world's enabled features and carries its orientation through neighbor updates. The implementation covers the 48 orientation contexts and transformations, the turn-off/turn-on queues, first-discovery ordering, staged power writes, and directional neighbor notifications. Direction sources include switches, torches, diodes, observers, lecterns, lightning rods, trapped chests, tripwire hooks and pistons. Feature-disabled worlds retain the default evaluator and its RNG behavior. The change is kept together because the evaluator depends on orientation propagation and the actual server-world feature flag. Splitting those into independently enabled behaviors would expose an incomplete experiment. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players - [ ] extra: Horizon-only, off by default - [ ] tooling - [ ] docs ## Vanilla reference Independently inspected the shipped 26.3 bytecode and decompiled `Orientation`, `ExperimentalRedstoneUtils`, `ExperimentalRedstoneWireEvaluator`, `RedstoneWireEvaluator`, `RedstoneWireBlock`, `CollectingNeighborUpdater`, `ServerLevel`, and their direction-producing block callers. In particular, immediate initial-orientation generation and lazy generation in a null-oriented MultiNeighborUpdate remain distinct. ## Other projects' code None. ## Behavior verification Temporary Java/Rust comparisons used the installed 26.3 client jar (checked against its local manifest), its dependencies and prepared resources. The Java side invoked vanilla behavior; Rust used the existing block-update probe with temporary experimental inputs. Temporary validation changes were removed from the final diff in accordance with the contributor's requested workflow; existing tests remain. - Default redstone: 4,000/4,000 cases matched. - Default block updates: 40,000/40,000 cases matched. - Experimental redstone: 4,000/4,000 cases matched. - Experimental block updates: 39,959/39,959 valid cases matched. The other 41 inputs raised vanilla exceptions and are not counted as passes. - Per-write ordering: 4,000 default and 4,000 experimental cases matched. - Orientation: all 48 contexts, four transformations for each of 288 direction inputs, mirrors, and 7,000 random draws with trailing RNG fingerprints matched. ## Limitations - The `REDSTONE_WIRE_ORIENTATIONS` debug-subscription broadcast is not implemented; the repository lacks that debug synchronization infrastructure. This PR covers simulation rather than that visualization. - The headless integrated-server attempt connected the player but stopped at the command harness's initial terrain-settle step. No script commands ran, so it is not reported as an end-to-end world-toggle pass. - The standard local vanilla ledger index is absent (`No ledger yet`). The changed port-map entries were checked separately; no formal ledger-check pass is claimed. - A pre-existing lightning-rod strike path lacks an extra neighbor notification. This PR supplies it for the experiment and preserves the default path; it does not claim to fix every default-mode discrepancy. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on DESKTOP-3050AHP, against upstream/main at c1f308fe6, 11 min 9 s) | Check | Result | | --- | --- | | Scope | ⚠️ 16 files, +643 −51; 694 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 610 run, FAILED (failures=1, skipped=1) (2 min 55 s) | | rustfmt | ✅ (17 s) | | clippy | ✅ (2 min 26 s) | | tests: horizon-client, horizon-world | ✅ 1023 passed (4 min 41 s) | | doc tests | ✅ 0 passed (6 s) | | content root tests | ➖ content root untouched | | mod API up to date | ✅ (40 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The one Python failure, `test_native_split_mouse_turns_only_its_owner`, also reproduces using the clean upstream `c1f308fe6` test and its source inputs: the generated fixture lacks `input_trace` / `Game::note_input`. It is not counted as a pass. Post-merge all-target check and explicit world tests (302 passed, 2 ignored) also passed. The earlier behavior comparisons above were run before the upstream merge; the feature patch was unchanged by that merge. ## Screenshots No UI changes. No visible game window was launched; this machine's offscreen rendering is unsuitable for screenshots. 🤖 Generated with ZCode (GPT-6). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:35:21 +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#7182
No description provided.