Repository navigation
Nauvis fields: round cliffs, rocks, enemies and trees to f32; fix the no-cliff miss (#521) - #526
Conversation
…liff elevation is 26 of 26 (#521) The one point elevation_nauvis_no_cliff missed was not the lerp. The game's amplitude-corrected noise in nauvis_persistance is 0.0905596986 there; the shipped f64 form gave 0.090559684. That moved nauvis_detail by 6e-8, which is below one f32 step at the full tree's 22.1 but above one at 4.35. Given the game's own t and detail, our lerp and nauvis_main already matched it. Nauvis now uses AmplitudeCorrectedGame (152 of 152, #254). engine.wasm is not rebuilt and tier 2 is not re-recorded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kd6o1cBoAGaJ1FoYPm6arC
cliff_elevation_nauvis and the six cliffiness sub-terms now go through f32r one step at a time in the Lua's order, literals included (0.01, 0.03, 0.05 narrowed before use; -2 added last in the starting-area term; 1.5 + basis then + the lever). Tier 1: cliff elevation 699 -> 1024 and 648 -> 1024 of 1024 (every position exact at both seeds). The cliffiness gate stays at 0 mismatches; the closest margin to the cutoff moves by 3e-8 (3.402456e-3 -> 3.402424e-3, 2.344133e-4 -> 2.343776e-4), re-frozen. The cutoff 2 * gap ^ 1.5 is left in f64 (ungraded: margins are 2e-4 or more). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kd6o1cBoAGaJ1FoYPm6arC
rock_noise, rock_density and the three prototype probabilities now go through f32r one step at a time in the Lua's order. The 0.25 is added to the noise before the size term (the Lua adds left to right; the port folded it into the size term). The 0.15 * frequency input scale is narrowed, and range_select_base gets a local f32 form (the shared one is used by Vulcanus and left alone). Tier 1: rock_density 17 -> 26 of 26 (snapped), worst error exactly 0, so the old < 9e-8 bound becomes an equality. The raw (unsnapped) arm goes 7 -> 16. The three probabilities are ungraded in tier 1 (all are negative at the fixture positions). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kd6o1cBoAGaJ1FoYPm6arC
- The cone now runs through the shared spot_cone_max with ConeArithmetic::GameBinary (the game's pi 3.1416, an f32 distance, the peak narrowed once), as Aquilo does, instead of a local per-step chain with the f64 pi. - The spot radius and quantity (pi / 90 * r ^ 3, the cube two f32 multiplies) are f32 steps, used for the cone, the blob term and the spot selection's quantity. - The blob term reads basis_noise through the expression adapter (coordinates narrowed in f32), and the sum, the starting-area term and the blob arithmetic follow the Lua's order one f32 step at a time. Tier 1 (basement / mid / live buckets, seed 123456 and 777771): basement 209 -> 239 of 239 and 126 -> 159 of 159 mid 0 -> 602 of 602 and 0 -> 658 of 658 live 1 -> 191 of 191 and 1 -> 215 of 215 Every position is exact and every worst error is 0. The test's residual-ordering assertion has nothing left to order and now asserts all residuals are 0. Selection's density stays the catalog's f64 expression (ungraded). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kd6o1cBoAGaJ1FoYPm6arC
The tree species and the shared forest-path cutout joined their exact noise ops with f64 arithmetic. Each step now goes through f32r in the Lua's order: - shared.rs: the three path terms, trees_forest_path_cutout and trees_forest_path_cutout_faded. - asymmetric_ramps.rs (its only caller is the species): literals narrowed, denominators folded from the f32 literals. - field.rs: the species sum (climate + distance - size_offset + 0.2 * size + small * 0.1, left to right), the distance term, cap, size_offset and 0.2 * size as f32 constants, and input_scale as f32(1/div) * f32(frequency). - temperature is an f64 when it reaches the species, so it is rounded to f32 where they read it (eight species went to 26 at once). - output_scale is narrowed to f32 before the noise. The three species at 0.7 were the last misses; 0.7 is the one scale in the table that f32 and f64 round differently. Tier 1: trees_forest_path_cutout_faded 9 -> 26. Every species 26 of 26, worst error 0 (before: tree_01 1, tree_04 10, tree_05 2, tree_02 9, tree_03 7, tree_07 8, tree_02_red 1, tree_08 2, tree_09 13, tree_06 7, tree_08_brown 9, tree_09_brown 8, tree_06_brown 8, tree_08_red 13, tree_09_red 11). Total 144 -> 442 of 442. The moved-lever fixture goes 9 -> 51 of 51, and the unsnapped totals 99 -> 272 and 8 -> 36. Not rebuilt: engine.wasm and the tier-2 checksums. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kd6o1cBoAGaJ1FoYPm6arC
154 Nauvis rows moved, all in fields this branch changes: elevation_nauvis and its no-cliff variant (the persistence fix), cliff_elevation, the enemy base field and probability, the three rock probabilities and density, and every tree species with the forest-path cutouts and tree density. No row moved on any other planet, and no key was added or removed. The full vitest suite passes after the re-record, and the Nauvis terrain render still matches the game on every pixel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kd6o1cBoAGaJ1FoYPm6arC
The field that pins elevation_nauvis's persistence input_scale is read only by a unit test, so clippy -D warnings rejected it as dead code in the release build. It is now cfg(test). The persistence commit was also not cargo-fmt clean. engine.wasm is rebuilt for both; no value changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kd6o1cBoAGaJ1FoYPm6arC
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
Stack 1 of 5 for #521. Base
main. Then #527 (Nauvis resources), #528 (Fulgora), #529 (Vulcanus), #530 (follow-ups).This rounds the rest of Nauvis's noise fields to f32 one step at a time, the way the game evaluates them (the method from #452). It also closes #521's open question.
Results (tier 1, exact f32 matches)
elevation_nauvis_no_cliff, seed 123456 (of 26)cliff_elevation_nauvis, two seeds (of 1,024)rock_density, snapped (of 26)No tier-1 count went down. tree_04, which #452 moved from 11 to 10, is now 26.
The open question was not the
lerp#521 asked why
elevation_nauvis_no_cliffmissed one point by one f32 step while the full tree was exact. A probe read the game's intermediate values at that point on 2.1.23. The lerp's input and the lerp itself matched ours bit for bit. The difference wasnauvis_persistance. It still used the old f64 amplitude form that #254 records at 81 of 152, and it was two f32 steps low. That error is under one step at the full tree's value of 22.1 but over one step at 4.35. So only the no-cliff variant showed it. Persistence now usesAmplitudeCorrectedGame, the form that scores 152 of 152 in #254. A control confirmed that 2.1.23 gives the same values as the 2.1.11 fixture on all 26 points.What else changed
ConeArithmetic::GameBinary), which Aquilo already uses. The spot quantity's cube is two f32 multiplies; onepowfmissed 11 and 142 points.temperaturereached the species unrounded.output_scale0.7 is the one value in the table where f32 and f64 differ. The species sum runs left to right; folding-0.5 + 0.2 * sizeinto one constant scored worse.cfg(test).Checks
cargo test -p fmw-noise --lib: 537 passed.scripts/verify-rust.sh: passed (cargo denyis not installed locally; CI runs it).engine.wasmrebuilt. Tier 2: 154 Nauvis rows re-recorded, all in fields this PR changes. No other planet moved.pnpm vp test: green. The Nauvis terrain render still matches the game on every pixel.The four "probably not in scope" modules in #521 were also checked against the 2.1.23 binary.
cliffs/collision.rsandvoronoi_noise.rsmatch it.eval/memo_region.rsexists only in the port and nothing uses it.multioctave_noise.rshas one gap: the game holds persistence, output scale and octaves as f32. That fix is in #530.🤖 Generated with Claude Code
https://claude.ai/code/session_01Kd6o1cBoAGaJ1FoYPm6arC
Summary by CodeRabbit