Skip to content

Wire the Vulcanus volcanism sliders into the preview render request - #401

Merged
wormeyman merged 1 commit into
mainfrom
wire-vulcanus-volcanism
Sep 7, 2026
Merged

Wire the Vulcanus volcanism sliders into the preview render request#401
wormeyman merged 1 commit into
mainfrom
wire-vulcanus-volcanism

Conversation

@wormeyman

@wormeyman wormeyman commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

The "Vulcanus volcanism" slider on the Terrain tab did nothing on the preview. The engine has read both levers since #225, and the field sweep in test/wasmVulcanusParity.spec.ts moves them, but the request layer wrote a literal 1 for each. Every render spec stayed green because 1 is the value that hides it: slider_rescale(1, 3) is exactly 1, so both terms vanish at the default. This is the Fulgora islands gap again.

What changed

  • elevationCtxFromPreset reads autoplaceControls.vulcanus_volcanism, defaulting to 1/1 like the Fulgora islands pair.
  • The panel passes it as vulcanusVolcanismControls on the render request.
  • renderVulcanusThroughWasm reads it with ?? 1 in place of the two literals.

No Rust changed and engine.wasm is untouched. All 26 frozen vulcanus:render rows still match. They pass no volcanism field, so they are the guard that a default render did not move.

The spec, and the window trap it hit

test/vulcanusVolcanismDispatch.spec.ts plants a moved slider and asserts the bytes change. The first draft stayed red after the wiring was in. It graded on the parity spec's square at origin window, 64 tiles across at 1 tile per pixel, and that whole square sits inside the starting area, where the volcano spots are excluded and the mountain noise is flattened. Pixels moved when a lever is taken off 1, measured on the wired code:

window frequency 2 size 3
square at origin, 1 tile/px 0 / 4096 0 / 4096
wide, offset, 1 tile/px 1828 / 2304 1813 / 2304
tall, coarse, 8 tiles/px 1583 / 2304 698 / 2304
fine, far field, 0.5 tiles/px 1214 / 1536 1300 / 1536

A spec on the origin window passes a hardcoded 1, which is the defect it exists to catch. The spec now grades on the wide, offset window, holds the neutral render there to that window's frozen tier-3 row, and keeps the origin window as a control frozen at zero. If that control ever moves, volcanism has started reaching the starting area, which would be a finding about the engine.

Why now

#84's remaining residual (21 wrong orientations, 22 surplus, 6 missing of 1569 cliffs) needs a lever that moves the elevation input to the cliff rule while holding the rule, the collision tests and the ore rule fixed. Volcanism is that lever, and until this change the preview could not exercise it. This PR only wires the slider. The sweep itself is a separate decision.

Gate: pnpm run verify green locally (see the commit).

🤖 Generated with Claude Code

https://claude.ai/code/session_01EadT1PyhSjDbjJwvLfo3zr

Summary by CodeRabbit

  • New Features

    • Vulcanus elevation previews now reflect configured volcanism frequency and size settings from the selected preset.
    • When these settings are not specified, previews use neutral default values for consistent results.
  • Tests

    • Added coverage verifying preset values, default behavior, terrain and cliff rendering, and preservation of unaffected starting-area behavior.

The engine has read volcanismFrequency and volcanismSize since phase 5
(#225), and wasmVulcanusParity.spec.ts sweeps both moved. But
renderVulcanusThroughWasm wrote a literal 1 for each, so the Terrain
tab's "Vulcanus volcanism" slider did nothing on the preview while every
render spec stayed green. Same gap the Fulgora islands pair had, for the
same reason: slider_rescale(1, 3) is exactly 1, so at the default both
terms vanish and a render that ignores the control looks right.

elevationCtxFromPreset now reads autoplaceControls.vulcanus_volcanism
(default 1/1), the panel passes it as vulcanusVolcanismControls, and the
dispatch reads it with `?? 1`. No Rust changed, so engine.wasm is
untouched, and all 26 frozen vulcanus:render rows still match. They pass
no volcanism field, so they are the default-unchanged guard.

test/vulcanusVolcanismDispatch.spec.ts plants a moved slider. Its first
draft stayed red AFTER the wiring, because it graded on the parity spec's
"square at origin" window, 64 tiles across at 1 tile/px, which sits
entirely inside the starting area where volcanism reaches nothing: 0 of
4096 pixels move for either lever. On the "wide, offset" window 1828 of
2304 move for frequency 2 and 1813 for size 3. The spec keeps the origin
window as a control frozen at zero, and holds the neutral render on the
wide window to that window's frozen tier-3 row.

Why now: #84's remaining residual (21 wrong orientations, 22 surplus, 6
missing of 1569) needs a lever that moves the elevation input to the
cliff rule while holding the rule fixed. Volcanism is that lever, and the
preview could not exercise it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EadT1PyhSjDbjJwvLfo3zr
@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 83922e23-d650-432a-a632-3aac80ab3f23

📥 Commits

Reviewing files that changed from the base of the PR and between ab55bc6 and 46930ac.

📒 Files selected for processing (6)
  • src/components/ElevationPreviewPanel.vue
  • src/model/elevationPreviewCtx.ts
  • src/noise/preview/elevationRenderRequest.ts
  • test/elevationPreviewCtx.spec.ts
  • test/elevationPreviewPanel.spec.ts
  • test/vulcanusVolcanismDispatch.spec.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Vulcanus volcanism frequency and size controls now flow from presets into elevation preview render requests and Vulcanus WASM rendering. Tests cover defaults, configured values, terrain and cliffs output, frozen compatibility, and the origin window.

Changes

Vulcanus volcanism controls

Layer / File(s) Summary
Extract preset volcanism controls
src/model/elevationPreviewCtx.ts, test/elevationPreviewCtx.spec.ts
ElevationPreviewCtx reads vulcanus_volcanism frequency and size values and defaults both to 1.
Forward controls to Vulcanus rendering
src/noise/preview/elevationRenderRequest.ts, src/components/ElevationPreviewPanel.vue, test/elevationPreviewPanel.spec.ts
Preview generation passes the controls to ElevationRenderRequest, which forwards them to Vulcanus WASM rendering.
Validate render behavior
test/vulcanusVolcanismDispatch.spec.ts
Tests cover configured controls, neutral defaults, frozen output compatibility, cliffs rendering, and the unchanged origin window.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 46930

Vulcanus preview renders now reflect preset volcanism frequency and size settings while preserving neutral behavior when controls are absent. The change is ready to merge.

Sequence Diagram(s)

sequenceDiagram
  participant Preset
  participant ElevationPreviewCtx
  participant ElevationPreviewPanel
  participant ElevationRenderRequest
  participant VulcanusWASM
  Preset->>ElevationPreviewCtx: provide vulcanus_volcanism controls
  ElevationPreviewCtx->>ElevationPreviewPanel: expose frequency and size
  ElevationPreviewPanel->>ElevationRenderRequest: include vulcanusVolcanismControls
  ElevationRenderRequest->>VulcanusWASM: dispatch frequency and size
  VulcanusWASM-->>ElevationPreviewPanel: render elevation preview
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 5 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
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: connecting Vulcanus volcanism slider values to preview render requests.
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 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 5 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wire-vulcanus-volcanism

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

@wormeyman
wormeyman merged commit 1ac40af into main Sep 7, 2026
11 checks passed
@wormeyman
wormeyman deleted the wire-vulcanus-volcanism branch September 7, 2026 23:11
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