VICTORY_SHADER_DIAG: structured per-pipeline classification logging #376
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!376
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-376"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ZaneIceMaster11 on GitHub · 2026-11-25 00:09 UTC · original
ZaneIceMaster11:feature/shader-diag→main· +148 −14 · 6 files · 1 commits · openWhy
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).
@BTekV4 on GitHub · 2026-11-25 00:20 UTC · original
Built this locally (release,
--features diagnostics) and ran it on a full prologue pass. It works as advertised and it is exactly the tool that was missing for this kind of report — thanks.Run: Windows 11 x64, RTX 5070 Ti,
2119b0e+ the open PRs merged (#340 #341 #343 #344 #345 #346 #347 #348 #349 #353 #354 #357 #358 #359 #376 #377),VICTORY_SHADER_DIAG=<dir>, ~2.5 minutes through the prologue.34,192 records:
device-method-unimplemented28,139 ·ok5,774 ·depth-bounds-unsupported224 ·missing-shader44 ·pipeline-refused10 ·mesh-pipeline-refused1.Two things that stood out:
0x1c8is hit 25,450 times and0x2182,689 times in one run, i.e. ~82% of all records. If either is on a per-draw or per-copy path, that is worth a look on its own (they are also invisible in the plain log, which only warns once per call site).missing-shadersplits cleanly by translation error, and the hashes line up with the rawshader does not translatelines: 15a lane mask exchanged where not every lane runs, 15a whole-wave section step the simulation does not follow, 7a descriptor read only as data(pixel), 3v_cvt_f32_f64, 2the first half of an interpolation(pixel), 1a descriptor's address or format read as data, 1a first-lane read where not every lane runs. Per-hash lists in #394.Small suggestion, from actually grepping the output: when
detailcarries a slot number, adding the resolved method name (even just the D3D12 interface the vtable belongs to, e.g.ID3D12Device12) would make that class actionable without a debugger. A monotonically increasingcalls=counter is already there and helps; a per-slot total at exit would help more.Repro details and the full comparison (dropped draws, GPU idle, switch effects) are in #394.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.