Skip to content

Bake: one place for plants' materials; the circuit's grass and woods sway; circuit refuses land of its own - #78

Merged
SamG-Coder merged 4 commits into
mainfrom
claude/maint-bake
Nov 12, 2026
Merged

SamG-Coder merged 4 commits into
mainfrom
claude/maint-bake

Conversation

@SamG-Coder

@SamG-Coder SamG-Coder commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

What and why

Part of a maintenance pass over the engine. It covers two loose ends from earlier reviews of circuits (#64) and some duplication left by the Cove's land (#72, #73).

  • One place for plants. The woods in land.rs and circuit.rs were the same thirty lines, and forest.rs built the same bark, leaf and blade materials a third time. They now live in apps/bake/src/foliage.rs:
    • grow() puts a wood's species into a scene;
    • Grown::place() places one copy;
    • bark(), leaves() and blades() make the materials, each flagged to sway.
  • The circuit's grass and woods sway. Its copies had never been given SWAYS, or TREE for trees, so its verge grass and woods stood still in any wind. This is a deliberate visible change, for circuit scenes only.
  • circuit refuses land of the file's own. A scene file with both terrain and circuit built both, one inside the other, and the terrain's heights won as the ground cars drive on. land, path, yard, clear, meadow, wood and water lines beside a circuit were silently dropped. Each is now an error at the line that brings the two together, before anything is imported.
  • bake --only without --plants (or --species/--grass) was silently ignored. It is now an error. This is a follow-up from the review of Ponds in scene files, mirror reflections, willows and old oaks #75.

Verified

  • Cove and Forest baked from this branch are byte-identical (sha1) to the same scenes baked from main, so the refactor changes nothing there.

  • New tests:

    • the circuit's verge grass sways as grass;
    • Grown::place picks the copy and order;
    • every plant material sways, and only trees sway as trees;
    • a circuit with a terrain, or with a wood line after it, is refused at the right line.

    The new tests were mutation-checked.

  • cargo test --workspace --release passes. fmt and clippy (-D warnings) are clean natively and for both wasm32 builds.

  • The renderer is untouched. The pass's shared before/after numbers follow.

Measured in Chrome on the RTX 5080

Main (8731867) against this pass's three branches merged together (#77, #78, #79), on the same scene files, each config run back to back. GPU time is the sum of every pass's timestamps per frame (a profiler injected into the page adds timestampWrites to each pass), averaged over 250 to 500 frames after streaming settles. Fixed view: ?time=12:00&day-length=0&weather=fair, default camera.

Config main GPU ms after GPU ms
Cove, High, 1280×720 2.356 2.324
Cove, High, 2560×1440 5.066 5.096
Forest, High, 1280×720 2.685 2.695
Forest, High, 2560×1440 (two runs each) 7.30, 7.53 7.41, 7.04
Temple, High, 1280×720 2.127 2.100
Temple, High, 2560×1440 4.787 4.818
Cove, Low, ?limits=webgpu 1.788 1.690
Forest, Low, ?limits=webgpu 1.586 1.556
Temple, Low, ?limits=webgpu 1.439 1.407
Forest, High, 720p, storm with the sun moving 2.838 2.904
  • Run-to-run noise is about 1–2% at 720p and about ±2.5% at 1440p in Forest, so every row is unchanged. None of these changes touches a per-frame path, so none was expected to change cost.
  • CPU per frame (the page's whole animation-frame tick) is 0.15–0.3 ms on both sides wherever the GPU keeps up.
  • Rendered output is unchanged. I captured native frames with --no-taa. Every after-vs-main PSNR falls inside main's own run-to-run spread, for example Temple 54–58 dB against 55.5–56.7 dB, and Cove storm 60.6–61.1 dB against 60.4 dB.
  • Found along the way (no change made): the steady frame is about 20 passes, one submit, 26 small buffer writes, and no per-frame bind groups or buffers. At 1440p in Forest, screen gi splits into integrate 1.04 ms (its occlusion search is 0.27 ms of that), reflections 0.67 ms and trace 0.55 ms.

Authorship

Written by: Claude Opus 5.5 through Claude Code

Reviewed by: Claude Sonnet 5.5. Approved with no correctness issues. It confirmed:

  • the land and circuit refactors keep every push to meshes, textures, materials and instances in the same order;
  • the RNG and hash calls are unchanged;
  • copy % variants matches both callers' old arithmetic;
  • only solstice-render/src/scene.rs reads SWAYS and TREE, so nothing else in these scenes depended on the old flags.

Fixed from its points:

  • The terrain check ran after every model was imported. Land lines beside a circuit were dropped silently. Both are now refused as soon as they are read.

  • foliage.rs had no tests of its own. It now has two.

  • All code, text and comments in this pull request were written by a frontier AI model, with no human-written code, and will be reviewed by a frontier AI model before merging, as the Code of Conduct requires.

🤖 Generated with Claude Code

SamG-Coder and others added 3 commits November 13, 2026 07:46
…sway; circuit and terrain refuse each other

The woods in land.rs and circuit.rs were the same thirty lines, and forest.rs
made the same bark, leaf and blade materials again. They are now in
foliage.rs: grow() puts a wood's species into a scene, Grown::place() an
instance of one, and bark(), leaves() and blades() make the materials.

The circuit's copies had never been given the sway flags, so its verge
grass and its woods stood still in any wind. Through the shared materials
they now sway as the cove's and the forest's do.

A scene file with both terrain and circuit built both, one inside the other,
and the terrain's heights won as the ground cars drive on. It is now an
error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s for foliage

From review: the terrain check came after every model was imported, and
land, path, yard, clear, meadow, wood and water lines were silently dropped
beside a circuit too. Each is now refused at the line that brings the two
together, before anything is imported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A follow-up from the review of #75.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	apps/bake/src/scene_file.rs
@SamG-Coder
SamG-Coder merged commit c668c75 into main Nov 12, 2026
1 check passed
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