GPU: name the commands at a DRED stop, and dump translated shaders #279

Open
ALFREDOHDEZ wants to merge 1 commit from upstream-pr/279 into main
ALFREDOHDEZ commented 2026-11-24 02:01:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ALFREDOHDEZ on 2026-11-24T02:01:05Z.


What

Two diagnostics changes that came out of looking at the NVIDIA world hang (#71, #97). Neither changes what a release build does.

  • DRED report names the commands at the stop. in_flight() listed the first 12 commands after the barrier before the stop. In a long run between two barriers, that can miss the commands at the stop. It now names up to 40 commands, starting a few before the stop. (Work between barriers overlaps, so the first commands may still be running too; they are no longer listed when the run is long.)
  • VICTORY_SHADER_DUMP=<dir> (diagnostics builds only). When a shader is translated, it writes the container as <hash>.bin and, if translation succeeds, its DXIL as <hash>.dxil, keyed by the same 16-digit hash the DRED and VICTORY_GPU_TIMING lines print, so it can go to dxc -dumpbin. Documented in the README's debugging table.

Tested

Windows 11, RTX 4070, main at d2a4bae.

  • New unit test in_flight_names_the_commands_at_the_stop: 100 marked dispatches between two barriers, stop at dispatch 80. The report names dispatches 79 and 80 and not dispatch 0. It passes with and without --features diagnostics.
  • On the title (diag build, VICTORY_D3D12_DRED=1): for a list stopped at command 203 of 518 (op 6), in a run 20..348, the report starts at command 199.
  • VICTORY_SHADER_DUMP wrote 2,059 .bin and 1,698 .dxil files in one run; dxc -dumpbin read the ones I tried.
  • cargo xtask policy --staged: 3 files ok. I did not run cargo test --workspace.

Edited: an earlier version of this description gave a wrong dump count and a wrong before/after example.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:6572898810 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/279). Originally posted by [ALFREDOHDEZ](https://github.com/ALFREDOHDEZ) on 2026-11-24T02:01:05Z. --- ## What Two diagnostics changes that came out of looking at the NVIDIA world hang (#71, #97). Neither changes what a release build does. - **DRED report names the commands at the stop.** `in_flight()` listed the first 12 commands after the barrier before the stop. In a long run between two barriers, that can miss the commands at the stop. It now names up to 40 commands, starting a few before the stop. (Work between barriers overlaps, so the first commands may still be running too; they are no longer listed when the run is long.) - **`VICTORY_SHADER_DUMP=<dir>`** (diagnostics builds only). When a shader is translated, it writes the container as `<hash>.bin` and, if translation succeeds, its DXIL as `<hash>.dxil`, keyed by the same 16-digit hash the DRED and `VICTORY_GPU_TIMING` lines print, so it can go to `dxc -dumpbin`. Documented in the README's debugging table. ## Tested Windows 11, RTX 4070, `main` at `d2a4bae`. - New unit test `in_flight_names_the_commands_at_the_stop`: 100 marked dispatches between two barriers, stop at dispatch 80. The report names dispatches 79 and 80 and not dispatch 0. It passes with and without `--features diagnostics`. - On the title (diag build, `VICTORY_D3D12_DRED=1`): for `a list stopped at command 203 of 518 (op 6)`, in a run `20..348`, the report starts at command 199. - `VICTORY_SHADER_DUMP` wrote 2,059 `.bin` and 1,698 `.dxil` files in one run; `dxc -dumpbin` read the ones I tried. - `cargo xtask policy --staged`: 3 files ok. I did not run `cargo test --workspace`. Edited: an earlier version of this description gave a wrong dump count and a wrong before/after example. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jeremygold02 commented 2026-11-24 06:55:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T04:12:29Z.


Tested PR #279 at head 02f0e29f8031d7b97353e9b90f6bbab5495b6b10 (state at test time: OPEN). Pre-comment refresh: state OPEN, head unchanged at 02f0e29f8031d7b97353e9b90f6bbab5495b6b10.

  • cargo test --locked -p victory-gpu --features diagnostics in_flight_names_the_commands_at_the_stop — passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 46 filtered out; finished in 0.00s ); cases: host::tests::in_flight_names_the_commands_at_the_stop.

Behavior covered: Checks diagnostic output names commands in flight at a stop, with the diagnostics feature enabled.
Code: crates/victory-gpu/src/host.rs, crates/victory-gpu/src/pipeline.rs

<!-- greyfinch-sync:Marvisak/VIctory:comment:7121806298 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/279#issuecomment-7121806298). Originally posted by [jeremygold02](https://github.com/jeremygold02) on 2026-11-24T04:12:29Z. --- Tested PR #279 at head `02f0e29f8031d7b97353e9b90f6bbab5495b6b10` (state at test time: OPEN). Pre-comment refresh: state OPEN, head unchanged at `02f0e29f8031d7b97353e9b90f6bbab5495b6b10`. - `cargo test --locked -p victory-gpu --features diagnostics in_flight_names_the_commands_at_the_stop` — passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 46 filtered out; finished in 0.00s ); cases: host::tests::in_flight_names_the_commands_at_the_stop. Behavior covered: Checks diagnostic output names commands in flight at a stop, with the diagnostics feature enabled. Code: [crates/victory-gpu/src/host.rs](https://github.com/Marvisak/VIctory/blob/02f0e29f8031d7b97353e9b90f6bbab5495b6b10/crates/victory-gpu/src/host.rs), [crates/victory-gpu/src/pipeline.rs](https://github.com/Marvisak/VIctory/blob/02f0e29f8031d7b97353e9b90f6bbab5495b6b10/crates/victory-gpu/src/pipeline.rs)
TrashTalker3460 commented 2026-11-24 06:56:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by TrashTalker3460 on 2026-11-24T05:51:00Z.


Review note on head 02f0e29: the VICTORY_SHADER_DUMP writer (crates/victory-gpu/src/pipeline.rs:114) writes the title's shader containers and their DXIL with create_dir_all / fs::write. It doesn't call victory_core::ensure_outside_repo first.

docs/asset-policy.md ("Enforcement", point 3) asks every writer of derived data to call it, so that a dump directory pointed inside a checkout is refused. One call before create_dir_all would cover it.

Read-only review, nothing built. AI-assisted (Claude Code); the claim above was checked against this head and main at d2a4bae. Context: the triage in #366.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7123333107 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/279#issuecomment-7123333107). Originally posted by [TrashTalker3460](https://github.com/TrashTalker3460) on 2026-11-24T05:51:00Z. --- Review note on head `02f0e29`: the `VICTORY_SHADER_DUMP` writer (`crates/victory-gpu/src/pipeline.rs:114`) writes the title's shader containers and their DXIL with `create_dir_all` / `fs::write`. It doesn't call `victory_core::ensure_outside_repo` first. `docs/asset-policy.md` ("Enforcement", point 3) asks every writer of derived data to call it, so that a dump directory pointed inside a checkout is refused. One call before `create_dir_all` would cover it. _Read-only review, nothing built. AI-assisted (Claude Code); the claim above was checked against this head and `main` at `d2a4bae`. Context: the triage in #366._
mercuryVM commented 2026-11-24 08:45:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T08:45:55Z.

Review: APPROVED


Tested 02f0e29 on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (265 passed, 0 failed). The new test builds only with diagnostics, and cargo test -p victory-gpu --features diagnostics --lib in_flight passes.

  • in_flight: starting from max(barrier + 1, done - 4) and naming up to 40 commands puts the stop and its neighbours in the report, where a long run between barriers used to show only the first 12. The test's arithmetic checks out (dispatch 80 is command 162).
  • VICTORY_SHADER_DUMP is diagnostics-only and names files by the same 16-digit hash the DRED/timing lines print, which makes it easy to use.

One request: the README row should say these dumps are title data. The .bin files are the game's own shader containers, and the asset policy forbids sharing them, so something like "(title data: keep local, don't attach to issues)" would keep users from posting them in bug reports, as they will want to. Not blocking.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6036127547 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/279#pullrequestreview-6036127547). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T08:45:55Z. **Review:** APPROVED --- Tested 02f0e29 on Windows 11, RTX 5070, MSVC: `cargo test --workspace --no-fail-fast` passes (265 passed, 0 failed). The new test builds only with diagnostics, and `cargo test -p victory-gpu --features diagnostics --lib in_flight` passes. - `in_flight`: starting from `max(barrier + 1, done - 4)` and naming up to 40 commands puts the stop and its neighbours in the report, where a long run between barriers used to show only the first 12. The test's arithmetic checks out (dispatch 80 is command 162). - `VICTORY_SHADER_DUMP` is diagnostics-only and names files by the same 16-digit hash the DRED/timing lines print, which makes it easy to use. One request: the README row should say these dumps are title data. The `.bin` files are the game's own shader containers, and the asset policy forbids sharing them, so something like "(title data: keep local, don't attach to issues)" would keep users from posting them in bug reports, as they will want to. Not blocking. AI-assisted (Claude Code).
Marvisak commented 2026-11-25 01:07:47 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: README.md, crates/victory-gpu/src/pipeline.rs.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148500514 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/279#issuecomment-7148500514). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:25:47Z. --- <!-- victory-triage v1 head=02f0e29f8031d7b97353e9b90f6bbab5495b6b10 verdict=needs-rebase at=2026-11-25T00:13:20Z --> Automated triage for the maintainers. **Needs rebase.** This PR does not merge cleanly into current `main` (ac2525d). Conflicting files: `README.md`, `crates/victory-gpu/src/pipeline.rs`. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
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/279:upstream-pr/279'
git switch 'upstream-pr/279'

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/279'
git switch 'upstream-pr/279'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/279'
git switch 'upstream-pr/279'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/279'
git switch 'main'
git merge --squash 'upstream-pr/279'
git switch 'main'
git merge --ff-only 'upstream-pr/279'
git switch 'main'
git merge 'upstream-pr/279'
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!279
No description provided.