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.
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.