Repository navigation
feat: stateful combustion and multi-window torch - #3
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
It introduces substantial new rendering and capture-path behavior (new Metal compute pipelines, shadow alignment, and multi-session coordination) where correctness/performance regressions are difficult to validate without full runtime review.
Pull request overview
This PR expands WindowBurn’s burn simulation and rendering pipeline to support stateful combustion (moisture/heat/fuel/damage) and multi-window Torch sessions, while improving visual handoff from the native window to the overlay (captured shadow + atomic replacement activation). It also bumps the app version to 0.3.0 and updates documentation/tests to reflect the new behavior.
Changes:
- Add a CPU-side combustion model + a GPU combustion-state field (compute pipeline) that drives steam/scorch/material visibility.
- Introduce multi-window Torch session tracking (up to 4 concurrent windows) with routing of clicks to the most recently registered overlapping session.
- Capture and align the native window shadow and add an explicit “handoff prepared / replacement active” flow to avoid visible window pop during close.
File summaries
| File | Description |
|---|---|
| Tests/WindowBurnCoreTests/TorchBurnTests.swift | Adds coverage for multi-window Torch session routing, removal, and capacity limits. |
| Tests/WindowBurnCoreTests/SoakAndBurnTests.swift | Adds a regression test for atomic handoff coverage before closing the native window. |
| Tests/WindowBurnCoreTests/GeometryTests.swift | Adds tests for shadow alignment, replacement activation, and rounded-corner masking. |
| Tests/WindowBurnCoreTests/CombustionModelTests.swift | New test suite validating combustion state stepping and visual response behavior. |
| Tests/WindowBurnCoreTests/BurnVisualProfileTests.swift | Adds constraints for new radial contour parameters. |
| Support/Info.plist | Bumps version to 0.3.0 (bundle version to 3). |
| Sources/WindowBurnCore/TorchBurn.swift | Adds TorchWindowSessionRegistry to manage up to 4 concurrent Torch window sessions. |
| Sources/WindowBurnCore/SoakAndBurn.swift | Adds isHandoffPrepared to source coverage to ensure full coverage during handoff. |
| Sources/WindowBurnCore/CombustionModel.swift | Introduces stateful combustion model + visual response helpers. |
| Sources/WindowBurnCore/BurnVisualProfile.swift | Adds radial contour warp/bite parameters and wires them into .cinematic. |
| Sources/WindowBurnCore/BurnGeometry.swift | Adds OverlayDepthModel for shadow sampling offset, shadow opacity, rounded-rect distance helpers. |
| Sources/WindowBurn/WindowCaptureService.swift | Captures an aligned native shadow image and computes a sampling offset. |
| Sources/WindowBurn/BurnRenderer.swift | Adds combustion compute pipelines/textures, radial edge shaping, steam rendering, replacement shadow compositing, and pipeline caching. |
| Sources/WindowBurn/BurnOverlayController.swift | Adds replacement/handoff controls, optional delayed start, and threads through shadow + corner radius inputs. |
| Sources/WindowBurn/BurnCoordinator.swift | Refactors Torch mode into per-window sessions + registry; adds atomic replacement activation before closing windows. |
| README.md | Updates Torch mode documentation to describe up to 4 windows / 8 ignition points each. |
Review details
- Files reviewed: 16/18 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
Verification
swift format lint --strict --recursive Package.swift Sources Testsswift test(74 tests)swift build -c release --arch arm64 --arch x86_64