Skip to content

Render Aquilo in the preview (Stage 1 of #454) - #493

Merged
wormeyman merged 17 commits into
mainfrom
aquilo-stage-1
Oct 23, 2026
Merged

wormeyman merged 17 commits into
mainfrom
aquilo-stage-1

Conversation

@wormeyman

@wormeyman wormeyman commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Stage 1 of #454: Aquilo is now a full planet in the preview. Pick Aquilo and the terrain, resources, rocks and all views draw through the Rust/WASM engine, and the three resource sliders reshape the islands the way the game does. Gleba still shows "Client preview is not available for Gleba yet."

What changed

  • Captures (scripts/probes/aquilo-fields/): 30 Aquilo fields at three slider settings (default, all sizes 0, moved), plus a census of every well and iceberg the game placed in one region. Both carry PROVENANCE.json entries.
  • Spot noise moved out of the Vulcanus module into crates/fmw-noise/src/spot_field.rs. Vulcanus is bit-identical after the move: its frozen fold did not change.
  • Aquilo fields: the starting spots, spot fields and well probabilities; elevation, aux and the two tile-variety fields; the 9-tile catalog; the well and iceberg overlays.
  • ABI: Aquilo is planet code 3, with a 128-byte block (a request is 184 bytes). View 12 is an entity footprint used only by the tests. REQUEST_BYTES stays 568.
  • App: readAquiloResourceControls, the dispatch branch, and the capability row, flipped last.
  • Docs: an Aquilo section in docs/rust-wasm-port.md, a shared-module section in docs/noise/spot-noise-NOTES.md, and a new docs/noise/aquilo-NOTES.md.

How it is graded

Tier 1 (game captures, exact f32 bit matches): every Aquilo field matches on every sample in all three cases. The 9 tile scores and the winning tile match at 1024, 632, 452 and 626 positions. The same fields were captured from 2.0.77 and 2.1.23.

Tier 2 (native against WASM, raw-bit folds): 28 fields in 4 windows, each at default and moved sliders, for 224 frozen rows. Every field takes more than one value in some case. Each of the six sliders changes at least one fold. An out-of-range field index folds 0.

Tier 3 (against the game's preview PNGs, derived seed 3111923328):

check frozen value
terrain, all three sizes at 0 (the PNG's own settings), differing pixels 0 of 1,048,576
control: the same render at default sliders 13,194
full PNG, tile pixels only, our terrain view 0 of 1,023,862 compared
footprint, game entity pixels outside ours, at mark radius 1 / 2 7 / 0
tiled render against the whole render identical (control without the halo: 84 bytes differ)

The 7 pixels outside the footprint at radius 1 are edges of large icebergs. The game draws them wider than our 3x3 mark.

The full-PNG check uses our terrain view, not the composite. Where the marks land is graded separately, by a per-colour count. The composite would differ on 1,102 pixels.

The aquilo:render digests are a self-snapshot that catches changes. They are not a correctness grade.

A planted swap of the crude oil and lithium bearings turned 12 of the 26 tier-3 tests red.

No frozen Nauvis, Vulcanus or Fulgora value moved at any tier.

Found along the way

Not done here

  • Our engine is not scored against the 100 FactorioTools positions that Stage 0 used to check the capture harness. They use a different seed, so that would be a cheap, independent extra check later.
  • The all view evaluates the whole Aquilo field stack about 4 times per tile, because each overlay query rebuilds it. Correctness is fine. The cost is not measured.

Checks

  • pnpm run verify exit 0 at b6eef13. Everything after that is docs and #[cfg(test)] code; bash scripts/verify-rust.sh exit 0 at the head, and engine.wasm is unchanged by it.
  • test/wasmAquiloRenderParity.spec.ts takes about 20s on a dev machine, against about 13s for the Fulgora spec.
  • CI cost: see the comment below, read over three runs.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LtSA5yo8C9AcqeSL8bQ3LT

Summary by CodeRabbit

  • New Features
    • Added Aquilo map previews with terrain, resource, rock, and combined views.
    • Aquilo previews now reflect crude oil, lithium brine, and fluorine vent settings.
    • Added entity-footprint previews for wells and icebergs.
    • Views not available for Aquilo, including elevation and enemy previews, fall back to terrain.
  • Documentation
    • Added notes describing Aquilo preview behavior and known differences from in-game placement.

wormeyman and others added 17 commits October 23, 2026 06:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LtSA5yo8C9AcqeSL8bQ3LT
New module expressions/aquilo_resources.rs: the four starting cones, the
starting mask, the three aquilo_spot_noise fields and the three well
probabilities. All 11 fields match the game bit for bit at every position
of all three lever cases (632, 452 and 626 positions).

The spot cones needed the game's own arithmetic, read from the 2.1.23
binary: the peak is computed once in f64 with pi = 3.1416 (not the std pi),
and the distance is f32. spot_field gains ConeArithmetic::GameBinary for
this. Vulcanus keeps the ported arithmetic so its frozen counts do not
move; switching it would raise its four region counts (measured, recorded
in spot_field's docs, not applied).

The size gate folds to +0 at size 0, as the game does. The three tier-1
tests join POISONED_TESTS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LtSA5yo8C9AcqeSL8bQ3LT
Adds aquilo_terrain.rs (wobbles, aux, high-frequency peaks, snow/ice,
tile variant, island peaks, elevation) and aquilo_stack.rs (AquiloCtx,
AquiloStack, AquiloFields). Every field is a full house in all three
lever cases of oracle-aquilo-entity-fields, and elevation and aux are
1024/1024 on oracle-aquilo-fields.

random_island_peaks uses a new AmplitudeCorrectedGame: an f32
persistence plus the output_scale transform folded in f32 in the Lua's
order. It scores 152/152 on the wrapper fixture where the shipped form
is 81 (#254). Nauvis keeps the shipped form; moving it is its own change.

Also the Task 3 doc carry-overs in spot_field.rs and fixtures.rs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LtSA5yo8C9AcqeSL8bQ3LT
The catalog (tiles/aquilo_catalog.rs) scores 1,024/1,024 and 632/452/626
on all nine tiles and the winner. Carry-overs: AmplitudeCorrectedGame
reuses the shared eval_at, the stack's grid test covers every raw field,
the powf bits are pinned, and the resource scorer uses count_exact_bits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LtSA5yo8C9AcqeSL8bQ3LT
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LtSA5yo8C9AcqeSL8bQ3LT
Ruling R7: the iceberg overlay takes lithium-iceberg-huge's 3.7 x 2.5 box at
every tile, the rule vulcanus_placement ships, since huge never wins the
argmax. The census window now places 195 icebergs against the game's 180
(the argmax box placed 357). tile_at moves beside AquiloStack, and a
measured seed pins the two-vent case at a chunk boundary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LtSA5yo8C9AcqeSL8bQ3LT
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LtSA5yo8C9AcqeSL8bQ3LT
… out-of-range field

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LtSA5yo8C9AcqeSL8bQ3LT
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LtSA5yo8C9AcqeSL8bQ3LT
Reads the three Aquilo resource controls (neutral 1/1 when absent), carries them through the panel and the render request, and dispatches Aquilo to the engine with the halo-widened placement sweep box. The capability row flips last. Gleba keeps its not-available note.

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

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ 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: e0dd09d4-bde5-47bf-881f-c5540725189a
📥 Commits

Reviewing files that changed from the base of the PR and between a04ebe8 and 1b63410.

⛔ Files ignored due to path filters: 1
  • src/noise/wasm/engine.wasm is excluded by !**/*.wasm
📒 Files selected for processing: 49
  • CLAUDE.md
  • crates/fmw-noise/src/expressions/aquilo_resources.rs
  • crates/fmw-noise/src/expressions/aquilo_stack.rs
  • crates/fmw-noise/src/expressions/aquilo_terrain.rs
  • crates/fmw-noise/src/expressions/mod.rs
  • crates/fmw-noise/src/expressions/vulcanus_resources.rs
  • crates/fmw-noise/src/fixtures.rs
  • crates/fmw-noise/src/lib.rs
  • crates/fmw-noise/src/placement/roll.rs
  • crates/fmw-noise/src/resources/aquilo_wells.rs
  • crates/fmw-noise/src/resources/mod.rs
  • crates/fmw-noise/src/rocks/aquilo_icebergs.rs
  • crates/fmw-noise/src/rocks/mod.rs
  • crates/fmw-noise/src/spot_field.rs
  • crates/fmw-noise/src/tiles/aquilo_catalog.rs
  • crates/fmw-noise/src/tiles/mod.rs
  • crates/fmw-noise/src/variable_persistence_multioctave_noise.rs
  • crates/fmw-wasm/src/abi.rs
  • crates/fmw-wasm/src/lib.rs
  • crates/fmw-wasm/src/native_parity.rs
  • crates/fmw-wasm/src/render.rs
  • docs/noise/aquilo-NOTES.md
  • docs/noise/spot-noise-NOTES.md
  • docs/rust-wasm-port.md
  • docs/superpowers/plans/2026-10-23-aquilo-stage-1.md
  • scripts/probes/aquilo-fields/README.md
  • scripts/probes/aquilo-fields/capture.ts
  • scripts/verify-rust.sh
  • src/components/ElevationPreviewPanel.vue
  • src/model/elevationPreviewCtx.ts
  • src/model/planetCapabilities.ts
  • src/model/resourceReads.ts
  • src/noise/preview/elevationRenderRequest.ts
  • src/noise/wasm/request.ts
  • test/elevationPreviewCtx.spec.ts
  • test/elevationPreviewPanel.spec.ts
  • test/elevationRenderRequest.spec.ts
  • test/fixtures/PROVENANCE.json
  • test/fixtures/oracle-aquilo-entities.seed123456.json
  • test/fixtures/oracle-aquilo-entity-fields.seed123456.json
  • test/fixtures/tier2-checksums.json
  • test/fixtures/tier3-render-checksums.json
  • test/fixtures/verify-wasm-request.py
  • test/fixtures/wasm-request.v2.json
  • test/resourceReads.spec.ts
  • test/tier2Coverage.spec.ts
  • test/wasmAquiloParity.spec.ts
  • test/wasmAquiloRenderParity.spec.ts
  • test/wasmFulgoraRenderParity.spec.ts

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

📝 Walkthrough

This change adds Aquilo map generation and preview rendering. It introduces Aquilo resources, terrain, tiles, wells, icebergs, a WASM request format, render views, frontend wiring, parity fixtures, and validation tests. It also extracts shared spot-field logic for Vulcanus and Aquilo.

Changes: Aquilo generation and rendering

Layer / File(s) Summary
Shared spot-field infrastructure
crates/fmw-noise/src/spot_field.rs, crates/fmw-noise/src/expressions/vulcanus_resources.rs
Shared region caching, geometry, and cone calculations are added. Vulcanus uses the shared implementation.
Aquilo fields and tiles
crates/fmw-noise/src/expressions/aquilo_*.rs, crates/fmw-noise/src/tiles/aquilo_catalog.rs
Aquilo resource and terrain fields, a 28-field parity mapping, and nine tile scores are added.
Aquilo placements
crates/fmw-noise/src/resources/aquilo_wells.rs, crates/fmw-noise/src/rocks/aquilo_icebergs.rs
Well and iceberg selection, placement salts, collision boxes, tile gates, colors, and placement sets are added.
WASM ABI and renderer
crates/fmw-wasm/src/abi.rs, crates/fmw-wasm/src/render.rs, crates/fmw-wasm/src/lib.rs
Aquilo uses a 128-byte parameter block and 184-byte request. Terrain, resources, rocks, composite, footprint, and checksum paths are added.
Preview integration
src/model/*, src/noise/preview/elevationRenderRequest.ts, src/noise/wasm/request.ts, src/components/ElevationPreviewPanel.vue
Aquilo controls are read from presets, encoded into requests, dispatched through WASM, and exposed in the preview panel.
Fixtures and verification
scripts/probes/aquilo-fields/*, test/fixtures/*, test/wasmAquilo*, crates/fmw-noise/src/fixtures.rs
Field captures, entity census data, ABI fixtures, checksums, render parity tests, and anti-vacuity checks are added. Documentation records measured parity results and remaining placement differences.

Priority: ➖ Normal

Estimated code review effort: 5 (Critical) | ~120 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Preview
  participant WASM
  participant AquiloStack
  participant Placement
  Preview->>WASM: submit Aquilo render request
  WASM->>AquiloStack: evaluate terrain and resource fields
  AquiloStack->>Placement: resolve wells and icebergs
  Placement-->>WASM: return overlay pixels
  WASM-->>Preview: return rendered image
Loading
Merge Risk: ⚪ Minimal · up to 1b634

This change adds Aquilo to the preview through the Rust/WASM engine, and no concrete defect was found in the supplied changes. The author reports passing checks and field matches against game captures. Known placement differences for wells and icebergs are documented in the notes and are intentional tradeoffs. Normal CI verification before merge is sufficient.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding Aquilo rendering to the preview. The stage reference provides useful context.
Docstring Coverage Passed Docstring coverage is 82.02% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 228 functions across 36 files. (12 skipped:…
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: Docstring Coverage

Explanation

Docstring coverage is 82.02% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 228 functions across 36 files. (12 skipped: 12 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 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

Comment @coderabbitai help to get the list of available commands.

@wormeyman

Copy link
Copy Markdown
Collaborator Author

CI cost over three runs of this PR (the first run on open, then two re-runs of the same commit, since review asked for no changes), against the last three green pushes to main:

job main runs main median PR runs PR median
rust 5m55s, 9m28s, 10m20s 9m28s 7m24s, 9m25s, 10m50s 9m25s
slowest test shard, tests (1, 4) 2m52s, 5m08s, 4m23s 4m23s 3m39s, 4m23s, 4m28s 4m23s

Neither median moved. The spread inside each column (about 4 to 5 minutes on rust) is the runner, not the change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LtSA5yo8C9AcqeSL8bQ3LT

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