Skip to content

Gleba: the pentapod nests, placed as a real surface places them - #587

Merged
wormeyman merged 2 commits into
mainfrom
gleba-nests
Nov 28, 2026
Merged

wormeyman merged 2 commits into
mainfrom
gleba-nests

Conversation

@wormeyman

Copy link
Copy Markdown
Collaborator

Gleba slice 6: the pentapod nests, placed as a real surface places them (#454)

The enemies view now draws every gleba-spawner and gleba-spawner-small a real Gleba surface places, and all draws them with everything else. Every entity view places them, because a nest in one chunk blocks plants in the next. Gleba stays dev-only.

Over the 1024 window at seed 123456, every control at its default (the map a player gets):

  • nests: 67 of 67 at the game's position to the 1/256 tile, no extras (30 large, 37 small)
  • cliffs: 2,484 of 2,484, unchanged
  • everything else: 35,225 of 35,227, no extras. The two misses are the plants that survived stone's tree-removal roll, the same two the cliffs arm has.

What it took

  • Tier 1. enemy_base_probability is the Nauvis EnemyBaseField, unchanged, with its frequency control doubled, because Gleba's frequency formula is exactly twice Nauvis's. It and 10 other fields match calculate_tile_properties at 1,280 of 1,280 positions. The two nest probabilities match at 1,131 of 1,131 where random_penalty cannot change the value. The other 149 depend on how calculate_tile_properties batches, which was not measured, so the replay grades those.
  • The penalty is a per-chunk batch. enemy_autoplace_base(0, 8) is a random_penalty over the chunk's 1,024 tiles, row-major, at (x + 8, y). That is the layout Vulcanus's solid ore proved in Reproduce the Vulcanus solid-ore random_penalty roll (#84) #437.
  • The small nest occupies its collision box. Apply tests a new entity's map-gen box against the collision boxes already on the surface. The small nest's map-gen box (+-2.35) is larger than its collision box (+-1.35). If it kept the larger box, it would block two copper stromatolites the game keeps, and the replay would lose 5 nests.
  • Size 0 drops a control's autoplacers, except stone. prepareAutoplacers drops an autoplacer whose own control is at size 0. The plants and nests carry a control. Stone and the stromatolites carry none. Measured with scratch captures:
    • plants at size 0: 77 of 77 nests with the plant groups skipped, 0 of 77 with them run
    • stone at size 0: 67 of 67 with stone's group run, 11 of 67 with it skipped
    • enemy control at size 0: no nests, where running the groups would place 27
  • Paint. The nests have no map_color. They paint (255, 25, 25), which is what the game's own preview PNG uses (its default_enemy_color), over the collision box.
  • ABI. The Gleba block grows from 72 to 88 bytes (the request from 128 to 144) for the gleba_enemy_base frequency and size, appended at the end. The Gleba views are now terrain, trees, cliffs, resources, enemies and all.

Grades

test frozen
gleba_nest_fields_match_the_game 11 fields 1,280 of 1,280 (the live enemy-base bucket 1,130 of 1,130); nest probabilities 1,131 of 1,131, 149 not graded
gleba_nests_replay_the_real_surface (three 128 windows) nests 1, 6 and 2 exact; cliffs and other entities exact
gleba_nest_replay_controls the small nest holding its map-gen box: 181 of 183 others
gleba_nests_whole_window (ignored, release) cliffs 2,484/2,484; nests 67/67; others 35,225/35,227
wasmGlebaEntityParity.spec.ts, enemies view 0 tiles differ; 1,456 nest pixels
same, all view 5 tiles (the stingfrond, as on the cliffs arm)
same, trees / resources 10 tiles (the stingfrond and sunnycomb) / 0
same, enemy control at size 0 the terrain
tiled renders (100 px and the app's 256 px) stitch byte for byte, nests on

The nest field and replay tests are in POISONED_TESTS. Both fail under --features poison.

Planted breaks

Each one was planted and the Gleba tests were run against it. All of these went red: the penalty at x + 0, the penalty's seed at 0, no penalty, a column-major batch, the frequency not doubled, no distance > 350, the starting-enemies term dropped, the small group before the large one, the nests before stone, the small nest keeping its map-gen box, nests blocking nothing, and the nest groups running at enemy size 0.

These are gaps, stated here:

  • Running the plant groups at plants size 0 is caught only by the facts test's pin of gleba_groups. The game measurement for that rule, and for stone's group still running at size 0, is a check by hand against scratch captures.
  • Using the f64 0.1 for the amplitude instead of f32(0.1) stays green.
  • Changing the green mask from aux > 0.375 to >= stays green.

Cost

The app's own preview, Gleba at seed 123456, headless Chrome with no DevTools client, median of 7 runs against the branch point d69e8bc:

  • terrain: 524 -> 527 ms, no change
  • all: 1,011 -> 1,082 ms (+7%)

engine.wasm grows from 554,359 to 560,416 bytes against current main (8da30ca), rebuilt after merging main in. The timings above were taken before that merge; the merge touched only Aquilo and TS panel code.

Not changed

The Nauvis enemy code is untouched. The Nauvis parity specs and frozen counts pass unchanged.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kd6o1d34pJNr7M9RVWCV2c

wormeyman and others added 2 commits November 27, 2026 21:03
Slice 6. The enemies view draws every gleba-spawner and
gleba-spawner-small a real Gleba surface places, and every entity view
places them, because a nest in one chunk blocks plants in the next. Over
the 1024 window at seed 123456 with every control at its default: 67 of
67 nests at the game's position and nothing else, 2,484 of 2,484 cliffs,
and 35,225 of 35,227 other entities with no extras (the two plants stone's
tree-removal roll spared).

- enemy_base_probability is the Nauvis EnemyBaseField, unchanged, with
  its frequency doubled (Gleba's formula is exactly twice Nauvis's); it
  and 10 other fields match the game at 1,280 of 1,280 positions, and the
  two nest probabilities at 1,131 of 1,131 where the penalty cannot
  matter.
- enemy_autoplace_base's random_penalty is one batch per chunk, row-major
  at (x + 8, y), evaluated the first time a nest asks.
- The small nest occupies its +-1.35 collision box once placed; the apply
  step tests a new entity's map-gen box against those.
- A control at size 0 drops its autoplacers (plants, nests) and their
  draws; stone carries no control and still draws. Measured with scratch
  captures; the autoplacer facts test now pins each one's control.
- New real-surface fixture (FMW_ARM=nests) with its provenance; the
  probe gains FMW_PLANTS_SIZE and FMW_STONE_SIZE. The ABI's Gleba block
  grows 72 -> 88 bytes for the gleba_enemy_base control.
- engine.wasm 548,809 -> 554,919 bytes. Render cost in the app: all
  1,011 -> 1,082 ms (+7%), terrain unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kd6o1d34pJNr7M9RVWCV2c
Rebuilt engine.wasm with scripts/build-wasm.sh after the Aquilo and Gleba Rust changes met.

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

coderabbitai Bot commented Nov 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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 27 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

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: dfaef0ca-0b96-4a9a-96ed-2ccfe009e83e
Commits

Reviewing files that changed from the base of the PR and between 8da30ca and 030eb96.

Files ignored due to path filters: 1

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

  • crates/fmw-noise/src/expressions/gleba_nests.rs
  • crates/fmw-noise/src/expressions/gleba_resources.rs
  • crates/fmw-noise/src/expressions/gleba_stack.rs
  • crates/fmw-noise/src/expressions/gleba_starting.rs
  • crates/fmw-noise/src/expressions/gleba_terrain.rs
  • crates/fmw-noise/src/expressions/mod.rs
  • crates/fmw-noise/src/fixtures.rs
  • crates/fmw-noise/src/fixtures/gleba_cliffs.rs
  • crates/fmw-noise/src/fixtures/gleba_entities.rs
  • crates/fmw-noise/src/fixtures/gleba_nests.rs
  • crates/fmw-noise/src/fixtures/gleba_plants.rs
  • crates/fmw-noise/src/placement/gleba.rs
  • crates/fmw-wasm/src/abi.rs
  • crates/fmw-wasm/src/lib.rs
  • crates/fmw-wasm/src/render.rs
  • docs/noise/entity-generation-NOTES.md
  • docs/rust-wasm-port.md
  • scripts/probes/gleba-entities/README.md
  • scripts/probes/gleba-entities/capture.ts
  • scripts/verify-rust.sh
  • src/model/planetCapabilities.ts
  • src/model/resourceReads.ts
  • src/noise/preview/elevationRenderRequest.ts
  • src/noise/wasm/request.ts
  • test/elevationPreviewPanel.spec.ts
  • test/elevationRenderRequest.spec.ts
  • test/fixtures/PROVENANCE.json
  • test/fixtures/oracle-gleba-real-surface-nests.seed123456.json
  • test/fixtures/verify-wasm-request.py
  • test/fixtures/wasm-request.v2.json
  • test/wasmFulgoraRenderParity.spec.ts
  • test/wasmGlebaEntityParity.spec.ts
  • 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

@claude

claude Bot commented Nov 28, 2026

Copy link
Copy Markdown

Code review

No high-signal issues found. This was a light pass over the Rust nest expression module and the stack/resource plumbing in the diff. I did not run the multi-agent review or go through the generated fixtures, the wasm binary or the docs, so this is not a full check for bugs and CLAUDE.md compliance.

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