Add Fulgora scrap's placement roll to the engine (#363) - #370
Merged
Conversation
PR 1 of 2. The engine can now decide where scrap is PLACED, not only where it could land. Nothing calls it yet - the render arm, the ABI fields and the dispatcher gate are PR 2. ## #363's premise was wrong, and that is what this PR is for The issue says both halves of Fulgora's `"all"` composite already exist in Rust. They do not. `VIEW_SCRAP_FOOTPRINT` paints every tile where `probability > 0`, and its own doc comment at `render.rs:72` says that is deliberate: a rolled overlay would measure the salt rather than the model. The TypeScript composite at `elevationRenderRequest.ts:681` paints `makeFulgoraScrapPlacement`, which is a real `PlacementSet` roll. So a byte-identical port needs placement code the engine did not have. ## What lands | | | | --- | --- | | `placement::roll::salt::FULGORA_SCRAP` | `0x003ba58c`, the same value as `PLACEMENT_SALT.fulgoraScrap` in `src/noise/placement/placementRoll.ts` | | `resources::fulgora_catalog` | ported from `src/noise/resources/fulgoraResourceCatalog.ts`: the map colour, the collision box and `FulgoraScrapPlacement` | | `render.rs` | reads `SCRAP_MAP_COLOR` from that module instead of keeping its own `[229, 229, 229]` | The salt module's doc claimed only the two Vulcanus salts were present, which had already expired. The table is now all nine the TypeScript has, and says so. Two copies of a map colour with nothing comparing them is the shape #364 removed for the Vulcanus cliff tiles, so the second copy goes rather than gaining a sibling. ## Measured 128x128 window at the origin, seed 123456, neutral sliders, by `places_a_strict_nonempty_subset_of_the_footprint`: **708 of 16,384 tiles are in the footprint and 177 are placed**, so the roll accepts 25.0% of it. Substituting one view for the other would move 531 pixels in that window. ## engine.wasm: the code section is BYTE-IDENTICAL The module stays 321,381 bytes, and 51 bytes change. Walking the section table puts **all 51 in the data section and none in the code section** - they are panic-location line numbers, which moved because `render.rs` and `roll.rs` each gained lines above existing code. Building the HEAD `render.rs` against the new `fmw-noise` isolates it further: 3 bytes, all from `roll.rs`'s own line shift. The new placement module contributes nothing, because nothing reaches it yet and dead-code elimination removes it. It starts costing bytes in PR 2, when the render arm calls it. ## Anti-vacuity `places_a_strict_nonempty_subset_of_the_footprint` is added to `verify-rust.sh`'s poison set and was **watched going red**, not assumed to: the perturbation inverts every accept and placements go from 177 to 16,207 of 16,384, tripping the test's upper bound. Its sibling `the_collision_box_cannot_reject_anything` is deliberately left OUT. Both of its arms run through the same poisoned `resolve_chunk`, so the effect cancels and it stays green - the relational shape `poison.rs` records for the capture-grid snap test. Listing it would fail the gate for being correct. That second test also earns its place: the collision box is 0.1953125 tiles and cannot reject anything, which looks like an oversight unless something asserts it. The TypeScript passes the same inert box and `test/fulgoraScrapDensity.spec.ts` makes the same assertion on that side. ## Gate `scripts/verify-rust.sh`, `VERIFY_RC=0`, read out of `/home/eric/gate-logs/363a-rust.log` rather than from a wrapper's exit code. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR 1 of 2 for #363. The engine can now decide where Fulgora scrap is PLACED,
not only where it could land. Nothing calls it yet - the render arm, the ABI
fields and the dispatcher gate are PR 2.
#363's premise was wrong, and that is what this PR is for
The issue says both halves of Fulgora's
"all"composite already exist in Rust.They do not.
VIEW_SCRAP_FOOTPRINTpaints every tile whereprobability > 0,and its own doc comment at
render.rs:72says that is deliberate: a rolledoverlay would measure the salt rather than the model. The TypeScript composite
at
elevationRenderRequest.ts:681paintsmakeFulgoraScrapPlacement, which isa real
PlacementSetroll. So a byte-identical port needs placement code theengine did not have.
What lands
placement::roll::salt::FULGORA_SCRAP0x003ba58c, the same value asPLACEMENT_SALT.fulgoraScrapinsrc/noise/placement/placementRoll.tsresources::fulgora_catalogsrc/noise/resources/fulgoraResourceCatalog.ts: the map colour, the collision box andFulgoraScrapPlacementrender.rsSCRAP_MAP_COLORfrom that module instead of keeping its own[229, 229, 229]The salt module's doc claimed only the two Vulcanus salts were present, which
had already expired. The table is now all nine the TypeScript has, and says so.
Two copies of a map colour with nothing comparing them is the shape #364 removed
for the Vulcanus cliff tiles, so the second copy goes rather than gaining a
sibling.
Measured
128x128 window at the origin, seed 123456, neutral sliders, by
places_a_strict_nonempty_subset_of_the_footprint: 708 of 16,384 tiles are inthe footprint and 177 are placed, so the roll accepts 25.0% of it.
Substituting one view for the other would move 531 pixels in that window.
engine.wasm: the code section is BYTE-IDENTICAL
The module stays 321,381 bytes, and 51 bytes change. Walking the section table
puts all 51 in the data section and none in the code section. They are
panic-location line numbers, which moved because
render.rsandroll.rseachgained lines above existing code.
Building the
mainrender.rsagainst the newfmw-noiseisolates it further:3 bytes, all from
roll.rs's own line shift. The new placement modulecontributes nothing, because nothing reaches it yet and dead-code elimination
removes it. It starts costing bytes in PR 2, when the render arm calls it.
Anti-vacuity
places_a_strict_nonempty_subset_of_the_footprintis added toverify-rust.sh's poison set and was watched going red, not assumed to: theperturbation inverts every accept and placements go from 177 to 16,207 of
16,384, tripping the test's upper bound.
Its sibling
the_collision_box_cannot_reject_anythingis deliberately left OUT.Both of its arms run through the same poisoned
resolve_chunk, so the effectcancels and it stays green - the relational shape
poison.rsrecords for thecapture-grid snap test. Listing it would fail the gate for being correct.
That second test also earns its place: the collision box is 0.1953125 tiles and
cannot reject anything, which looks like an oversight unless something asserts
it. The TypeScript passes the same inert box and
test/fulgoraScrapDensity.spec.tsmakes the same assertion on that side.Gates
scripts/verify-rust.shVERIFY_RC=0pnpm run verifyVERIFY_RC=0, 9m41s, 162 test files, 1,589 passed, 3 skippedBoth exit codes were written into their logs and read back from there, not taken
from a wrapper's exit code.
What PR 2 does
The scrap params over the ABI, a Fulgora composite arm in
render_fulgora, thesupportedmatch atrender.rs:236, the dispatcher gate atelevationRenderRequest.ts:646, and a spec asserting the engine's composite isbyte-identical to the TypeScript's. Fulgora's
"resources"and"all"are thesame pixels today, since the planet has no cliffs and no rocks, so one arm
serves both codes.