Files
XZBT/docs/evidence/phase4/2026-09-06-phase4f-execution.md
T
LabyricornandClaude Opus 5 a579b8e41f feat(visual): implement the slice 4f execution, automation, and post-effects
Visual automation in both of its scopes — exhibit-scope tracks measured from
activation and system-scope tracks measured from an instance's own
instantiation, so a track written against spawn-relative time behaves the same
whether the spawn happens at four seconds or at four minutes — together with the
spawned-system lifecycle, the camera, and the seven post-effects of 19.4.

Automation on a missing target object now raises ERR_INVALID_REFERENCE rather
than an unguarded TypeError, per 19.1. Post-effect channel math is clamped
explicitly before assignment and the device blur radius is capped against a
pixel budget, so a large projected radius cannot turn a legal exhibit into a
frame-long stall. Trail fade tapers per segment from the item's own head opacity
to the tail factor, which is what 18.8 describes; the previous flat alpha
ignored the item's ramped opacity entirely. The canvas backend consumes the
per-object buffer grants the engine allocates, rasterizing a buffered node once
and compositing it once under its own blend and alpha, rather than compositing
fill, stroke, glow, and filter separately and double-blending the overlap. Glow
is drawn as a halo around the result rather than painted over it, and text now
gets the glow branch it was silently missing.

Traces 19.7.3 and 19.7.4 are implemented as specified rather than approximated:
the two-spawn four-second offset assertion, and the four negative target cases
that separate ERR_INVALID_REFERENCE from ERR_UNSUPPORTED_TARGET.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01ShxxFqFmCUDQnQvFNm4TKy
2026-09-06 21:53:28 +00:00

3.6 KiB

Slice 4f: automation, lifecycle, effects and ceilings

Implemented September 6, 2026. Production integration is in visual-engine.js, visual-automation.js, visual-lifecycle.js, visual-effects.js, visual-subsystem.js, the shared resolver and action executor.

Automation uses the audio interpolation implementation and adds visual repeat/ping-pong time folding. Public numeric visual targets enter the existing binding/automation/override/modulation/clamp stages. Internal graphic and procedural channels remain private. Tracks resolve once in scope order, including independent spawn scope sampling; behavior collisions reject at import. Viewport camera defaults continue to participate in the pipeline.

Spawn and remove actions use PRD 28's target, with, optional lifetime, and instances.* addressing. Instances enter the layer on their next tick, retain independent resource-owner and originating-scenario relationships, fade without rewriting authored opacity, and reclaim tracks and item state at disposal/failure. Instance, track and point budget refusal is atomic and does not consume an ordinal. Runtime failure is isolated to its system. Scenario orchestration remains Phase 6; its cleanup integration surface is VisualEngine.cleanup(owner).

All seven effects execute against frame pixels in authored order. Grain has no access to seeded streams. Blur/bloom use a separable approximation and report it once per effect. Unavailable effects skip with a diagnostic. The specification's stray sentence exposing boolean enabled conflicted with the four-family numeric target table; it now explicitly follows that table and remains once-resolved.

Aggregate particle, emitter, trail, link and field budgets enforce the section 19.5 shedding rules. Field work is ordered nearest-first; particle/item eviction chooses the largest population and its oldest item. Existing buffer/backing-store enforcement and new effect pass and spawn/automation admission use centralized values. Diagnostic accounting counts logical ticks rather than repeated refusals in a tick.

test/phase4-execution.test.mjs adds twenty execution tests: curves/modes, loops, shared override release, sampling order, lifecycle edges, zero release, ownership/forced cleanup, atomic budgets, actions, known effect pixels and order, stream independence, unavailable effects, diagnostic recovery, population/history/link/field overloads, resolved count limits and failure isolation. Existing camera/projection and structural validation tests remain in the renderer/contract suites.

No hardware performance result is claimed. Ceiling values and frame-time governance thresholds remain provisional until 4h. Post-effect pixel checks establish operation, not perceptual equivalence on a real display. No live audio acceptance or full scenario execution is claimed.

Final verification

All 223 checks pass across fourteen test files, including the twelve GC2 fixture checks and 109 Phase 4 tests. The sandbox blocks Node's default child-process test isolation (spawn EPERM), so each file was run separately with node --test --test-isolation=none. Running GC2 in the same process as other suites is insufficient because its legacy runner exits the process; the separate invocations avoid silently skipping later tests.

Production and acceptance build determinism and bundled JavaScript syntax pass; git diff --check is clean. Generated artifact SHA-256 values:

  • XZBT.html: 46619d8ff2fbadf188136409d5cfe658bf5492ba0ba111d58ad488e95b343770
  • prototypes/phase4/XZBT-visual-acceptance.html: 4298121998e7532f0824139c48ccab6b8c022ccf6a8079cf3672cded4bc6db74