Skip to content

Port the enemy footprint decision-boundary probe to Rust (#227) - #353

Merged
wormeyman merged 1 commit into
mainfrom
feat/227-enemy-footprint-probe
Aug 30, 2026
Merged

Port the enemy footprint decision-boundary probe to Rust (#227)#353
wormeyman merged 1 commit into
mainfrom
feat/227-enemy-footprint-probe

Conversation

@wormeyman

Copy link
Copy Markdown
Collaborator

Port-first entry 2. test/enemyBaseField.spec.ts carries two claims, not one,
and only the first has a Rust counterpart. worstAbs/worstRel grade the
field's values, and fixtures.rs already reproduces those at both seeds in
three magnitude buckets. The second claim is footprintDisagreements: port and
game never fall on opposite sides of a cut at 0.05 through
min(v, ENEMY_PLACEMENT_CAP). Nothing in Rust graded that.

The gap is real rather than theoretical, because the two checks cannot see each
other. An aggregate tolerance passes a residual that still moves a position
across the cut, and a cut is what the overlay does with this field. The nearest
Rust check, the_enemy_fixture_is_mostly_basement_..., compares positive
counts, so two positions could swap sides and the count would not move.

Planted rather than predicted:

plant result
bias the port by 0.011 a value sits 8.04e-4 from the cut
bias the port by 0.03 port and game fall on opposite sides - 3 at seed 123456

The second is the one that matters: 0.03 is 33x below the deleted spec's own
ABS_TOL of 1.0, so the aggregate arms would have passed it.

Two guards beside the probe, because a zero on its own can be luck. The count
of positions inside the cut is frozen per seed - 39 of 1032 at seed 123456, 37
at seed 777771 - so a port returning a constant cannot satisfy it. And the
nearest value to the cut is required to stay above 1e-3, so the f32 read cannot
be what decides a side.

This unblocks deleting test/enemyBaseField.spec.ts, which imports
src/noise/enemies/enemyBaseField.ts and therefore cannot outlive the #227
deletion. The spec stays until then; the coverage is now in both places.

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

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

Port-first entry 2. `test/enemyBaseField.spec.ts` carries two claims, not one,
and only the first has a Rust counterpart. `worstAbs`/`worstRel` grade the
field's values, and `fixtures.rs` already reproduces those at both seeds in
three magnitude buckets. The second claim is `footprintDisagreements`: port and
game never fall on opposite sides of a cut at 0.05 through
`min(v, ENEMY_PLACEMENT_CAP)`. Nothing in Rust graded that.

The gap is real rather than theoretical, because the two checks cannot see each
other. An aggregate tolerance passes a residual that still moves a position
across the cut, and a cut is what the overlay does with this field. The nearest
Rust check, `the_enemy_fixture_is_mostly_basement_...`, compares positive
counts, so two positions could swap sides and the count would not move.

Planted rather than predicted:

| plant | result |
| --- | --- |
| bias the port by 0.011 | `a value sits 8.04e-4 from the cut` |
| bias the port by 0.03 | `port and game fall on opposite sides` - 3 at seed 123456 |

The second is the one that matters: 0.03 is 33x below the deleted spec's own
`ABS_TOL` of 1.0, so the aggregate arms would have passed it.

Two guards beside the probe, because a zero on its own can be luck. The count
of positions inside the cut is frozen per seed - 39 of 1032 at seed 123456, 37
at seed 777771 - so a port returning a constant cannot satisfy it. And the
nearest value to the cut is required to stay above 1e-3, so the f32 read cannot
be what decides a side.

This unblocks deleting `test/enemyBaseField.spec.ts`, which imports
`src/noise/enemies/enemyBaseField.ts` and therefore cannot outlive the #227
deletion. The spec stays until then; the coverage is now in both places.

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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@wormeyman
wormeyman merged commit e98904d into main Aug 30, 2026
9 checks passed
@wormeyman
wormeyman deleted the feat/227-enemy-footprint-probe branch August 30, 2026 05:18
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