Skip to content

Vulcanus: terrain matches a real surface through tile correction (#454) - #565

Merged
wormeyman merged 1 commit into
mainfrom
vulcanus/real-surface-tiles
Nov 27, 2026
Merged

wormeyman merged 1 commit into
mainfrom
vulcanus/real-surface-tiles

Conversation

@wormeyman

Copy link
Copy Markdown
Collaborator

Vulcanus's terrain now matches a real Vulcanus surface, where before it matched only the game's map preview. It takes tile correction through the shared lazy correct_window, plus one allowed_neighbors rule: lava and lava-hot may touch only each other. This is the last of the four planets. Gleba, Aquilo, Nauvis and Fulgora are already on main.

Against a real surface (spawn window, tiles -128..127)

step wrong by name wrong by colour
raw argmax (what the preview draws) 2,053 1,814
layer checks only 217 217
with the lava rule (what ships) 1 1
with the game's own chunk request order (test only) 0 0

The fixtures are oracle-vulcanus-real-surface.seed123456.json (a radius request) and -each (chunks made strictly one at a time). Both were captured on 2.1.23 at seed 123456 with the terrain-only mod; both re-capture byte-identical and have PROVENANCE entries.

The one tile, at (-127, 95), is the request edge, not a correction error. The renderer corrects in columns order, as Gleba, Aquilo, Nauvis and Fulgora do. The game's own queue order (requested_correction_order, decoded for Fulgora in #564) reproduces the radius capture and the -each capture at every tile. It also reproduces an uncommitted radius-18 capture of the whole 1024 window at all 1,048,576 tiles, where the columns-order renderer is off at 3 tiles, all at x -512 to -509. In that larger capture, (-127, 95) is lava-hot, the same as our render.

  • Layers: lava 86 and lava-hot 69, far below the ground tiles (184 to 202).
  • The rule: lava and lava-hot allow only each other, checked against the game's own table read back at runtime. Searching every tile prototype finds no replacement path between lava and ground, so lava and ground never swap.
  • No ties anywhere in the 1024 preview window (closest gap 2.4e-7). The three ash tiles that share a colour are graded by name in Rust.

Planted breaks

  • No lava rule in the render: tier 3 goes 1 -> 217.
  • Margin 0: 1 -> 72, and the 128 px tiled render stops stitching.
  • Poison: 1 -> 64,368. Both real-surface tests are in POISONED_TESTS, about 49 s for the pair, under the slowest poisoned test (68 s).
  • The -each capture corrected in columns order instead of its own order: non-zero.

What moved

  • Preview PNG (now a reference): 0 -> 39,950. Inside the fixture window the render differs from the PNG at 1,815 pixels: the 1,814 where the real surface does, plus the one edge tile (asserted).
  • Default-levers control: 10,636 -> 50,383.
  • Tier 3: 11 rows moved, all in 1-tile-per-pixel windows. Every moved pixel is terrain. No rock, cliff, resource or composite count changed.
  • Tier 2: no fold moved.
  • Tiling: 128 px and 100 px tiles stitch back byte for byte, and lazy equals eager on the same raw tiles.

Cost and what users see

The app renders at 1 tile per pixel, so every user gets the corrected terrain.

render (Node, one thread, median of 3) raw eager this PR
app default: 1024 all, 64 tiles of 128 25.7 s 84.3 s 51.9 s (2.0x)
1024 terrain, same tiles 18.8 s 76.8 s 45.0 s
one 256 px terrain 1.16 s 2.65 s 1.88 s

The worker pool divides the app figures by its worker count. What remains is near the floor for 128 px tiles: each corrects 6x6 chunks to draw 4x4. Whether larger worker tiles help is a separate, measured follow-up.

Not covered yet: rocks are placed after correction on a real surface, and their hot and cold tile lists could see corrected tiles. The overlays still read the raw argmax.

Gate

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

Refs #454.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kd6o1dTdCEZ5JSjytamwMZ

At one tile per pixel on a whole-tile origin, the Vulcanus render runs tile
correction through correct_window (lazy raw reads, no-op walks skipped) over
the window's chunks plus one, in columns order, with a Neighbours table for
lava and lava-hot, which allow only each other. Every view draws this terrain;
any other zoom draws the raw argmax.

- Two real-surface fixtures (seed 123456, derived surface seed 1249936247,
  ore controls at size 0, terrain-only, 0 entities): one radius request, and
  chunks made strictly one at a time row by row (-each). The probe takes
  FMW_PLANET=vulcanus.
- tiles/vulcanus_correction.rs: by name against the radius capture, raw
  2,053, layers only 217, with the may-touch rule 1, at (-127, 95). That tile
  is the edge of the request: corrected in requested_correction_order, both
  captures match at all 65,536 tiles, and a scratch radius-18 capture of the
  whole 1024 window at all 1,048,576 (columns order: 3, at its left edge).
- No exact argmax ties anywhere in the 1024 window.
- The preview PNG becomes a reference: 0 -> 39,950 pixels, inside the fixture
  window exactly where the real surface differs from it plus the one edge
  tile. 11 tier-3 rows moved, all 1 tile/px windows, every moved pixel a
  corrected terrain pixel. No tier-2 fold moved.
- Planted breaks: no may-touch rule 1 -> 217 px, no margin 1 -> 72 px (tiles
  stop stitching), poison 1 -> 64,368 tiles.
- Cost, Node, one thread, median of 3 interleaved: app default (1024 'all',
  128 px tiles) raw 25.7 s, eager correction 84.3 s (3.3x), correct_window
  51.9 s (2.0x), with eager and lazy byte-identical.

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

coderabbitai Bot commented Nov 27, 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 4 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: e26d0e90-646c-4fcc-ba1d-98a7ab0d527b
Commits

Reviewing files that changed from the base of the PR and between 809b190 and 97d9e8a.

Files ignored due to path filters: 1

  • src/noise/wasm/engine.wasm is excluded by !**/*.wasm
Files selected for processing: 14

  • crates/fmw-noise/src/tiles/mod.rs
  • crates/fmw-noise/src/tiles/vulcanus_catalog.rs
  • crates/fmw-noise/src/tiles/vulcanus_correction.rs
  • crates/fmw-wasm/src/render.rs
  • docs/noise/tile-correction-NOTES.md
  • docs/rust-wasm-port.md
  • scripts/probes/gleba-real-surface/README.md
  • scripts/probes/gleba-real-surface/capture.ts
  • scripts/verify-rust.sh
  • test/fixtures/PROVENANCE.json
  • test/fixtures/oracle-vulcanus-real-surface-each.seed123456.json
  • test/fixtures/oracle-vulcanus-real-surface.seed123456.json
  • test/fixtures/tier3-render-checksums.json
  • test/wasmVulcanusRenderParity.spec.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 27, 2026

Copy link
Copy Markdown

Code review

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

@wormeyman
wormeyman merged commit 36cef3d into main Nov 27, 2026
16 checks passed
@wormeyman
wormeyman deleted the vulcanus/real-surface-tiles branch November 27, 2026 03:24
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