Skip to content

Tests: guard the cliff facing-end invariant; delete cliffConnections.ts - #559

Merged
wormeyman merged 1 commit into
mainfrom
tests/cliff-facing-invariant
Nov 27, 2026
Merged

wormeyman merged 1 commit into
mainfrom
tests/cliff-facing-invariant

Conversation

@wormeyman

Copy link
Copy Markdown
Collaborator

Adds one Rust test that guards why the cliff update-pass cascade can never change a result, and deletes the TypeScript original of connections.rs, which nothing imports.

The gap this closes

While proving the #558 cuts, switching the end-destruction cascade off in connections.rs (do_destroy_end(&mut live, k, side, opts.no_cascade) -> ..., true)) turned no test red. Checked further:

  • With that break, all 614 workspace tests pass.
  • The update pass destroys an end only when the neighbour is missing or not connected. The cascade can then change something only if two facing ends run in opposite directions. That never happens: 0 of 91,722 facing pairs in the port's raw queue (3 fixture regions plus a 6x6 sweep, 64-tile halo), and 0 in all five captured game cliff sets (2,852 + 9,520 + 17,976 + 19,320 + 620 pairs).
  • The full pass with the cascade on and off over 39 regions, with and without the lava + ore predicate: 0 differing cells.

So the switch is an equivalent mutant. No test can catch it without a hand-built state the game never produces. The cascade itself stays: the forced-destroy path uses it, and the_games_own_destruction_set_reproduces_the_game_exactly goes red when it breaks.

The new test

fixtures::no_facing_cliff_ends_run_the_wrong_way_in_the_queue_or_the_games_cliffs asserts frozen (cells, facing pairs, 0 wrong-way) for the port's queue and for each of the five game fixtures. 1.5 s.

Proven: reversing one queued west-to-east cell in placement.rs turns it red on its own assertion ((50592, 91722, 8) against (50592, 91722, 0); the one cell sits in two overlapping regions). It is not in POISONED_TESTS: under poison it fails on the queue counts first, because the queue moves through basis_noise, so it would not be a clean per-op control.

The deletion

src/noise/cliffs/cliffConnections.ts (461 lines) had no importers since #360 deleted its specs. The connections.rs module comment, docs/noise/cliffs-NOTES.md, docs/noise/vulcanus-cliffs-NOTES.md and docs/rust-wasm-port.md now say where to read it (dc6bccd).

connections.rs is unreachable from fmw-wasm (measured: a two-line insert there leaves engine.wasm byte-identical, while the same insert in placement.rs changes it), so engine.wasm is unchanged.

Gate

pnpm run verify:lint, the full pnpm vp test (116 files, 1,337 passed) and scripts/verify-rust.sh pass locally. cargo deny is not installed on hammond; CI runs it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kd6o1dTdCEZ5JSjytamwMZ

The cascade that updateConnections starts cannot change a result: it
acts only on two facing cliff ends that run the wrong way, and neither
the port's queue nor the game's own cliffs ever have one. Switching that
cascade off left all 614 workspace tests green and changed 0 cells over
39 regions, so nothing graded it.

New test fixtures::no_facing_cliff_ends_run_the_wrong_way_in_the_queue_or_the_games_cliffs
asserts 0 wrong-way facing pairs in the raw queue (50,592 cells, 91,722
pairs) and in the five captured cliff-entity fixtures, with frozen
counts. About 1.5 s. Reversing one queued west-to-east cell turns it red
on its own assertion (8 wrong-way pairs).

src/noise/cliffs/cliffConnections.ts had no importers since #360. It is
deleted; connections.rs and the notes now point at dc6bccd to read it.
connections.rs is unreachable from fmw-wasm, so engine.wasm is
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 19 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f6b5d43f-15d0-4a0e-bcd2-309927d2c31b
Commits

Reviewing files that changed from the base of the PR and between dc6bccd and eb222e6.

Files selected for processing: 6

  • crates/fmw-noise/src/cliffs/connections.rs
  • crates/fmw-noise/src/fixtures.rs
  • docs/noise/cliffs-NOTES.md
  • docs/noise/vulcanus-cliffs-NOTES.md
  • docs/rust-wasm-port.md
  • src/noise/cliffs/cliffConnections.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@claude

claude Bot commented Nov 26, 2026

Copy link
Copy Markdown

Code review

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

🤖 Generated with Claude Code

@wormeyman
wormeyman merged commit e359553 into main Nov 27, 2026
16 checks passed
@wormeyman
wormeyman deleted the tests/cliff-facing-invariant branch November 27, 2026 00:14
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