CLI: replay selected runtime shader hashes in offline translation #1114

Open
Razdva122 wants to merge 5 commits from upstream-pr/1114 into main
Razdva122 commented 2026-11-24 15:49:26 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Razdva122 on 2026-11-24T15:49:26Z.


GPU reports such as #1062 identify a failing pipeline by a 16-digit shader hash. This adds an exact hash filter to the offline translator, so someone with a local archive can replay the named shaders and see the source locations and translation outcomes.

victory translate path/to/archive --shader-hash 0123456789abcdef --list --validate

The command accepts repeated options or comma-separated hashes. It scans raw DXBC containers and compressed SGD5 records, then runs translation and optional validation/pipeline checks for the matches. A selected container with no native shader programs now gets a listing entry with its location, hash and the reason translation produced no output. It reports all missing requests after printing the matches. Scanning and decompression are still necessary. The full-cache warm-up mode rejects the hash filter.

The runtime hashes the supplied bytecode length. The scan tests the declared DXBC extent and, when available, the complete standalone file or unpacked record, which can include padding. At an interior raw file offset, only the declared extent is known.

PR #378 adds hashes to full listings. This contribution targets replay of known hashes and leaves the unfiltered census behavior intact. In-process tests exercise the CLI parser, scanner, translator and missing-hash check with synthetic inputs. They cover padded bytecode, identical DXIL in different containers, duplicates, malformed hashes and missing matches. The tests use the existing workspace dependencies.

An independent tester found and validated all 21 hashes from a live WARP startup on the earlier revision 89f3d3c using the archive and executable together. Test report

AI-assisted with Codex.

Windows CI passed both workspace Clippy configurations and the full workspace test suite at 4e4dc36. Windows job

<!-- greyfinch-sync:Marvisak/VIctory:issue:5475530961 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1114). Originally posted by [Razdva122](https://github.com/Razdva122) on 2026-11-24T15:49:26Z. --- GPU reports such as #1062 identify a failing pipeline by a 16-digit shader hash. This adds an exact hash filter to the offline translator, so someone with a local archive can replay the named shaders and see the source locations and translation outcomes. ```text victory translate path/to/archive --shader-hash 0123456789abcdef --list --validate ``` The command accepts repeated options or comma-separated hashes. It scans raw DXBC containers and compressed SGD5 records, then runs translation and optional validation/pipeline checks for the matches. A selected container with no native shader programs now gets a listing entry with its location, hash and the reason translation produced no output. It reports all missing requests after printing the matches. Scanning and decompression are still necessary. The full-cache warm-up mode rejects the hash filter. The runtime hashes the supplied bytecode length. The scan tests the declared DXBC extent and, when available, the complete standalone file or unpacked record, which can include padding. At an interior raw file offset, only the declared extent is known. PR #378 adds hashes to full listings. This contribution targets replay of known hashes and leaves the unfiltered census behavior intact. In-process tests exercise the CLI parser, scanner, translator and missing-hash check with synthetic inputs. They cover padded bytecode, identical DXIL in different containers, duplicates, malformed hashes and missing matches. The tests use the existing workspace dependencies. An independent tester found and validated all 21 hashes from a live WARP startup on the earlier revision `89f3d3c` using the archive and executable together. [Test report](https://github.com/Marvisak/VIctory/pull/1114#issuecomment-7137330469) AI-assisted with Codex. Windows CI passed both workspace Clippy configurations and the full workspace test suite at `4e4dc36`. [Windows job](https://github.com/Marvisak/VIctory/actions/runs/46117071712/job/140893167149)
SkillIssueXO commented 2026-11-24 17:04:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by SkillIssueXO on 2026-11-24T16:13:59Z.


Verified with the Xbox Series X 1.0.2.1 title on Windows 11 using PR head 89f3d3c and the SDK’s dxil.dll 1.9.2602.17.

  • I took 21 unique first bind hashes from a live WARP startup on main ffe310e. translate --shader-hash … --list --validate found 19 in shaders.rpf. Adding game_scarlett_master.exe recovered both remaining hashes, 06295fb1d1aefb78 and dfafaf385b2f94e8. All 21 validated (18 vertex/pixel, 3 compute). The archive-only run returned exit 1 and listed those two misses. The expanded input returned exit 0.
  • The four culling hashes from #71 (fdd56d97a806bcca, 17af15c4015cb4b6, 55679a0547649d0b, 89d08e561897d4e5) and both hashes from #1119 (535f8a954d8ec638, eb47e845b2cb0eba) all matched in shaders.rpf. All six are compute. DXIL emission stopped on unknown structured-buffer stride for five, and on an untracked select mask for eb47e845b2cb0eba. The per-hash locations and outcomes agreed between --jobs 1 and --jobs 8. Adding a deliberately absent hash kept the six results and returned exit 1 for that hash.

This verifies the replay and input coverage against the title. DXIL validation was offline. AI-assisted (Codex).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7137330469 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1114#issuecomment-7137330469). Originally posted by [SkillIssueXO](https://github.com/SkillIssueXO) on 2026-11-24T16:13:59Z. --- **Verified with the Xbox Series X 1.0.2.1 title on Windows 11** using PR head `89f3d3c` and the SDK’s `dxil.dll` `1.9.2602.17`. - I took 21 unique `first bind` hashes from a live WARP startup on `main` `ffe310e`. `translate --shader-hash … --list --validate` found 19 in `shaders.rpf`. Adding `game_scarlett_master.exe` recovered both remaining hashes, `06295fb1d1aefb78` and `dfafaf385b2f94e8`. All 21 validated (18 vertex/pixel, 3 compute). The archive-only run returned exit 1 and listed those two misses. The expanded input returned exit 0. - The four culling hashes from #71 (`fdd56d97a806bcca`, `17af15c4015cb4b6`, `55679a0547649d0b`, `89d08e561897d4e5`) and both hashes from #1119 (`535f8a954d8ec638`, `eb47e845b2cb0eba`) all matched in `shaders.rpf`. All six are compute. DXIL emission stopped on unknown structured-buffer stride for five, and on an untracked select mask for `eb47e845b2cb0eba`. The per-hash locations and outcomes agreed between `--jobs 1` and `--jobs 8`. Adding a deliberately absent hash kept the six results and returned exit 1 for that hash. This verifies the replay and input coverage against the title. DXIL validation was offline. AI-assisted (Codex).
Zipettte commented 2026-11-24 18:06:15 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T18:01:42Z.


Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 89f3d3c: cargo test -p victory -p victory-shader passes, 125 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7140052043 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1114#issuecomment-7140052043). Originally posted by [Zipettte](https://github.com/Zipettte) on 2026-11-24T18:01:42Z. --- Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 89f3d3c: `cargo test -p victory -p victory-shader` passes, 125 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Marvisak commented 2026-11-25 01:08:06 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:35:39Z.


Automated triage for the maintainers.

Needs rebase. This PR no longer merges cleanly into main: main has moved since the last triage, and the branch now conflicts in README.md and apps/victory/src/main.rs. It will be reviewed again once it is rebased onto current main.

Previous verdict for this head: merge candidate.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148674082 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1114#issuecomment-7148674082). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:35:39Z. --- <!-- victory-triage v1 head=651cc2ac1a3563bc691f5a782b3b5434647f97f9 verdict=needs-rebase at=2026-11-25T22:32:00Z --> Automated triage for the maintainers. **Needs rebase.** This PR no longer merges cleanly into `main`: `main` has moved since the last triage, and the branch now conflicts in `README.md` and `apps/victory/src/main.rs`. It will be reviewed again once it is rebased onto current `main`. Previous verdict for this head: merge candidate. --- _Generated by [Claude Code](https://claude.ai/code)_
Razdva122 commented 2026-11-25 07:03:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Razdva122 on 2026-11-25T06:55:43Z.


@Marvisak, could you re-review 651cc2a and update the triage: needs work label if this addresses the earlier review?

The CLI tests now exercise the parser, scanner and translator in process. The dependency manifests and lockfile match main, and the README example takes three lines. Both Clippy configurations and the full workspace test suite passed on Windows. Changes since triage · Windows CI

<!-- greyfinch-sync:Marvisak/VIctory:comment:7155304689 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1114#issuecomment-7155304689). Originally posted by [Razdva122](https://github.com/Razdva122) on 2026-11-25T06:55:43Z. --- @Marvisak, could you re-review `651cc2a` and update the `triage: needs work` label if this addresses the earlier review? The CLI tests now exercise the parser, scanner and translator in process. The dependency manifests and lockfile match main, and the README example takes three lines. Both Clippy configurations and the full workspace test suite passed on Windows. [Changes since triage](https://github.com/Marvisak/VIctory/compare/f8259a9311915651416f7b1083b7d3762b3ae09c...651cc2ac1a3563bc691f5a782b3b5434647f97f9) · [Windows CI](https://github.com/Razdva122/VIctory/actions/runs/45563398704/job/139032272079)
Razdva122 commented 2026-11-26 13:04:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Razdva122 on 2026-11-26T12:28:30Z.


Could you re-review the shader replay change at 10c92dc and refresh the rebase label? The branch now merges cleanly with main at 63bcca4. The rebase keeps the new nonzero worker-count check, and the two shader fixtures added on main now supply the declared length of an empty DXBC header. Both Clippy configurations and the full workspace suite passed on Windows. CI results

<!-- greyfinch-sync:Marvisak/VIctory:comment:7192047921 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1114#issuecomment-7192047921). Originally posted by [Razdva122](https://github.com/Razdva122) on 2026-11-26T12:28:30Z. --- Could you re-review the shader replay change at `10c92dc` and refresh the rebase label? The branch now merges cleanly with `main` at `63bcca4`. The rebase keeps the new nonzero worker-count check, and the two shader fixtures added on main now supply the declared length of an empty DXBC header. Both Clippy configurations and the full workspace suite passed on Windows. [CI results](https://github.com/Marvisak/VIctory/actions/runs/45819247420/job/139906891783)
Razdva122 commented 2026-11-28 06:37:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Razdva122 on 2026-11-28T06:37:29Z.


@Marvisak, could you re-review the shader hash replay at 4e4dc36 and remove triage: needs rebase? GitHub reports a clean merge with main at 63bcca4. The latest commit fixes a silent result from --list when the requested hash matches a container with no native shader programs. The new regression test, the full workspace suite and both Clippy configurations passed on Windows. Windows CI

<!-- greyfinch-sync:Marvisak/VIctory:comment:7235415132 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1114#issuecomment-7235415132). Originally posted by [Razdva122](https://github.com/Razdva122) on 2026-11-28T06:37:29Z. --- @Marvisak, could you re-review the shader hash replay at `4e4dc36` and remove `triage: needs rebase`? GitHub reports a clean merge with `main` at `63bcca4`. The latest commit fixes a silent result from `--list` when the requested hash matches a container with no native shader programs. The new regression test, the full workspace suite and both Clippy configurations passed on Windows. [Windows CI](https://github.com/Marvisak/VIctory/actions/runs/46117071712/job/140893167149)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1114:upstream-pr/1114'
git switch 'upstream-pr/1114'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1114'
git switch 'upstream-pr/1114'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1114'
git switch 'upstream-pr/1114'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1114'
git switch 'main'
git merge --squash 'upstream-pr/1114'
git switch 'main'
git merge --ff-only 'upstream-pr/1114'
git switch 'main'
git merge 'upstream-pr/1114'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!1114
No description provided.