Skip to content

Vulcanus cliffs: the 2.4% remaining after the multisample grid fix #84

Description

@wormeyman

Follow-up to #18, which is resolved: multisample's offsets are in the calling noise program's grid units, so vulcanus_basalt_lakes_multisample's min-filter spans 4 tiles for cliffs and 1 for per-tile consumers (PR #83, test/multisampleGrid.spec.ts).

That took the Vulcanus cliff port from recall 0.806/0.938/0.853 with 12.5% wrong orientations to recall 1.000/0.973/0.965 with 2.4%. This issue tracks what is left.

1. The residual itself

37 of 1531 matched cells still carry a wrong orientation, and precision is 0.872 (1756 placed vs 1569 real) without the lava-collision rejection, which the shipping renderer applies and this measurement does not. Per region:

region game ours matched wrong recall
[0,0] 283 292 283 7 = 2.5% 1.000
[1500,1500] 885 1070 861 26 = 3.0% 0.973
[-1200,800] 401 394 387 4 = 1.0% 0.965

Almost all the surviving over-placement is [1500,1500] (~209 cells; [0,0] is down to 9). First step is to re-measure with the lava rejection applied, which is how the renderer actually runs - it may account for much of the 187-cell excess.

2. A small regime split survives, with the same shape as the bug just fixed

test/vulcanusElevationLevels.spec.ts sweeps cliff_elevation_0 and inverts the generator's own elevation. Before the fix the over-placement ratio was 1.20-1.49 below elevation 120 and 1.00-1.04 above - a clean edge at exactly where 120 * vulcanus_basalt_lakes_multisample saturates. After the fix it is 1.000-1.085 everywhere, but the split has not gone to zero:

  • worst ratio below 120: 1.085
  • worst ratio above 120: 1.018
  • gap 0.067, down from 0.16 but still positive, and the spec asserts it is > 0

Excess placement is still concentrated in the basalt-lakes elevation range. That is suggestive of a small remaining error in the same term - a second-order detail of the multisample sub-program (its own grid? its phase? the order of min against the clamp?) rather than a new mechanism.

3. Perf: the two elevation channels can no longer share a memo

VulcanusElevation now exposes cliffElevation beside elevation. They share every sub-expression below the multisample, so the extra cost is one memo table rather than a second DAG (a private DAG was tried first and is much dearer). Measured ~5% on the view:'all' Vulcanus composite, but that was taken on a loaded machine and deserves a proper pnpm perf run.

Worth checking whether the cliff pass can be given a cheaper working set, since it only ever samples the 4-tile corner lattice.

4. Audit other consumers for the same channel mistake

This is the generalisable part. Any consumer that reads a multisample-bearing field on a grid other than 1 tile needs its own variant, and nothing currently checks that. vulcanus_elevation feeds tiles, rocks, resources and cliffs; cliffs are the only one known to walk a coarser grid, but that was an assumption until it was measured for cliffs, and the same assumption is currently unexamined for the rest.

Related: docs/noise/vulcanus-multisample-NOTES.md is amended with the corrected rule and the reason its original 150/150 measurement supported a false generalisation - every comparison came through one channel.

5. Also still open, unchanged by this

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnoise-reReverse-engineering Factorio's noise math against the game

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions