Repository navigation
VICTORY_SHADER_DIAG: structured per-pipeline classification logging - #376
ZaneIceMaster11 wants to merge 1 commit into
Conversation
…ation Every existing shader/pipeline failure path already had its own ad hoc tracing::warn!/info! (shader translation, root signature, mesh/graphics/ compute pipeline creation, the depth-bounds-test and rectangle-geometry-stage shortcuts, the two unimplemented device methods at vtable slots 0x1c8/0x218). That's fine for watching a live log, but there was no single, structured, greppable place to answer "why doesn't this draw look right" across a whole run - which is exactly what's needed to chase reports of low-poly models and shaders not rendering: is a given pipeline hitting missing-shader, a refused root signature or PSO, a dropped partial-support shortcut, or the device- method gap, and how often. VICTORY_SHADER_DIAG=<dir> (new, crates/victory-gpu/src/shader_diag.rs, diagnostics-feature-gated like capture.rs/copystat.rs) appends one JSONL record per classification to <dir>/shader-diag.jsonl: a classification (ok/missing-shader/root-signature-refused/mesh-pipeline-refused/ pipeline-refused/rect-gs-fallback/depth-bounds-unsupported/state-not-kept/ device-method-unimplemented), the shaders involved (stage + content hash, same hash VICTORY_SHADER_SAVE and crash reports use), and whatever detail was already on hand at that call site - the graphics state's existing describe() (input layout, render target/depth formats, blend, rasterizer) on success, the host's rejection error on failure. Every hook sits next to an existing tracing call and reuses its data; nothing new is computed only for this. Off by default, zero cost when unset (the env var is read once via OnceLock and short-circuits). Also documents VICTORY_KEYBOARD_PAD in the README (added on another branch, not yet merged) and fixes a crash::tests::unwinds_like_the_system_walk-class regression gate issue: cherry-picked the .gitignore fix from that same branch since this branch needed it too for the policy test to pass. Verified: cargo build --release --workspace and --profile diag --features diagnostics both clean. cargo clippy --workspace --all-targets --release, with and without the diagnostics feature, both clean, 0 warnings. cargo test --workspace: green except the two already-documented flaky tests (state/findings/flaky-tests.md), both confirmed still at their established rates, neither new. Found and ruled out as a false lead while verifying: cargo test -p victory-gpu --features diagnostics occasionally crashes (STATUS_ACCESS_VIOLATION) under parallel test execution. Reproduced on the unmodified code too (1/5 runs) and on this change (1/6 runs across two batches) - statistically the same pre-existing rate, not caused by this change. Documented as a third known-flaky pattern, same root cause class as victory-shader's already-documented "two GPU tests at once on WARP can end the test process with an access violation". Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Built this locally (release, Run: Windows 11 x64, RTX 5070 Ti, 34,192 records: Two things that stood out:
Small suggestion, from actually grepping the output: when Repro details and the full comparison (dropped draws, GPU idle, switch effects) are in #394. |
Why
Every shader/pipeline failure path already had its own ad hoc
tracing::warn!/info!(shader translation, root signature, mesh/graphics/compute pipeline creation, the depth-bounds-test and rectangle-geometry-stage shortcuts, the two unimplemented device methods at vtable slots0x1c8/0x218). Fine for watching a live log, but there was no single, structured, greppable place to answer "why doesn't this draw look right" across a whole run - needed to chase reports of low-poly models and shaders not rendering.What
VICTORY_SHADER_DIAG=<dir>(new,crates/victory-gpu/src/shader_diag.rs, diagnostics-feature-gated likecapture.rs/copystat.rs) appends one JSONL record per classification to<dir>/shader-diag.jsonl: a classification (ok/missing-shader/root-signature-refused/mesh-pipeline-refused/pipeline-refused/rect-gs-fallback/depth-bounds-unsupported/state-not-kept/device-method-unimplemented), the shaders involved (stage + content hash - the same hashVICTORY_SHADER_SAVEand crash reports use), and whatever detail was already on hand at that call site - the graphics state's existingdescribe()(input layout, RT/depth formats, blend, rasterizer) on success, the host's rejection error on failure. Every hook sits next to an existing tracing call and reuses its data. Off by default, zero cost when unset.Verification
cargo build --release --workspaceand--profile diag --features diagnosticsboth clean.cargo clippy --workspace --all-targets --release, with and without thediagnosticsfeature, both clean, 0 warnings.cargo test --workspace: green except two already-documented flaky tests, both confirmed at their established rates.cargo test -p victory-gpu --features diagnosticsoccasionally crashes (STATUS_ACCESS_VIOLATION) under parallel execution. Reproduced on unmodifiedmaintoo (1/5 runs) and on this change (1/6 runs) - statistically the same pre-existing rate, not caused by this change. Same root-cause class asvictory-shader's already-documented GPU-test concurrency flakiness.Co-authored with Claude Code (Claude Sonnet 5).