CLI: compare runtime shader failures with offline coverage #1625

Open
github-bot wants to merge 3 commits from github-bot/gh-1625 into main AGit
Owner

@⁠srijann07 on GitHub · 2026-11-24 19:55 UTC · original
srijann07:tools/runtime-shader-coverage → main · +362 −0 · 3 files · 3 commits · open

Summary

Related to #1579.

Adds a shader-coverage CLI command to compare runtime shader translation failures against offline emission results.

Changes

  • Deduplicates runtime shader failures by hash.
  • Identifies offline emitted, failed and unmatched shaders.
  • Groups runtime translation failures by reason.
  • Adds four synthetic regression tests and README documentation.
  • No new dependencies or runtime rendering changes.

Usage

victory shader-coverage <runtime.log> [paths...]

Verification

  • Workspace tests: 346 passed, 0 failed, 6 ignored.
  • All four new regression tests passed.
  • Standard and diagnostics Clippy checks passed.
  • Asset policy passed.

Windows CI results:
https://github.com/srijann07/VIctory/actions/runs/45473262548

Limitations

Unmatched hashes do not prove shader absence. Offline emission does not guarantee DXIL validation or successful GPU execution.

No actual title run was performed. Zero game assets included.

AI-assisted.

**@⁠srijann07** on GitHub · 2026-11-24 19:55 UTC · [original](https://github.com/Marvisak/VIctory/pull/1625) `srijann07:tools/runtime-shader-coverage` → `main` · +362 −0 · 3 files · 3 commits · open ## Summary Related to #1579. Adds a `shader-coverage` CLI command to compare runtime shader translation failures against offline emission results. ## Changes - Deduplicates runtime shader failures by hash. - Identifies offline emitted, failed and unmatched shaders. - Groups runtime translation failures by reason. - Adds four synthetic regression tests and README documentation. - No new dependencies or runtime rendering changes. ## Usage `victory shader-coverage <runtime.log> [paths...]` ## Verification - Workspace tests: 346 passed, 0 failed, 6 ignored. - All four new regression tests passed. - Standard and diagnostics Clippy checks passed. - Asset policy passed. Windows CI results: https://github.com/srijann07/VIctory/actions/runs/45473262548 ## Limitations Unmatched hashes do not prove shader absence. Offline emission does not guarantee DXIL validation or successful GPU execution. No actual title run was performed. Zero game assets included. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:38:42 +00:00
github-bot force-pushed github-bot/gh-1625 from c7455da099 to 50b237a60b 2026-11-26 06:32:11 +00:00 Compare
Author
Owner

@⁠srijann07 on GitHub · 2026-11-24 20:18 UTC · original

Thanks for the review, @⁠catminou4!

I've added four dedicated unit tests for "plain", "reason", and "failures" in commit 1460a85, covering the parsing edge cases you suggested.

All four new tests passed, along with the full workspace test suite (350 passed, 0 failed) and both Clippy checks.

Windows CI: https://github.com/srijann07/VIctory/actions/runs/45478941041

I'd appreciate another look when you have time. Thanks!

**@⁠srijann07** on GitHub · 2026-11-24 20:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/1625#issuecomment-7143353840) Thanks for the review, @⁠catminou4! I've added four dedicated unit tests for "plain", "reason", and "failures" in commit 1460a85, covering the parsing edge cases you suggested. All four new tests passed, along with the full workspace test suite (350 passed, 0 failed) and both Clippy checks. Windows CI: https://github.com/srijann07/VIctory/actions/runs/45478941041 I'd appreciate another look when you have time. Thanks!
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:32 UTC · original · edited 2026-11-26 07:21 UTC

Automated triage for the maintainers.

Merge candidate (as before the conflict). Thanks for the rebase onto 63bcca4. The main.rs change now only registers ShaderCoverage and dispatches it to coverage::run.

What I checked in apps/victory/src/coverage.rs: failures matches the exact warning victory_gpu::pipeline logs in Shader::translated, which is shader does not translate; its pipelines' draws are dropped, with fields hash= and error= followed by cached=/ms=. It strips the cached= suffix. The hash is the same blake3(..)[..16] that pipeline.rs uses. Only containers whose hash was asked for are translated, and nothing is written. It reuses shader::sources/MAX_FILE, adds no dependencies, and the README addition is one line. The tests cover the parsing edge cases and an actual translator failure.

CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/1625#issuecomment-7149665434) · edited 2026-11-26 07:21 UTC <!-- victory-triage v1 head=50b237a60b00cb8f925bcdd2baec98f6bd85da36 verdict=merge-candidate at=2026-11-26T07:21:29Z --> Automated triage for the maintainers. **Merge candidate** (as before the conflict). Thanks for the rebase onto `63bcca4`. The `main.rs` change now only registers `ShaderCoverage` and dispatches it to `coverage::run`. What I checked in `apps/victory/src/coverage.rs`: `failures` matches the exact warning `victory_gpu::pipeline` logs in `Shader::translated`, which is `shader does not translate; its pipelines' draws are dropped`, with fields `hash=` and `error=` followed by `cached=`/`ms=`. It strips the `cached=` suffix. The hash is the same `blake3(..)[..16]` that `pipeline.rs` uses. Only containers whose hash was asked for are translated, and nothing is written. It reuses `shader::sources`/`MAX_FILE`, adds no dependencies, and the README addition is one line. The tests cover the parsing edge cases and an actual translator failure. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠srijann07 on GitHub · 2026-11-25 06:09 UTC · original

Rebased onto upstream main (940d32f), resolved the README conflict and preserved the additional parsing tests. Fresh Windows CI and both Clippy configurations passed.

CI: https://github.com/srijann07/VIctory/actions/runs/45557227927

Ready for re-review. Thanks!

**@⁠srijann07** on GitHub · 2026-11-25 06:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/1625#issuecomment-7154506070) Rebased onto upstream main (940d32f), resolved the README conflict and preserved the additional parsing tests. Fresh Windows CI and both Clippy configurations passed. CI: https://github.com/srijann07/VIctory/actions/runs/45557227927 Ready for re-review. Thanks!
Author
Owner

@⁠srijann07 on GitHub · 2026-11-25 07:12 UTC · original

Thanks for identifying the parsing issue!

  • Fixed error extraction to exclude trailing cache and timing metadata.
  • Added regression tests using realistic runtime log fields, including quoted stage names and varying timings.
  • Verified that identical failure reasons remain grouped correctly.
  • Shortened the README documentation.

Fresh Windows CI, regression tests and both Clippy configurations passed.

https://github.com/srijann07/VIctory/actions/runs/45565441242

Ready for re-review. Thanks!

**@⁠srijann07** on GitHub · 2026-11-25 07:12 UTC · [original](https://github.com/Marvisak/VIctory/pull/1625#issuecomment-7155602574) Thanks for identifying the parsing issue! - Fixed error extraction to exclude trailing cache and timing metadata. - Added regression tests using realistic runtime log fields, including quoted stage names and varying timings. - Verified that identical failure reasons remain grouped correctly. - Shortened the README documentation. Fresh Windows CI, regression tests and both Clippy configurations passed. https://github.com/srijann07/VIctory/actions/runs/45565441242 Ready for re-review. Thanks!
Author
Owner

@⁠srijann07 on GitHub · 2026-11-26 06:27 UTC · original

Rebased onto latest upstream main (63bcca4) and resolved the conflict in main.rs. All existing regression tests are preserved, and fresh Windows CI passed.

CI: https://github.com/srijann07/VIctory/actions/runs/45767881219

Ready for re-review. Thanks!

**@⁠srijann07** on GitHub · 2026-11-26 06:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/1625#issuecomment-7184455480) Rebased onto latest upstream main (`63bcca4`) and resolved the conflict in `main.rs`. All existing regression tests are preserved, and fresh Windows CI passed. CI: https://github.com/srijann07/VIctory/actions/runs/45767881219 Ready for re-review. Thanks!
Author
Owner

@⁠catminou4 on GitHub · 2026-11-24 20:06 UTC · original · reviewed

Static review only: victory-gpu/victory-hle/apps are Windows-only (D3D12/windows_sys), so nothing here compiles or runs on macOS — please rely on the Windows CI leg.

shader-coverage compares runtime translation failures from a log against an offline scan: dedups 16-hex hashes, groups reasons by unsupported operation (stripping the GFX10 code at 0x… prefix), replays only matching byte extents through emit, and reports emitted/failed/unmatched counts. Privacy-conscious like list-diff (hashes and reasons only, no shader bytes; README documents keeping logs outside the repo). The CSI-stripping and hash validation are careful. Pure logic but the crate is Windows-only, so untested here — consider #[cfg(test)] unit tests for plain/reason/failures parsing edge cases (they're platform-independent).

**@⁠catminou4** on GitHub · 2026-11-24 20:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/1625#pullrequestreview-6046506730) · **reviewed** Static review only: victory-gpu/victory-hle/apps are Windows-only (D3D12/windows_sys), so nothing here compiles or runs on macOS — please rely on the Windows CI leg. `shader-coverage` compares runtime translation failures from a log against an offline scan: dedups 16-hex hashes, groups reasons by unsupported operation (stripping the `GFX10 code at 0x…` prefix), replays only matching byte extents through `emit`, and reports emitted/failed/unmatched counts. Privacy-conscious like `list-diff` (hashes and reasons only, no shader bytes; README documents keeping logs outside the repo). The CSI-stripping and hash validation are careful. Pure logic but the crate is Windows-only, so untested here — consider `#[cfg(test)]` unit tests for `plain`/`reason`/`failures` parsing edge cases (they're platform-independent).
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 18:02 UTC · original · approved these changes

Looks good. Verified merged onto main (63bcca43) on Windows 11:

  • cargo xtask policy (192 files ok), cargo clippy --locked -p victory --all-targets -- -D warnings (default and --all-features), and all 27 tests in victory (including all 9 new coverage::tests::* cases) pass.
  • Verified end-to-end against real ANSI-colored UTF-8 stderr output produced by victory_core::logging::init using the exact tracing::warn! call from crates/victory-gpu/src/pipeline.rs:139-148: victory shader-coverage stripped the CSI sequences, parsed the hash and GFX10 code at 0x... reason cleanly (1 record, 1 unique hash, 0 malformed rows).
  • Also verified UTF-8 BOM + CRLF logs, duplicate hash deduplication across offsets, raw standalone / padded standalone / offset-embedded synthetic DXBC containers, missing scan paths, empty logs, non-UTF-8 logs (exits 1 with the UTF-8 guidance), and missing log files.

(Non-blocking note: runtime crates/victory-gpu/src/shader_cache.rs:87-88 and apps/victory/src/translate.rs:571-572 both translate with emit::Options { view_marks: true }, whereas apps/victory/src/coverage.rs:198 calls emit::translate(b) (view_marks: false). View-mark lowering is currently infallible so pass/fail results match, though switching to emit::translate_with(b, emit::Options { view_marks: true }) would keep offline comparison strictly matched to runtime settings going forward.)

**@⁠fuzeofficlal** on GitHub · 2026-11-26 18:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/1625#pullrequestreview-6078732938) · **approved these changes** Looks good. Verified merged onto `main` (`63bcca43`) on Windows 11: - `cargo xtask policy` (`192 files ok`), `cargo clippy --locked -p victory --all-targets -- -D warnings` (default and `--all-features`), and all 27 tests in `victory` (including all 9 new `coverage::tests::*` cases) pass. - Verified end-to-end against real ANSI-colored UTF-8 stderr output produced by `victory_core::logging::init` using the exact `tracing::warn!` call from `crates/victory-gpu/src/pipeline.rs:139-148`: `victory shader-coverage` stripped the CSI sequences, parsed the hash and `GFX10 code at 0x...` reason cleanly (`1` record, `1` unique hash, `0` malformed rows). - Also verified UTF-8 BOM + CRLF logs, duplicate hash deduplication across offsets, raw standalone / padded standalone / offset-embedded synthetic DXBC containers, missing scan paths, empty logs, non-UTF-8 logs (exits 1 with the UTF-8 guidance), and missing log files. (Non-blocking note: runtime `crates/victory-gpu/src/shader_cache.rs:87-88` and `apps/victory/src/translate.rs:571-572` both translate with `emit::Options { view_marks: true }`, whereas `apps/victory/src/coverage.rs:198` calls `emit::translate(b)` (`view_marks: false`). View-mark lowering is currently infallible so pass/fail results match, though switching to `emit::translate_with(b, emit::Options { view_marks: true })` would keep offline comparison strictly matched to runtime settings going forward.)
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1625/head:github-bot/gh-1625'
git switch 'github-bot/gh-1625'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1625'
git switch 'github-bot/gh-1625'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1625'
git switch 'github-bot/gh-1625'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1625'
git switch 'main'
git merge --squash 'github-bot/gh-1625'
git switch 'main'
git merge --ff-only 'github-bot/gh-1625'
git switch 'main'
git merge 'github-bot/gh-1625'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1625
No description provided.