You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Aquilo: draw the wells' tile rewrite as its expected outcome (#586) - #605
Each Aquilo well's created_effect turns nearby water into snow and ice when the well is created. The real-surface views (all, resources, rocks) now draw the expected outcome of that rewrite:
Every water tile (ammoniacal-ocean, ammoniacal-ocean-2, brash-ice) in the well's 3 x 3 becomes snow-lumpy. The game does this with no randomness: a radius of 1.5 around the well's tile centre.
Outside the 3 x 3, every water tile with dx^2 + dy^2 <= 10 (squared distance between tile centres) becomes ice-rough.
Entities are still placed from the tiles before the rewrite, as the game does. Only the drawn tile changes.
The outer explosion is a cluster whose points come from the surface's own random generator, so a preview cannot reproduce it tile for tile. This PR draws its expected outcome, the same approach as tree removal. The issue stays open for that random part.
The rule lives in crates/fmw-noise/src/placement/aquilo_well_tiles.rs and is applied in real_surface_window into a new shown tile buffer.
How the rule was chosen
A new probe, scripts/probes/aquilo-well-tile-rewrite, runs Factorio 2.1.23 through factorio-oracle (with --factorio and --version, and a buildLine check) twice per seed: once as shipped, and once with created_effect removed from the three wells. Both runs placed the same wells at every seed. It was captured at four seeds: 123456, 2024, 31337 and 987654. Re-running seeds 123456 and 987654 wrote byte-identical files.
Among water tiles that only one well reaches, pooled over the four seeds:
every tile in the 3 x 3 became snow-lumpy (1,297 of 1,297), and no tile outside it did;
the share that changed falls off with straight-line distance: 90.3% at dx^2 + dy^2 = 4, 87.0% at 5, 75.2% at 8, 72.6% at 9, 66.3% at 10, 48.6% at 13, 34.5% at 16;
ice-rough is the most common result in every one of those rings, at every seed.
The ring keeps the distances where more than half the water changed. Leaving any one seed out of the pooling picks the same rule.
Three arms against the map a player gets
Wrong tiles by name over the 1024 x 1024 window, run on the game's own unrewritten tiles and wells (the_rule_against_four_real_surfaces):
seed
(a) no rewrite
(b) 3 x 3 only
(c) 3 x 3 and ring, shipped
(c) with a square ring instead
123456
2,756
2,186
1,493
1,669
2024
3,030
2,395
1,708
1,882
31337
2,588
2,054
1,450
1,624
987654
1,741
1,380
1,004
1,122
(c) beats (b) on every seed, with 27% to 32% fewer wrong tiles.
Which views change
all, resources and rocks at one tile per pixel. In all and resources each well paints over its own 3 x 3, so only the ring shows there. rocks shows both.
terrain is unchanged. It runs no entity generator, so it does not know where the wells are. The spec checks it still equals the game's run with no rewrite around every well and in the window's colour counts, at seeds 123456 and 987654.
Other zooms draw no entities and so no rewrite.
Frozen values that moved:
Aquilo parity spec, seed 123456: entity pixels are still 0 in all three views. Tile pixels against the game's rewritten tiles are 1,427 (all), 1,427 (resources) and 1,493 (rocks). With no rewrite drawn they would be 2,120, 2,120 and 2,756. Seed 987654 rocks: 1,004 (1,741 with none).
Fast counts against the real surface: 1,437, 1,430, 1,500. Fast's own cost on top of High is unchanged at 10, 3 and 7 pixels.
Fast seam count: 432 to 520.
Full preview PNG, tile against tile: 1,036 to 2,756.
11 of the 14 aquilo:render tier-3 digests. The two terrain rows and "slider fluorine vent frequency | all" did not move.
engine.wasm is rebuilt: 648,605 to 650,689 bytes.
fmw-wasm's the_all_view_is_terrain_plus_both_overlays now treats the rewrite as part of the shared base of all, resources and rocks. A planted all without wells and a planted all without icebergs each turn it red.
Planted breaks
Each was run through the rebuilt module, the Rust rule tests and test/wasmAquiloRenderParity.spec.ts, then reverted:
break
Rust
spec
no 3 x 3 block
red
red in rocks only
no ring
red
red (18 tests)
block snow-patchy
red
red in rocks only
ring snow-patchy
red
red (17 tests)
ring ice-smooth
red
green
ring to 9
red
red (18 tests)
ring to 13
red
red (18 tests)
entities placed on the rewritten tiles
green
red (22 tests)
Stated gaps
ice-rough and ice-smooth share a map colour, so no pixel test can tell them apart. Only the Rust tests, which grade by tile name, catch an ice-smooth ring.
In the spec, the 3 x 3 block is graded by rocks alone, because all and resources paint the well over it.
Tiles two wells reach were left out of the calibration and get the same rule.
Cost
WASM under Node, the 1024 window as 64 tiles of 128 summed on one thread, High, median of 7 interleaved runs, main against this branch: all 5,409 vs 5,478 ms, resources 5,474 vs 5,475 ms, rocks 5,482 vs 5,411 ms. The ranges overlap in every row, and terrain, whose code did not change, moved more (2,676 vs 2,882 ms), so the differences are noise.
Verify
pnpm run verify exits 0 locally on this commit, every phase run: vp check, check:vue, vp test (121 files, 1,532 passed, 3 skipped), preview:test (27 passed), and verify:rust (fmt, clippy, doc, cargo test, the anti-vacuity check, zero dependencies, engine.wasm matches its source, cargo deny).
docs/rust-wasm-port.md has the full tables in a new section, "Aquilo's well tile rewrite".
Aquilo render views now show the expected terrain changes around resource wells, including snow-like tiles within each well’s immediate area and rough-ice tiles nearby. Terrain-only views remain unchanged.
Bug Fixes
Updated Aquilo previews and render output to reflect well-related terrain changes more accurately.
Tests
Expanded render checks across multiple map seeds and views to verify terrain and well visuals.
Documentation
Updated Aquilo rendering and parity guidance to describe the visible terrain changes.
Each Aquilo well's created_effect turns nearby water into snow and ice.
The inner explosion is fixed: snow-lumpy within radius 1.5 of the well's
tile centre, which is the well's 3 x 3. The outer one is a cluster drawn
from the surface's random generator, so a preview cannot reproduce it
exactly. The real-surface views (all, resources, rocks) now draw its
expected outcome. Water tiles in the 3 x 3 become snow-lumpy, and water
tiles at dx^2 + dy^2 <= 10 become ice-rough. Those are the rings where
over half the water changed, pooled over four seeds, and ice-rough is the
most common result in each. Entities are still placed from the tiles
before the rewrite.
Calibrated on a new probe, scripts/probes/aquilo-well-tile-rewrite. At
four seeds it captures the game run as shipped and with created_effect
removed, on 2.1.23. Tile errors against the map a player gets, by name,
over the 1024 window:
seed no rewrite 3x3 only 3x3 + ring (shipped)
123456 2756 2186 1493
2024 3030 2395 1708
31337 2588 2054 1450
987654 1741 1380 1004
A square ring scores worse on every seed (1669, 1882, 1624, 1122).
Leaving any one seed out picks the same rule. Render cost is unchanged
within noise.
The rule's tests freeze every row above plus six changed rules. The
Aquilo parity spec now grades entity pixels at 0 and tile pixels at a
frozen count against the game's rewritten tiles. It also checks that
the terrain view equals the run with no rewrite. The fmw-wasm "all is
base plus both overlays" test now treats the rewrite as part of the
shared base. engine.wasm is rebuilt, and the tier-3 digests, Fast counts
and seam count are re-frozen. docs/rust-wasm-port.md has the tables,
the planted breaks and the two stated gaps: ice-smooth shares
ice-rough's colour, and the 3 x 3 is graded only in rocks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kd6o1d3a5zQDRDok3ePdHh
Review was skipped as selected files did not have any reviewable changes.
Files ignored due to path filters: 1
src/noise/wasm/engine.wasm is excluded by !**/*.wasm
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: 1fdf0bb9-e775-4f51-8c15-128be607be7c
Commits
Reviewing files that changed from the base of the PR and between 7adc49d and 0c37ad0.
Files ignored due to path filters: 1
src/noise/wasm/engine.wasm is excluded by !**/*.wasm
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
This change models the expected tile rewrite around Aquilo resource wells and applies it to entity views after entity placement. Captured Factorio surfaces support rule tests and render-parity comparisons, which distinguish tile mismatches from entity mismatches.
Changes: Aquilo well tile rewrite
Layer / File(s)
Summary
Capture and calibrate rewrite data scripts/probes/aquilo-well-tile-rewrite/*, test/fixtures/oracle-aquilo-well-tile-rewrite.*.json, test/fixtures/PROVENANCE.json
Capture and calibration scripts compare shipped and stripped well effects and report tile changes across four seeds. The captured fixtures record the compared tiles and well neighborhoods.
Define and validate the rewrite crates/fmw-noise/src/placement/aquilo_well_tiles.rs, crates/fmw-noise/src/placement/mod.rs, crates/fmw-noise/src/fixtures.rs, crates/fmw-noise/src/fixtures/aquilo_well_tiles.rs
The rewrite paints eligible tiles in each well’s 3×3 block and within squared distance 10. Tests validate the rule against captured surfaces and compare alternative rule settings.
Store and render post-rewrite tiles crates/fmw-noise/src/placement/aquilo.rs, crates/fmw-wasm/src/render.rs, crates/fmw-wasm/src/lib.rs, test/fixtures/tier3-render-checksums.json
Aquilo surface windows store corrected tiles and post-rewrite shown tiles. Entity views use shown tiles, and render tests check the revised overlay behavior and checksums.
Check render parity and document results test/wasmAquiloRenderParity.spec.ts, docs/rust-wasm-port.md, scripts/probes/aquilo-real-surface-entities/README.md
Parity tests compare views against rewrite fixtures and separately count tile and entity mismatches. Documentation records the rewrite rule, measurements, and updated comparisons.
sequenceDiagram
participant real_surface_window
participant rewrite
participant AquiloSurfaceWindow
participant AquiloEntityRenderer
real_surface_window->>rewrite: Pass placed wells and corrected-tile lookup
rewrite-->>real_surface_window: Return tile changes
real_surface_window->>AquiloSurfaceWindow: Store corrected and shown tiles
AquiloEntityRenderer->>AquiloSurfaceWindow: Read shown_tile
Loading
Possibly related issues
Issue 586 asks for the expected snow and ice from well effects in the preview. This change adds the 3×3 snow-lumpy block and ice-rough ring to the modeled views.
Issue 400 tracks per-planet render parity, including Aquilo. This change updates Aquilo render output and parity comparisons.
Possibly related PRs
FactoryGameFan/FactorioMapWebUI#585: This change builds on its Aquilo well and iceberg placement, applying the tile rewrite after entity placement.
FactoryGameFan/FactorioMapWebUI#591: Both changes use Aquilo rewrite behavior and forced-generation fixtures; this change documents that paced generation can differ.
Path filters excluded changed files. This rating applies only to the assessed changes.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the main change: the Aquilo wells' tile rewrite is now drawn in the preview as its expected outcome. The raw summary confirms this: a new WELL_TILE_REWRITE rule, shown_tile lookups, an…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: the Aquilo wells' tile rewrite is now drawn in the preview as its expected outcome. The raw summary confirms this: a new WELL_TILE_REWRITE rule, shown_tile lookups, and render changes for the all, resources, and rocks views. The title's '(#586)' reference matches the README note about #586, while the objectives mention PR #605. That mismatch does not change the title's relevance to the changeset.
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.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
Take main's Aquilo well-tile rewrite (#605) alongside the Gleba tower
view. Only engine.wasm conflicted; it is rebuilt from the merged sources
with scripts/build-wasm.sh (sha256 0e10b70a..., 664,557 bytes). View
codes do not collide (VIEW_TOWER_SCORES stays 13).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kd6o1d3a5zQDRDok3ePdHh
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
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.
Refs #586
What this does
Each Aquilo well's
created_effectturns nearby water into snow and ice when the well is created. The real-surface views (all,resources,rocks) now draw the expected outcome of that rewrite:ammoniacal-ocean,ammoniacal-ocean-2,brash-ice) in the well's 3 x 3 becomessnow-lumpy. The game does this with no randomness: a radius of 1.5 around the well's tile centre.dx^2 + dy^2 <= 10(squared distance between tile centres) becomesice-rough.The outer explosion is a
clusterwhose points come from the surface's own random generator, so a preview cannot reproduce it tile for tile. This PR draws its expected outcome, the same approach as tree removal. The issue stays open for that random part.The rule lives in
crates/fmw-noise/src/placement/aquilo_well_tiles.rsand is applied inreal_surface_windowinto a newshowntile buffer.How the rule was chosen
A new probe,
scripts/probes/aquilo-well-tile-rewrite, runs Factorio 2.1.23 throughfactorio-oracle(with--factorioand--version, and abuildLinecheck) twice per seed: once as shipped, and once withcreated_effectremoved from the three wells. Both runs placed the same wells at every seed. It was captured at four seeds: 123456, 2024, 31337 and 987654. Re-running seeds 123456 and 987654 wrote byte-identical files.Among water tiles that only one well reaches, pooled over the four seeds:
snow-lumpy(1,297 of 1,297), and no tile outside it did;dx^2 + dy^2= 4, 87.0% at 5, 75.2% at 8, 72.6% at 9, 66.3% at 10, 48.6% at 13, 34.5% at 16;ice-roughis the most common result in every one of those rings, at every seed.The ring keeps the distances where more than half the water changed. Leaving any one seed out of the pooling picks the same rule.
Three arms against the map a player gets
Wrong tiles by name over the 1024 x 1024 window, run on the game's own unrewritten tiles and wells (
the_rule_against_four_real_surfaces):(c) beats (b) on every seed, with 27% to 32% fewer wrong tiles.
Which views change
all,resourcesandrocksat one tile per pixel. Inallandresourceseach well paints over its own 3 x 3, so only the ring shows there.rocksshows both.terrainis unchanged. It runs no entity generator, so it does not know where the wells are. The spec checks it still equals the game's run with no rewrite around every well and in the window's colour counts, at seeds 123456 and 987654.Frozen values that moved:
all), 1,427 (resources) and 1,493 (rocks). With no rewrite drawn they would be 2,120, 2,120 and 2,756. Seed 987654rocks: 1,004 (1,741 with none).aquilo:rendertier-3 digests. The two terrain rows and "slider fluorine vent frequency | all" did not move.engine.wasmis rebuilt: 648,605 to 650,689 bytes.fmw-wasm'sthe_all_view_is_terrain_plus_both_overlaysnow treats the rewrite as part of the shared base ofall,resourcesandrocks. A plantedallwithout wells and a plantedallwithout icebergs each turn it red.Planted breaks
Each was run through the rebuilt module, the Rust rule tests and
test/wasmAquiloRenderParity.spec.ts, then reverted:rocksonlysnow-patchyrocksonlysnow-patchyice-smoothStated gaps
ice-roughandice-smoothshare a map colour, so no pixel test can tell them apart. Only the Rust tests, which grade by tile name, catch anice-smoothring.rocksalone, becauseallandresourcespaint the well over it.Cost
WASM under Node, the 1024 window as 64 tiles of 128 summed on one thread, High, median of 7 interleaved runs,
mainagainst this branch:all5,409 vs 5,478 ms,resources5,474 vs 5,475 ms,rocks5,482 vs 5,411 ms. The ranges overlap in every row, andterrain, whose code did not change, moved more (2,676 vs 2,882 ms), so the differences are noise.Verify
pnpm run verifyexits 0 locally on this commit, every phase run:vp check,check:vue,vp test(121 files, 1,532 passed, 3 skipped),preview:test(27 passed), andverify:rust(fmt, clippy, doc, cargo test, the anti-vacuity check, zero dependencies,engine.wasmmatches its source,cargo deny).docs/rust-wasm-port.mdhas the full tables in a new section, "Aquilo's well tile rewrite".🤖 Generated with Claude Code
https://claude.ai/code/session_01Kd6o1d3a5zQDRDok3ePdHh
Summary by CodeRabbit