Skip to content

Follow-ups: multioctave fields, temperature and ore radius in f32 (#521) - #533

Merged
wormeyman merged 4 commits into
mainfrom
f32-521-followups
Nov 25, 2026
Merged

wormeyman merged 4 commits into
mainfrom
f32-521-followups

Conversation

@wormeyman

@wormeyman wormeyman commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Stack 5 of 5 for #521, reopened as a new PR. This replaces #530, which is the same branch. #526 to #529 are merged, and this branch is rebased onto main at 1be2643. A GitHub API outage left #530 showing the pre-rebase head, and GitHub will not reopen a PR after a force-push.

Three small fixes that the first four PRs turned up. Each is its own commit.

1. Multioctave persistence and output scale in f32

A read of the 2.1.23 binary (NoiseOperations::MultioctaveNoise::run, file 0x25222b0) shows the game stores persistence and output scale as f32 and computes 1/P with an f32 divide. octave_terms used them as f64. Values like 0.55, 0.6 and 0.85 round differently. Only Vulcanus rocks moved:

field (of 434) before after
vulcanus_rock_huge 303 433
vulcanus_rock_big 297 432
rock density 421 432

2. Nauvis temperature rounded at its source

Temperature::eval_at now rounds 15 + bias + noise one step at a time before the clamp, as the Lua writes it. The tree layer had rounded temperature where it read it. That rounding is gone, and the trees stay at 442 of 442. No tier-1 count moved, so this one is ungraded. It matches the Lua.

3. Vulcanus ore spots use the f32 starting-area radius

field (of 1,085) before after
startingCoal 974 1,085
startingCalcite 969 1,085
startingSulfur 1,050 1,085
coalRegion 1,043 1,063
sulfuricAcidRegion 1,039 1,053
sulfuricAcidRegionPatchy 1,040 1,054

The shared spot query's frozen fold is re-frozen.

Checked and left alone

  • The enemy field's 1/24 input scale is already right. It goes into basis_noise_expr as an input scale, which narrows it and multiplies f32(x) * f32(scale), the game's form.
  • Fulgora's input scales (128 / grid / 20 and similar) are several f64 steps rounded once. Rounding each step in f32 moved no count, and at the default grid of 175 the values are bit-identical. It could only matter at non-default sliders, which no fixture covers, so it was reverted.

Checks

  • cargo test -p fmw-noise --lib: 538 passed. scripts/verify-rust.sh: passed. pnpm vp check: clean.
  • engine.wasm rebuilt. Tier 2: 60 rows (Nauvis 6, the multioctave primitive 1, Vulcanus 53). No Fulgora or Aquilo row moved.
  • Full pnpm vp test: green. No render pixel count against the game moved.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kd6o1cBoAGaJ1FoYPm6arC

Summary by CodeRabbit

  • Bug Fixes
    • Improved numerical consistency for temperature, noise, and Vulcanus resource calculations.
    • Updated temperature values used in tree placement to match the game’s rounding behavior.
    • Some generated terrain and resource results may differ slightly from previous versions, including in starting areas.

wormeyman and others added 4 commits November 25, 2026 07:51
The game stores octaves' persistence and output_scale as f32 fields and
computes 1/P with divss (NoiseOperations::MultioctaveNoise::run, 2.1.23).
octave_terms used the f64 values unrounded. Narrow both first.

Tier 1 (only these moved, all on Vulcanus; every other planet unchanged):
vulcanus_rock_huge 303 -> 433 of 434, vulcanus_rock_big 297 -> 432,
rock density 421 -> 432.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kd6o1cBoAGaJ1FoYPm6arC
temperature_basic is clamp(15 + bias + noise, -20, 50). The game folds
15 + bias, then adds the noise in f32. Temperature::eval returned an
unrounded f64 and the tree layer rounded it where it read it. Round each
step in Temperature and drop the tree layer's now-redundant f32r.

Tier 1: no count moved (trees stay 442 of 442). The bias-shift unit test
tolerance went from 1e-9 to one f32 step at the field's scale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kd6o1cBoAGaJ1FoYPm6arC
vulcanus_resources used the f64 0.7 * 0.75 for its spot distances while
the biome layer already used the f32 constant the game holds.

Tier 1 (out of 1085): starting coal 974 -> 1085, starting calcite 969 ->
1085, starting sulfur 1050 -> 1085, coal region 1043 -> 1063, sulfuric
acid region 1039 -> 1053, sulfuric acid region patchy 1040 -> 1054. No
count went down. The spot-query raw-bits fold was re-frozen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kd6o1cBoAGaJ1FoYPm6arC
60 rows moved, all in fields these follow-ups change:

- nauvis: 6 rows (temperature, now rounded at its source)
- primitives:multioctave: 1 row (persistence and output scale as f32)
- vulcanus: 53 rows (the rock fields and rock noise, the starting ores
  and their regions, metalTile, and four tiles that read them)

No Fulgora or Aquilo row moved, no key was added or removed, and no
render pixel count against the game moved. The full vitest suite passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kd6o1cBoAGaJ1FoYPm6arC
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Temperature and multioctave calculations now apply f32 rounding at additional steps. Vulcanus starting spots use the f32 starting-area radius. Related fixture match counts and tier-2 checksums are updated.

Changes: Noise evaluation rounding

Layer / File(s) Summary
Temperature evaluation and tree-field handoff
crates/fmw-noise/src/expressions/nauvis_climate.rs, crates/fmw-noise/src/trees/field.rs, test/fixtures/tier2-checksums.json
Temperature rounds its base and noise sum to f32 before clamping. TreeFields::temperature returns the evaluation result directly. Nauvis temperature checksum expectations change.
Multioctave and Vulcanus outputs
crates/fmw-noise/src/multioctave_noise.rs, crates/fmw-noise/src/expressions/vulcanus_resources.rs, crates/fmw-noise/src/fixtures.rs, test/fixtures/tier2-checksums.json
octave_terms narrows persistence and output scale to f32 before use. Vulcanus starting spots use the f32 starting-area radius. Related match counts, a frozen fold value, and Vulcanus checksums change.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related issues

  • Issue 521 tracks per-step f32 rounding across noise expressions. This PR applies that approach to temperature, multioctave calculations, and Vulcanus starting spots.
  • Issue 400 tracks per-planet pixel and count parity. This PR updates Vulcanus match counts and tier-2 checksums.

Possibly related PRs

Merge Risk: Minimal · up to 5ad6a · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names three changes: multioctave persistence and output scale narrowed to f32, Nauvis temperature rounding moved to Temperature::eval_at in f32, and the Vulcanus ore starting-area radius swi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names three changes: multioctave persistence and output scale narrowed to f32, Nauvis temperature rounding moved to Temperature::eval_at in f32, and the Vulcanus ore starting-area radius switched to f32. The raw summary and objectives describe these same three changes, so the title matches the main changeset. It is long at 72 characters, and the '#521' reference is an issue number rather than a description, but the title is specific and accurate.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

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: 21b15c31-b88c-49d1-b1fd-a72f1f53c07c
Commits

Reviewing files that changed from the base of the PR and between 1be2643 and 5ad6a1a.

Files ignored due to path filters: 1

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

  • crates/fmw-noise/src/expressions/nauvis_climate.rs
  • crates/fmw-noise/src/expressions/vulcanus_resources.rs
  • crates/fmw-noise/src/fixtures.rs
  • crates/fmw-noise/src/multioctave_noise.rs
  • crates/fmw-noise/src/trees/field.rs
  • test/fixtures/tier2-checksums.json

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@claude

claude Bot commented Nov 25, 2026

Copy link
Copy Markdown

Code review

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

🤖 Generated with Claude Code

@wormeyman
wormeyman merged commit 413e9db into main Nov 25, 2026
12 checks passed
@wormeyman
wormeyman deleted the f32-521-followups branch November 25, 2026 18:08
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