--- id: PLN-0093 ticket: vm-render-parallel-execution-boundary title: Add Render Telemetry Counters and Events status: open created: 2026-06-05 ref_decisions: [DEC-0031] tags: [runtime, renderer, telemetry, diagnostics] --- ## Briefing `DEC-0031` requires render drops, repeats, stale discards, render errors, and present errors to be observable without becoming VM semantics. ## Objective Add the minimum render telemetry surface required for asynchronous render diagnostics and certification. ## Dependencies - Source decision: `DEC-0031`. - `PLN-0089` and `PLN-0092` provide main event sources. ## Scope - Add minimum counters and last-frame IDs from `DEC-0031`. - Add event recording hooks for handoff, consume, present, repeat, stale discard, errors, and shutdown discard. - Expose telemetry through existing runtime/host diagnostics patterns. - Ensure VM program behavior cannot observe telemetry as render ACK. ## Non-Goals - Do not build a UI profiler. - Do not add VM syscalls for present ACK. - Do not define host-specific logging formats beyond necessary hooks. ## Execution Method 1. Locate current telemetry facilities and atomic counter patterns. 2. Add render telemetry structure with counters and last IDs. 3. Wire replacement-before-consume from handoff. 4. Wire consumed/presented/repeated from consumer path. 5. Wire stale epoch and shutdown discards. 6. Wire render/present error reporting. 7. Add read-only diagnostics access for host/debug tooling. ## Acceptance Criteria - All minimum counters and IDs from `DEC-0031` exist. - Latest-wins replacement is measurable. - Repeated presents and stale epoch discards are measurable. - Telemetry is not a blocking ACK path for the VM. ## Tests - Unit tests for counter increments. - Handoff replacement telemetry test. - Stale epoch discard telemetry test. - Error path telemetry test where render/present errors can be simulated. ## Affected Artifacts - Runtime telemetry modules. - `RenderManager`. - Render handoff and publication paths. - Host/debug telemetry readers.