7.2 KiB
Scene Diagnostics Schema
This document defines the preferred conceptual schema for diagnostics across the active scene layer.
It unifies diagnostics emitted by validation, capability adaptation, frame planning, and runtime execution.
Normative Status
This document is normative at the conceptual schema level.
It is not normative for:
- final struct names,
- final enum names,
- final memory ownership conventions in C.
Core Rule
All scene-facing diagnostics should preserve scene meaning first and backend detail second.
That means diagnostics should answer:
- what failed,
- at which semantic phase it failed,
- which scene-visible object or plan artifact it concerns,
- whether the condition is fatal, recoverable, or advisory.
Diagnostic Record
The preferred conceptual unit is one DiagnosticRecord.
Each record should contain at least:
severityphasecategorycodemessagesubject_kindsubject_idscope- optional related identities
- optional contextual payload
Severity
The preferred severity set is:
FatalRecoverableWarningInfo
Fatal means the relevant stage cannot proceed.
Phase
The preferred phase set is:
ValidationCapabilityAdaptationFramePlanningRuntimeSubmissionRuntimeCompletion
This phase field should let the reader understand where the failure or advisory originated without guessing from the text message.
Category
Useful category groups include:
StructureResourceTransformMappingPickingAnnotationCapabilityPlanTopologyReadbackRuntimeExecution
Subject Kind
The preferred subject-kind set is:
ScenePanelVisualResourceAxisAnnotationLegendColorbarScaleMappingFramePlanPlanNodeRuntimeService
Scope
Diagnostics should report the smallest correct affected scope.
Useful scope values include:
GlobalScenePanelVisualResourcePlanNodeRequest
Related Identities
One failure often concerns more than one object.
The schema should therefore allow optional related identities such as:
- panel plus visual,
- visual plus resource,
- colorbar plus mapping,
- plan node plus target,
- runtime completion plus originating request.
Contextual Payload
The schema should allow optional structured or semi-structured context such as:
- requested capability versus available capability,
- expected resource kind versus actual kind,
- requested format versus supported formats,
- stale request generation versus accepted generation,
- chosen adaptation outcome.
This payload should remain scene-readable and should not require backend handles to interpret.
Record Shape By Phase
Validation
Validation diagnostics should typically emphasize:
- structural or semantic subject identity,
- missing or incompatible dependencies,
- whether planning is blocked.
Capability Adaptation
Capability-adaptation diagnostics should typically emphasize:
- preferred semantic path,
- capability mismatch,
- chosen explicit fallback, simplification, or deactivation outcome.
Frame Planning
Planning diagnostics should typically emphasize:
- plan node or topology problem,
- unresolved dependency,
- unsupported target or stage arrangement.
Runtime Submission
Runtime-submission diagnostics should typically emphasize:
- the submitted scene-level
FramePlan, - the affected plan node, target, or resource identity,
- acceptance versus rejection at submission time.
Runtime Completion
Completion diagnostics should typically emphasize:
- originating request or target identity,
- completion kind,
- freshness or discardability state when relevant.
DRP2 Error Code Mapping
DRP2 error codes (DRP2_ERR_*) are protocol-level identifiers that belong below the scene
semantic layer. From the scene's perspective they are non-normative; the scene does not surface
DRP2 error code constants to users.
When a DRP2 execution failure occurs, the runtime maps it to a DiagnosticRecord with:
- phase:
RuntimeSubmission(if the error is detected at submission time) orRuntimeCompletion(if detected during readback or completion routing), - category:
RuntimeExecution, - subject_kind:
RuntimeService, - severity:
Fatalfor submission rejection;Recoverableif the scene can retry or fall back;Warningfor non-blocking protocol-level anomalies.
The DRP2 error code may appear in the contextual_payload field for diagnostics tooling, but
it must not be the primary user-visible error identifier — the scene-visible message should
describe the affected plan node, resource, or target in scene terms.
Diagnostics Aggregation
The preferred aggregation unit is one DiagnosticReport.
A report should contain:
- the phase or phases covered,
- one or more
DiagnosticRecorditems, - a summary result such as success, degraded success, recoverable failure, or fatal failure.
The active compact DvzDiagnosticReport stores severity alongside each message. Existing
dvz_diagnostic_report_add() calls remain fatal by default; callers use an explicit severity for
adaptation outcomes. A host must reject fatal or recoverable diagnostics, but warning-only and
info-only reports are degraded success and must not suppress an otherwise valid frame artifact.
Agent-Repairable Diagnostics
Diagnostics should be specific enough for a coding agent to repair generated user code without guessing which API contract was violated.
An agent-repairable diagnostic should include:
- a stable diagnostic code;
- a scene-level subject kind and identity;
- severity and phase;
- expected versus actual values when applicable;
- a concise message;
- an actionable hint when there is a preferred fix;
- backend detail only as optional context.
Preferred shape:
code=SCENE_VISUAL_MISSING_POSITION
severity=Fatal
phase=Validation
subject_kind=Visual
subject_id=visual:point:17
message=Point visual requires position data before rendering.
hint=Bind the position attribute before submitting the frame.
context.expected=position attribute with item_count > 0
context.actual=missing
Do not make agents infer a scene error from only an assertion file/line, Vulkan handle, shader binding number, or DRP2 runtime code when a scene-level explanation is available.
Diagnostic wording should prefer current public API concepts. If a message tells the user to call a function or set a property, that name should match installed headers or clearly marked future API specs.
Interaction With Existing Scene Docs
This schema should be used by:
validation/VALIDATION.mdvalidation/ADAPTATION.mdpipeline/FRAME_PLAN.mdcore/RUNTIME_BOUNDARY.md
Those documents may define additional phase-specific rules, but they should reuse this common diagnostic shape.
Implementation Pressure
If implementation work begins, the schema most naturally pressures the codebase toward:
- one shared diagnostic record type,
- one shared phase enum,
- one shared subject-kind enum,
- one shared report container used across scene and runtime-facing validation paths.