test(cliffs): the WEST residual is NOT the repair sweep's edge order (#84) - #151
Merged
Conversation
…84) #150's one lead, tested and refuted. fixImpossibleCellsSweep clears the first CLEARABLE edge in order L, T, R, B - west first, north second - and an edge is clearable only when it is not on the chunk's outer boundary, so a west-edge cell is denied its first choice. An asymmetry of exactly the observed shape. It is not the cause. The discriminator is RELOCATION, not shrinkage: if the order caused the concentration, permuting it should move the excess to whichever edge is tried first. "Does the error get smaller" would not do - almost any perturbation achieves that by accident. order unexpl border W N E S z(west) L,T,R,B (engine) 25 19 9 5 3 2 2.60 R,B,L,T 75 24 11 7 4 3 2.74 T,L,B,R 46 22 10 5 5 3 2.58 B,R,T,L (west LAST) 76 23 11 7 3 3 2.91 West is the enriched edge in EVERY arm and STRONGEST in the arm that tries west last. Refuted. And the lever is not inert - the trap this shape of test falls into, where a null means the knob was never connected. Permuting drives the unexplained count from 25 to 76, so the sweep's order matters enormously to the placement; it simply does not matter to WHERE the residual sits. The spec asserts that explicitly. Adds a `sweepEdgeOrder` option to cliffPlacement, defaulting to L,T,R,B so shipping behaviour is unchanged - the if/else chain became an order-driven loop and all 1574 pre-existing tests pass on the refactor before the new spec was added. Scoping note: these arms score the SHIPPED model, so the control is #149's 25 unexplained / 19 on border, not #150's 23 / 17, which is the cascade model's row. West is 9 in both, which is the overlap saying they look at the same cells. Five mechanisms are now ruled out for the border residual: the orientation-reach rival (#134), cascade double-counting (#143), the cross-chunk destroy cascade (#149), updateConnections (#150), and the sweep's edge order here. The west concentration stands at z = 2.6-2.9 across every arm, robust to the one placement lever that could plausibly have produced it. Verified: pnpm run verify green - 1578 app (up 4) + 13 worker + 3 container, 0 warnings, exit 0. Measurement only; shipping accuracy unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HKjzpWJw1HbnigPP9udqN2
This was referenced Aug 5, 2026
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.
#150 localised the border residual to the west chunk edge and recorded one lead:
fixImpossibleCellsSweepclears the first clearable edge in the orderL, T, R, B- west first, north second - and an edge is clearable only when it is not on the chunk's outer boundary. So a west-edge cell is denied its first choice and a north-edge cell only its second: an asymmetry of exactly the observed shape.It is not the cause. No capture.
The discriminator is relocation, not shrinkage
If the clear order caused the concentration, permuting it should move the excess to whichever edge is tried first. "Does the error get smaller" would not do - almost any perturbation achieves that by accident.
L, T, R, B(engine)R, B, L, TT, L, B, RB, R, T, L(west last)West is the enriched edge in every arm, and at its strongest in the arm that tries west last. Refuted.
The lever is not inert, and the spec asserts it
That is the trap this shape of test falls into - a null result that really means the knob was never connected. Permuting drives the unexplained count from 25 to 76, so the sweep's order matters enormously to the placement. It simply does not matter to where the residual sits.
The code change
Adds a
sweepEdgeOrderoption tocliffPlacement.ts, defaulting toL, T, R, B. The if/else chain became an order-driven loop; all 1574 pre-existing tests pass on that refactor before the new spec was added, so the default path is behaviour-identical. Marked EXPERIMENTAL at the option, in the same style asrejectAtCrossingStageandeveryCell.Scoping note
These arms score the shipped model, so the control is #149's 25 unexplained / 19 on border - not #150's 23 / 17, which is the cascade model's row. West is 9 in both, which is the overlap saying they are looking at the same cells.
Where #84 stands
Five mechanisms are now ruled out for the chunk-border residual:
updateConnections(test(cliffs): the border residual is a WEST-edge residual (#84) #150 - 0 of 23)The west concentration itself is now robust: z = 2.6-2.9 across every arm, unmoved by the one placement lever that could plausibly have produced it.
The remaining west-flavoured observation in this investigation is #142's six ore-recall cells, all with their nearest resource to the west. Whether the two are one phenomenon is untested, and is the cheapest next question.
Verification
pnpm run verifygreen - 1578 app (up 4) + 13 worker + 3 container tests, 0 warnings, exit 0. Measurement only; shipping accuracy unchanged.🤖 Generated with Claude Code
https://claude.ai/code/session_01HKjzpWJw1HbnigPP9udqN2