Skip to content

Commit c439ca1

Browse files
wormeymanclaude
andauthored
test(cliffs): the grid-4 channel HAS an oracle now, and it moves the defect (#84) (#106)
The blocker was "the grid-4 cliff-elevation channel has no per-corner oracle at all". It needed no mod: the cliff generator is the readout, driven through `cliff_settings`. With `cliff_smoothing = 0` and `cliff_elevation_interval = 1e6`, `crossesCliff` collapses to `min(a,b) < e0 <= max(a,b)`, so one run is a 1-bit comparator on all 4,225 corners of a region at once and the entity's orientation says which side is high. The levels are the REAL bands (70 + 120k) rather than a uniform sweep, because that is the entire placement-relevant content of the channel - `crossesCliff` never compares the field against anything else. **`richness = 4` was never opening the gate.** `cliffiness_basic` is `clamp(0.5*log2(richness) + qmn, 0, 1) + 0.5`, so at richness 4 the clamp is `clamp(1 + qmn, 0, 1)` - still 0, gate still shut, wherever `qmn <= -1`. Routing the `cliffiness` property at the literal 1 places strictly more cliffs at 13 of 15 levels. Worse, richness 4 shifts the clamp by exactly +1, so the corners deciding that gate are the 8,409-of-12,675 the default field clamps flat - the population no fixture validates. Both arms are captured. What it says: - `[0,0]` and `[-1200,800]` are **EXACT at every band, both arms** - same cells, same orientations, nothing spare, with nothing between the field and the placement. - `[1500,1500]` is exact at 310/430/550 and wrong at the HIGH bands (L790 36 wrong / 42 surplus, L910 22/41). Every cheap explanation is eliminated with a control: not the smoothing (off), not the gate (constant by construction, and the disagreement is LARGER there), not `fixImpossibleCells` (0 of 73 disputed cells have a code our repair changed), not the rejections (they cannot alter a neighbour's orientation), not the query window (centre-filtered), not a boundary tie (median 18.8, max 69.0 units from the level). The paradox that replaces it: at **72 of 73** disputed edges the game's OWN TILE channel straddles the level and agrees with our value. `multisample` cannot be the difference - at those corners our grid-4 and grid-1 variants are identical, and the two natural widenings of the min-filter score 791 and 735 wrong against 73. So it lives in the mountains branch of `vulcanus_elev` and the port does not model it at all. Vacuity: perturbing the field by 0.5 fails 6 of the spec's 8 tests. Item of #84; the issue stays open. Claude-Session: https://claude.ai/code/session_011DckiyMmb4zDPBV8NSyxTg Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 394dfbc commit c439ca1

6 files changed

Lines changed: 42331 additions & 5 deletions

File tree

docs/noise/vulcanus-cliffs-NOTES.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,3 +1823,102 @@ cells, and all of `[0,0]`'s. `test/cliffPhantomNeighbour.spec.ts`.
18231823
grid-4 variant to be captured in the wrong channel. Its gate test scores the
18241824
binary the consumer reads over 24,960 edges with hit counts and both outcomes
18251825
asserted - 0 flips.
1826+
1827+
## The grid-4 channel HAS a per-corner oracle now, and it moves the defect (2026-08-03, #84)
1828+
1829+
The blocker named above - "the grid-4 cliff-elevation channel has no per-corner
1830+
oracle at all" - is cleared. It needed no new mod: the cliff generator is itself
1831+
the readout, driven entirely through `cliff_settings`.
1832+
1833+
With `cliff_smoothing = 0` and `cliff_elevation_interval = 1e6`, `crossesCliff`'s
1834+
band arithmetic (`boundary = e0 + interval * floor((max(a,b) - e0) / interval)`)
1835+
collapses to a single threshold, and the rule becomes exactly
1836+
1837+
a cliff sits on an edge <=> min(a, b) < cliff_elevation_0 <= max(a, b)
1838+
1839+
so one run is a **1-bit comparator on all 4,225 corners of a region at once**,
1840+
and the entity's `cliff_orientation` says which side is the high one.
1841+
1842+
**The levels are the real bands (`70 + 120k`), not a uniform sweep**, and that is
1843+
the design rather than a shortcut. `crossesCliff` only ever compares the field
1844+
against those, so the game's bits at the bands are the *entire*
1845+
placement-relevant content of the channel: if they match, the placement is right
1846+
whatever the field's exact values are. `oracle-vulcanus-cliff-bands` holds all
1847+
three regions at every band their field crosses (3 / 10 / 2 levels), 30 cases
1848+
over two gate arms. `test/vulcanusCliffBands.spec.ts`.
1849+
1850+
### `richness = 4` was never opening the gate, and that matters retroactively
1851+
1852+
Every collapsed arm since 2026-08-01 held the cliffiness gate open with
1853+
`richness = 4`, on the reasoning that `0.5*log2(4) = 1` saturates
1854+
`cliffiness_basic` at 1.5. It does not. The expression is
1855+
`clamp(0.5*log2(richness) + qmn, 0, 1) + 0.5`, so at richness 4 the clamp is
1856+
`clamp(1 + qmn, 0, 1)` - **still 0, and the gate still shut, wherever
1857+
`qmn <= -1`.** Routing the `cliffiness` property at the literal `1` places
1858+
strictly more cliffs at 13 of the 15 levels, by up to 135 at one.
1859+
1860+
The second-order problem is worse than the first. Shifting the richness term by
1861+
+1 moves the clamp by exactly one, so the corners that *decide* the gate under
1862+
that arm are the ones the DEFAULT field clamps flat at 0.5 - the
1863+
**8,409-of-12,675** population that the corner-fields fixture cannot speak to
1864+
(the vacuity note above). A richness-4 arm therefore cannot separate "the field
1865+
is wrong" from "`qmn` below the clamp is wrong". Both arms are captured for
1866+
exactly that reason; prefer the constant route when the gate is meant to be gone.
1867+
1868+
### What the oracle says
1869+
1870+
| region | bands | verdict |
1871+
| --- | --- | --- |
1872+
| `[0,0]` | 70, 190, 310 | **EXACT**, both arms - same cells, same orientations, nothing spare |
1873+
| `[-1200,800]` | 70, 190 | **EXACT**, both arms (317/317 and 407/407) |
1874+
| `[1500,1500]` | 70 .. 1150 | exact at 310 / 430 / 550; wrong at the HIGH bands |
1875+
1876+
`[1500,1500]`, constant-1 arm, as wrong/surplus: L70 1/3, L190 2/2, L310 0/0,
1877+
L430 0/0, L550 0/0, L670 8/5, L790 36/42, L910 22/41, L1030 2/2, L1150 2/2.
1878+
1879+
**So two of the three regions reproduce the game's cliffs exactly with nothing
1880+
between the field and the placement.** That is a much stronger statement than
1881+
any cell-count score, and it is the first time the channel has been checked
1882+
rather than argued about.
1883+
1884+
### Every cheap explanation for `[1500,1500]` is eliminated, each with a control
1885+
1886+
- **Not the smoothing** - it is 0 here.
1887+
- **Not the cliffiness gate** - the constant-1 arm removes it by construction,
1888+
and the disagreement is *larger* there than under richness 4, not smaller.
1889+
- **Not `fixImpossibleCells`** - **0 of the 73** disputed cells have a code our
1890+
repair changed, so all 73 are raw crossing-test disagreements. (The repair is
1891+
also doing real work in the right direction: turning it off makes agreement
1892+
worse, 44 wrong against 33 at L790.)
1893+
- **Not the rejections** - a rejection is a post-filter that cannot alter a
1894+
neighbouring cell's orientation, and the disputed cells are ones BOTH sides
1895+
place.
1896+
- **Not the query window** - the game's cells are centre-filtered, so the
1897+
bbox-vs-centre artefact of #101 is out; `missing` is 0-2 per case.
1898+
- **Not a boundary tie** - the disputed edges sit a median 18.8 and a maximum
1899+
**69.0** elevation units from the level.
1900+
1901+
### The paradox that replaces it, and the handoff
1902+
1903+
At **72 of the 73** disputed edges the game's OWN TILE CHANNEL straddles the
1904+
level, and agrees with our cliff-channel value at those corners (worst 18.9,
1905+
almost all 0). So the game's cliff generator is reading a field that differs from
1906+
the game's own `calculate_tile_properties` elevation at those corners, while the
1907+
port has the two equal.
1908+
1909+
**`multisample` cannot be that difference.** At these corners our grid-4 and
1910+
grid-1 variants return the same value - the basalt-lakes term is lerped away at
1911+
high elevation, and the bake-off scores the tile channel *identically* to the
1912+
shipping field at L790 and L910. The two natural widenings of the min-filter
1913+
(over the whole elevation, and over the cliff channel) are catastrophic: 791 and
1914+
735 wrong against 73.
1915+
1916+
So what separates the game's two channels at `[1500,1500]` is something the port
1917+
does not model at all, it lives in the MOUNTAINS branch of `vulcanus_elev` (the
1918+
only branch that reaches 670+), and it is region-local - `[0,0]` and
1919+
`[-1200,800]` never rise past 402 and are exact. That is the next thing to find.
1920+
1921+
The obvious next measurement is a **fine level sweep** (e.g. 700..900 step 5 at
1922+
`[1500,1500]`), which brackets the game's cliff-channel value per corner to the
1923+
step and turns "differs by at least 69" into the actual field. It is ~40 runs of
1924+
the same capture, no new machinery.

test/fixtures/PROVENANCE.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@
192192
"factorioVersion": "2.1.12",
193193
"evidence": "stated in the fixture's own _comment"
194194
},
195+
"oracle-vulcanus-cliff-bands.seed123456.json": {
196+
"factorioVersion": "2.1.12",
197+
"evidence": "captured 2026-08-03 by test/oracle/capture.ts vulcanus-cliff-bands against the installed binary, which pnpm refs:sync --check reported in sync at 2.1.12 at capture time. The three oracle-vulcanus-cliff-entities regions, each at every REAL cliff band (70 + 120k) its field crosses, with the placement rule collapsed (cliff_smoothing=0, cliff_elevation_interval=1e6) so an edge carries a cliff exactly when its two corners straddle cliff_elevation_0 - a 1-bit comparator on all 4,225 corners at once. TWO gate arms per case: richness=4 (via cliffiness_basic, hence a model) and the cliffiness property routed at the literal 1 (open by construction). Each case records the cliff_settings the SURFACE reported back."
198+
},
195199
"oracle-vulcanus-cliff-collapsed.seed123456.json": {
196200
"factorioVersion": "2.1.12",
197201
"evidence": "captured 2026-08-01 by test/oracle/capture.ts vulcanus-cliff-collapsed against the installed binary, which pnpm refs:sync --check reported in sync at 2.1.12 at capture time. The Vulcanus region [0,0] with the placement rule collapsed a term at a time via map_gen_settings.cliff_settings (smoothing 0, a single contour via cliff_elevation_interval = 1e6, the cliffiness gate held open via richness = 4), plus Nauvis control arms in [512,1024) at the default settings and at cliff_elevation_interval = 80. Each case records the cliff_settings the SURFACE reported back, so every override is proven to have applied."

0 commit comments

Comments
 (0)