Skip to content

Port the fixImpossibleCells retry and on/off checks to Rust (#227) - #356

Merged
wormeyman merged 1 commit into
mainfrom
feat/227-fix-impossible-cells
Aug 30, 2026
Merged

Port the fixImpossibleCells retry and on/off checks to Rust (#227)#356
wormeyman merged 1 commit into
mainfrom
feat/227-fix-impossible-cells

Conversation

@wormeyman

Copy link
Copy Markdown
Collaborator

Port-first entry 5, which merges verdicts 5 and 9 because both halves die with
src/noise/cliffs/cliffPlacement.ts. Seven tests, from
test/fixImpossibleCellsRetry.spec.ts and test/cliffFixImpossibleCells.spec.ts.

The retry branch was ungraded, and this measures that rather than asserting it

fix_impossible_cells_sweep sets its own retry flag: on reaching a cell it
cannot fix it restarts the whole pass, first zeroing the eight outer edges of
the chunk's four corner cells, and a second failure abandons the chunk. It is
fully implemented here and reached by nothing - over the committed captures the
retry fires once in 512 chunks and changes no placed cell, which is exactly why
no fixture grades it.

Planted rather than predicted:

plant result
remove the retry entirely 429 tests pass, only the 2 new retry tests fail
fire the corner step unconditionally the guard test fails, and so does the Nauvis on/off test

The first row is the finding. With the branch deleted the whole crate goes green
except the tests added here, oracle fixtures included. The second row is why the
guard test is not ceremony: the corner step clears eight edges unconditionally,
so firing it on a healthy chunk deletes real cliffs - and the Nauvis comparison
catches that too, which was not designed in.

The other half pins a NEGATIVE result

The sweep does not change Nauvis by a single cell, at either oracle seed. That
retires the claim carried in cliffs-NOTES.md from 2026-07-20 that Nauvis's ~6%
cliff residual "is fixImpossibleCells". It is not. Nauvis's cliffiness_nauvis
is a hard 0-or-10 gate, so the configurations it produces are already legal. If
this ever fails, that conclusion needs revisiting - it does not mean the port
drifted.

Two guards around it, because a negative result is the easiest kind to rot:

  • The placed-cell counts are frozen, 282 at seed 123456 and 52 at 777771. Two
    EMPTY lists also compare equal, so without the counts a placement that stopped
    placing anything would satisfy the test perfectly. The spec this replaces did
    not have them.
  • The companion test requires the sweep to FIRE on Vulcanus, whose continuous
    cliffiness_basic produces configurations the orientation table rejects.
    Without it, "no change on Nauvis" is equally consistent with a sweep that does
    nothing anywhere.

The comparison is over (x, y, code) rather than the cell set alone, which is
stronger than the spec's own key comparison and holds.

Claude-Session: https://claude.ai/code/session_01UVcbv1pAhPUoCC6aBwZUtg

Co-authored-by: Claude Opus 5 (1M context) noreply@anthropic.com

@wormeyman
wormeyman force-pushed the feat/227-fix-impossible-cells branch from f38b167 to afb597c Compare August 30, 2026 05:42
@claude

claude Bot commented Aug 30, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Port-first entry 5, which merges verdicts 5 and 9 because both halves die with
`src/noise/cliffs/cliffPlacement.ts`. Seven tests, from
`test/fixImpossibleCellsRetry.spec.ts` and `test/cliffFixImpossibleCells.spec.ts`.

## The retry branch was ungraded, and this measures that rather than asserting it

`fix_impossible_cells_sweep` sets its own retry flag: on reaching a cell it
cannot fix it restarts the whole pass, first zeroing the eight outer edges of
the chunk's four corner cells, and a second failure abandons the chunk. It is
fully implemented here and reached by nothing - over the committed captures the
retry fires once in 512 chunks and changes no placed cell, which is exactly why
no fixture grades it.

Planted rather than predicted:

| plant | result |
| --- | --- |
| remove the retry entirely | **429 tests pass, only the 2 new retry tests fail** |
| fire the corner step unconditionally | the guard test fails, and so does the Nauvis on/off test |

The first row is the finding. With the branch deleted the whole crate goes green
except the tests added here, oracle fixtures included. The second row is why the
guard test is not ceremony: the corner step clears eight edges unconditionally,
so firing it on a healthy chunk deletes real cliffs - and the Nauvis comparison
catches that too, which was not designed in.

## The other half pins a NEGATIVE result

The sweep does not change Nauvis by a single cell, at either oracle seed. That
retires the claim carried in `cliffs-NOTES.md` from 2026-07-20 that Nauvis's ~6%
cliff residual "is `fixImpossibleCells`". It is not. Nauvis's `cliffiness_nauvis`
is a hard 0-or-10 gate, so the configurations it produces are already legal. If
this ever fails, that conclusion needs revisiting - it does not mean the port
drifted.

Two guards around it, because a negative result is the easiest kind to rot:

- The placed-cell counts are frozen, 282 at seed 123456 and 52 at 777771. Two
  EMPTY lists also compare equal, so without the counts a placement that stopped
  placing anything would satisfy the test perfectly. The spec this replaces did
  not have them.
- The companion test requires the sweep to FIRE on Vulcanus, whose continuous
  `cliffiness_basic` produces configurations the orientation table rejects.
  Without it, "no change on Nauvis" is equally consistent with a sweep that does
  nothing anywhere.

The comparison is over `(x, y, code)` rather than the cell set alone, which is
stronger than the spec's own key comparison and holds.

Claude-Session: https://claude.ai/code/session_01UVcbv1pAhPUoCC6aBwZUtg

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@wormeyman
wormeyman force-pushed the feat/227-fix-impossible-cells branch from afb597c to 5769902 Compare August 30, 2026 06:06
@wormeyman
wormeyman merged commit f80f585 into main Aug 30, 2026
9 checks passed
@wormeyman
wormeyman deleted the feat/227-fix-impossible-cells branch August 30, 2026 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant