Repository navigation
Nauvis: terrain matches a real surface, with tile correction and allowed_neighbors (#454) - #563
Merged
Merged
Conversation
…wed_neighbors At one tile per pixel on a whole-tile origin, the Nauvis render now runs tile correction through correct_window (lazy raw reads, the uniform-seed skip) with a one-chunk margin, and matches get_tile on a real surface at every tile. - Two committed real-surface fixtures from fresh Nauvis surfaces (seed 123456, terrain-only, one radius request): the spawn window -128..127 (raw argmax 89 off, corrected 0) and a coast window 384..639, -320..-65 where the raw tiles put deepwater beside land (326 off, corrected 0). - correction.rs gains Neighbours: allowed_neighbors and the replacement table read from the 2.1.23 binary. Area::lazy, correct_chunks_with and correct_window take the rule; Gleba and Aquilo pass None and stay at 0. Without the rule the coast window is 73 off. The lazy-vs-eager and skip unit tests also run with a neighbour rule active. - The probe takes FMW_PLANET=nauvis, FMW_X0, FMW_Y0 and FMW_SIDE, and records each tile's forbidden neighbours. Gleba's and Aquilo's fixtures re-capture byte-identical. - The 1024 preview PNG count moves 0 -> 2,810, exactly where a scratch real surface of that window differs from the PNG (corrected tiles differ from it at 0 of 1,048,576). No tier-2 fold or frozen render row moved. - No argmax ties anywhere checked, so the tie rule is untested on Nauvis. - Cost at the app's default view (all, 1024, 64 tiles of 128, Node): 5.97 s raw, 14.24 s with the first eager wiring, 9.29 s now (1.56x). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kd6o1dTdCEZ5JSjytamwMZ
|
Warning Review limit reachedYou'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 38 minutes. View limit details
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. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nauvis's terrain now matches a real Nauvis surface at every tile, where before it matched only the game's map preview. It takes tile correction plus one rule the game enforces: deepwater may only touch water (
allowed_neighbors).Against a real surface (tiles wrong out of 65,536)
Both fixtures come from a fresh
game.create_surfacewith Nauvis's settings at seed 123456, on 2.1.23. The game's ownnauvissurface generates spawn chunks before the probe runs, so it can't be used. Both re-capture byte-identical and have PROVENANCE entries.The deepwater rule
The raw tiles put deepwater next to land 173 times in the 1024 window. From the 2.1.23 binary:
TilePrototype::postLoadSetupmakesallowed_neighborstwo-way.isTileConsistentWithFixedTilesfails a tile at once when a neighbour does not allow it.correctFromTilethen takes a replacement from a table thatGlobalContext::postPrototypesConstructedSetupbuilds by breadth-first search. Between deepwater and land, that replacement is always water.correction.rsgains aNeighbourstype (from_allowed) as anOptiononArea.correct_windowandcorrect_chunks_withtake it, and Gleba and Aquilo passNoneand stay at 0. The forbidden-neighbour check comes after then == ctest, so #562's skip of no-op walks stays exact; its lazy-vs-eager and skip tests now also run with a rule active. One limit: the replacement search runs over the planet's own tiles, where the game's runs over every tile. That is enough for Nauvis, because water is the only tile that allows deepwater.Nauvis has no tile ties: none in the spawn window plus its margin (asserted), and none in a 1024 window or four 512 windows out to 8,000 tiles.
Planted breaks
POISONED_TESTS.What moved
nauvis:renderrows moved, because none is at 1 tile per pixel on a whole-tile origin.Cost and what users see
The app opens Nauvis at 1 tile per pixel in
all, so every user gets the corrected terrain by default. Other zooms draw the raw argmax.all1024, the app default, 64 tiles of 128, one threadMost of what remains is the raw tiles in each worker tile's margin. Whether larger worker tiles help is a separate, measured follow-up.
Not covered yet: the resource, rock and enemy overlays still test water against the raw tile.
Gate
pnpm run verify:lint, the fullpnpm vp test(1,364 passed) andscripts/verify-rust.shpass locally.cargo denyis not installed on hammond; CI runs it.Refs #454.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Kd6o1dTdCEZ5JSjytamwMZ