LVRS Document Viewer
architecture/performance-observability.svx
Path: architecture/performance-observability.svx
Performance Observability (P0)
Location: backend/io/backend.* / backend/runtime/renderingmonitor.*
This document defines the P0 performance telemetry contract used by LVRS.
Purpose
- Establish one shared metrics schema for CPU/GPU-adjacent runtime telemetry.
- Provide per-request async timeline traces for queue/start/finish analysis.
- Keep sampling overhead bounded and predictable for debug builds.
Schemas
1) Snapshot Schema: lvrs.performance.v1
Used by:
Backend.performanceMetrics()RenderMonitor.performanceSnapshot()
Common required fields:
schemacomponentepochMs
Backend-specific fields:
asyncJobsInFlightasyncMaxConcurrencyasyncIoMaxConcurrencyasyncUtilityMaxConcurrencyasyncRenderMaxConcurrencyasyncQueueDepthasyncQueuePeakDepthasyncQueueDepthLimitasyncBackpressureDropCountasyncMergedRequestCountasyncCanceledRequestCountperformanceTraceCountperformanceTraceCapacityreadTextCacheTtlMsreadTextCacheCapacityBytesreadTextCacheBytesreadTextCacheEntryCountasyncLaneMetricsasyncLatencyByOperation(avg/p50/p95/p99/max/failureRate)
RenderMonitor-specific fields:
activefpslastFrameMsavgFrameMsp95FrameMsp99FrameMsframeCountdroppedFrameCountdroppedFrameThresholdMsrecentSampleCountframeSampleCapacity
2) Timeline Trace Schema: lvrs.performance.trace.v1
Used by:
Backend.recentPerformanceTrace()
Required fields:
schemasequence(monotonic in-process)epochMsphase(queued,started,finished,canceled)requestIdoperationsubjectdetail(phase-specific map)
Timeline Semantics
queued: request accepted andrequestIdassigned.started: worker thread started actual task body.finished: task completed and completion signal was emitted.canceled: cancellation token was requested.
Expected order per request:
queuedstarted(may be absent for immediate-fast path)finished
Overhead Policy
- Trace retention is bounded by
performanceTraceCapacity. - Latency samples are bounded per operation (
m_asyncLatencySampleCapacity). - Render percentiles are bounded by rolling sample capacity (
frameSampleCapacity).
Operational Usage
- Capture
Backend.performanceMetrics()andRenderMonitor.performanceSnapshot()together for a measurement window. - Export
Backend.recentPerformanceTrace()for queue/wait bottleneck analysis. - Compare p95/p99 across revisions, not only averages.
P4 Quality Gate Integration
P4 automated quality gate consumes this schema through:
tests/tst_performance_gate.cpp(p95/p99 regression check),tests/ci/run_p4_quality.sh(PR gate entrypoint),tests/ci/run_p4_sanitizers.sh(sanitizer matrix with the same metrics contract).