Port the #84 stage localisation to Rust (#227) - #359
Merged
Conversation
#227 deletes `test/cliffOreActsAtDestroyStage.spec.ts`. Its baseline is already graded in Rust, but the localisation behind it is not, and nothing in Rust computes a counterfactual of that shape. A frozen aggregate cannot stand in for it: removing one cell from a 1,500-cell queue moves a total by one either way, which says nothing about WHICH neighbour lost an end - and the neighbour is the whole result. This is verdict 12's C1, recorded there as conditional on #84 staying open. It is open, so the port lands before the deletion rather than after it. Test-only and additive. No shipped source line changes. The result, reproduced exactly from the TypeScript arm: - 31 cells the ore arm suppresses - of those, exactly 1 has a neighbour that can tell destruction from non-generation - the rest have neighbours the game also lacks, neighbours on a chunk border, or no facing end - treating `1546,1550.5` as never queued contradicts the game at exactly `1546,1546.5` - treating any of the other 30 that way costs nothing The claim is two-sided, which is what makes it a stage localisation rather than a bare count. Destroyed - the cell in the queue and in the destruction set - is 0 wrong. Never queued - out of both - is 1 wrong, at the neighbour. #122's rule is what separates them: destruction runs `onDestroy` on the connected neighbour unconditionally, while a cell that was never queued only costs a neighbour its end when that neighbour is on a chunk border. Planted rather than predicted: | plant | result | | --- | --- | | shipped `apply_cliff_connections`: pass `no_cascade` at both `force_destroy` sites, so destruction stops taking the neighbour's end | RED - the baseline goes from 0 wrong to 8, so this grades `cliffs::connections` and not only itself | | the instrument: drop #122's chunk-border filter from the decidable derivation | RED - 5 decidable instead of 1, so the filter is load-bearing rather than decorative | The one fixture addition is `oracle-vulcanus-cliff-ore-direction.seed123456.json`. The entities fixture was already loaded by this file.
wormeyman
added a commit
that referenced
this pull request
Sep 5, 2026
Five game captures had exactly one reader each, and every one of those readers is a TypeScript spec #371's deletion retires: basisInputScale, basisOutputScale, basisCallerScales, basisNoiseSeeding and vulcanusPlasmaDecomposition. Deleting them as they stood would have left the captures graded by nothing, so the grades move to `crates/fmw-noise/src/fixtures.rs` first - the same order #359 used for the stage localisation ahead of #227's deletion. Six tests, all reading fixtures through `load_captured_at` so a re-capture that moves the version fails loudly: | fixture | graded | frozen | | --- | --- | --- | | `oracle-basis-input-scale` | the #290 model at 7 input scales | 196/196 x7; un-narrowed control `[196, 196, 3, 4, 3, 20, 79]` | | `oracle-basis-output-scale` | at 5 output scales | 196/196 x5; product-only control `[196, 110, 151, 196, 196]` | | `oracle-basis-caller-scales` | at Vulcanus's five real caller triples | 196/196 x5; output-only control `[3, 4, 27, 74, 77]` | | `basis-noise-seeding.game` | 9 seed pairs x 48 points | **432/432 exact, worst 0** | | `oracle-vulcanus-plasma-decomposition` | both leaves and `hairline_cracks` | 61/61 each; game-vs-game `abs(A - B)` at 7/61 | | the two hairline captures | values at the 52 shared positions | 52/52 identical; 21 off-grid; control 0 | Every count matches the row the TypeScript spec froze. The seeding count is new: the spec held it to a 1e-5 bound from before the gradient table was recovered from the game (#234), and it is exact now, so it is asserted exact. The models are written as formulas over `basis_noise` rather than calls into `basis_noise_expr`, so they grade the arithmetic the port is supposed to do rather than whatever the port does; each carries the wrong model it displaced as its control, with that model's frozen count, so a fixture that stopped discriminating would show as a control reaching a full house. Planted, not predicted: dropping the coordinate-product narrowing from `fully_narrowed` reddens three of the six - input scale, caller scales and the plasma leaves. Output scale stays green because its input scale of 0.125 makes the product exact, which is that fixture's own design as the output-side control; seeding and the shared-point test never read the model. `fixtures.rs` is `#[cfg(test)]`, so `engine.wasm` is untouched and the gate's byte comparison confirms it. Part of #371, under #215. Claude-Session: https://claude.ai/code/session_01CoCpSnNvTE8Wekk7dLpy36 Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the #84 stage localisation to Rust so #227 can delete
test/cliffOreActsAtDestroyStage.spec.tswithout losing it.Test-only and additive: no shipped source line changes. The diff is 324
insertions and 2 deletions, and both deletions are import lines in the test file
being widened.
Why this is a prerequisite rather than follow-up work
Verdict 12 on #227 split that spec in two. Its baseline - our raw queue plus the
game's own destruction set reproducing the region exactly - is already graded in
Rust by
the_apply_stage_beats_the_crossing_stage_on_three_counts_and_loses_on_none.The localisation behind it is not graded anywhere, and a frozen aggregate cannot
stand in for it: removing one cell from a 1,500-cell queue moves a total by one
either way, which says nothing about which neighbour lost an end, and the
neighbour is the whole result.
Verdict 12 recorded the port as conditional on #84 staying open. It is open, so
this lands before the deletion rather than after it.
What it measures
Reproduced exactly from the TypeScript arm:
non-generation - the rest have neighbours the game also lacks, neighbours on a
chunk border, or no facing end
1546,1550.5as never queued contradicts the game at exactly1546,1546.5The claim is two-sided, which is what makes it a stage localisation rather than
a bare count. Destroyed - the cell in the queue and in the destruction set - is
0 wrong. Never queued - out of both - is 1 wrong, at the neighbour. #122's rule
separates them: destruction runs
onDestroyon the connected neighbourunconditionally, while a cell that was never queued only costs a neighbour its
end when that neighbour sits on a chunk border.
This is an n=1 result and the test says so in its own docs. The third assertion
is what stops the second from reading as a general property.
Planted, not predicted
apply_cliff_connections: passno_cascadeat bothforce_destroysites, so destruction stops taking the neighbour's endcliffs::connectionsand not only itself.Fixtures
One addition,
oracle-vulcanus-cliff-ore-direction.seed123456.json, read throughload_captured_atat 2.1.12 like every other fixture here. The entities fixturewas already loaded by this file.
Gate
pnpm run verifygreen in 15m0s on Menehune, exit code read out of the lograther than off the pipe.
bash scripts/verify-rust.shgreen.