You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(cliffs): sample the fields at the game's lattice - Nauvis is now EXACT (#18) (#70)
The port read `cliff_elevation` and `cliffiness` at `(i*4, j*4 + 0.5)`,
adding the cliff prototype's `grid_offset {0, 0.5}` to the SAMPLE
position. That offset is a CENTRE offset. The game samples the bare
`(i*4, j*4)`.
Two independent sources:
- `CliffGenerator::crossingsForChunk` (arm64 `0x10160c9cc`) reads
`grid_size` at `[proto+0xb60]`/`[0xb68]` and NEVER `grid_offset` at
`[0xb70]`/`[0xb78]`; its sample origin is `chunkPos << 5` converted to
float, step `grid_size`. It computes no other coordinate.
- `base/prototypes/entity/entity-util.lua:305` says it outright:
"cliffs are auto-placed with centers at (0, 0.5) offset from the grid".
Nauvis goes 0.943 -> **1.0000 recall, 1.0000 precision, ratio 1.000** at
both seeds - exact agreement with `find_entities_filtered`. Vulcanus
recall 0.792/0.870/0.803 -> 0.806/0.938/0.853; its over-placement is
unchanged and stays open on #18.
Why it hid for two months: the error moves NO placed cliff, because cell
centres are derived from their own constants. So `x mod 4 == 2`,
`y mod 4 == 2.5`, the preview agreement, and PR #57's substitution of the
game's own field values (zero cells moved) all passed - that fixture had
itself been captured at the port's assumed site. A substitution test can
falsify a value; it cannot falsify the site it was sampled at.
Fixture handling: the Vulcanus corner-fields oracle is re-captured at the
game's lattice; the previous capture is kept as `-legacy-y0.5`, since it
is valid ground truth for the site it names and is what lets a spec show
the blind spot. Both carry provenance.
Test changes are re-measurements, not accommodations:
- `cliffPlacement.spec.ts` now pins Nauvis at EQUALITY, not >= 0.85.
- `cliffResidual.spec.ts`'s "wrong cells sit on band boundaries" block
asserted the residual exists; there are no wrong cells left, so it now
asserts the set is empty.
- `cliffSmoothing.spec.ts`'s plane gains a `.37` offset: at `j*4` the old
constant put corner elevations exactly ON band edges (measured: all 7
disagreeing cells at distance 0, bilerp giving 7.1e-15), so it tested
float rounding rather than smoothing.
- `vulcanusCliffs.spec.ts`'s independent blend now indexes corners
instead of deriving positions from centres.
- `vulcanusOreCliffSeparation.spec.ts`: full-ore false positives 47 -> 46.
The game still places zero; that finding is untouched.
Claude-Session: https://claude.ai/code/session_01BkKb3S2cGyRFFHSzuCQBgj
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
"evidence": "captured 2026-07-29 by test/oracle/capture.ts vulcanus-cliff-corner-fields against the installed binary, which pnpm refs:sync --check reported in sync at 2.1.12 at capture time. Superseded 2026-07-30: the sample lattice (j*4+0.5) was the PORT's assumption, not the game's. Retained deliberately - it is valid ground truth for the site it names, and keeping it is what lets a spec show that substituting fields captured at OUR site cannot falsify that site."
"evidence": "captured 2026-07-29 by test/oracle/capture.ts vulcanus-cliff-corner-fields against the installed binary, which pnpm refs:sync --check reported in sync at 2.1.12 at capture time"
193
+
"evidence": "re-captured 2026-07-30 by test/oracle/capture.ts vulcanus-cliff-corner-fields against the installed binary, which pnpm refs:sync --check reported in sync at 2.1.12 at capture time. Supersedes the 2026-07-29 capture (kept as the -legacy-y0.5 fixture): that one sampled at j*4+0.5, the port's assumed lattice, not the game's."
0 commit comments