victory: meshdump surveys mesh and compute programs for group shape, LDS and divergent barriers #1773

Open
ryosen0 wants to merge 2 commits from upstream-pr/1774 into main
ryosen0 commented 2026-11-24 22:20:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ryosen0 on 2026-11-24T22:20:46Z.


What. A diagnostics subcommand:

victory meshdump [paths] [--hash <16 hex>] [--isa] [--compute]

Per container (BLAKE3 of the shader bytes, first 16 hex, the same hash the runtime logs), for each mesh program - and with --compute each compute program - it prints one line:

  • group shape: ms threads=N lds=B verts=V prims=P (mesh) or cs threads=XxYxZ lds=B (compute);
  • the wave64 flag and the s_barrier count;
  • a barrier-divergence verdict: DIVERGENT when a barrier sits in a block reachable only through one side of a lane-dependent branch, all-lanes otherwise, plus the number of lane-dependent branches;
  • --isa additionally prints the decoded GFX10 instructions with machine offsets;
  • a summary: programs N, with barriers N, divergent-barrier N.

The verdict comes from the IR and the control-flow structure (ir::build + structure::structure), not from text matching: for every lane-dependent branch, reachability from the entry is recomputed with each side of the branch removed; a barrier block that becomes unreachable when one side is removed, but is reachable through the other, is only executed by some lanes. --hash filters containers, so a DRED report's hashes can be surveyed directly.

Why. On hosts whose wave is narrower than the console's, an s_barrier in a block only some lanes reach deadlocks the group - one of the standing hypotheses in the NVIDIA world-hang threads (#71, #619, #778). Checking it by hand means decoding each suspect program and tracing branches around every barrier. The existing diagnostics answer runtime questions (#638: what the hang waits for; #509: execution census; #1183: translation census; the new title memory peeks in 7000573: runtime buffer/slot state); none of them surveys the static group shape / LDS / barrier layout of the pack's mesh and compute programs, which is what a hang report's hash list needs first. This tool closes that gap in one command per report.

Two commits: 06f29c9 (the survey, mesh + compute, and the CLI wiring) and 6c182d8 (README: the commands list and a short usage note). 212 added lines, no deletions.

Tested.

  • Used on all 11 shader hashes from our evening device-removal runs on an RTX 3060 Ti (driver 617.42 / 32.0.16.1742, Windows 11 Pro 22631): 5 mesh programs (threads=128 lds=0 barriers=2 all-lanes) and 6 compute programs; divergent-barrier count 0. That closed the barrier hypothesis at the ISA level for those removals and moved the investigation on.
  • --hash filtering, --isa output and the summary line checked against the same containers by hand (decoded instructions and barrier offsets match).
  • Release build on the PR head 6c182d8, base main 70564ae.
  • cargo test --workspace --exclude victory-gpu -- --test-threads=4 on the PR head 6c182d8: 185 passed / 0 failed / 4 ignored across the other crates (12 test binaries); victory-shader: 206 passed / 3 failed / 2 ignored. cargo test -p victory-gpu --lib -- --test-threads=1: 7 failed, then the test binary aborts (0xc0000409, on resource::tests::buffer_data_reaches_the_host_texture). All of these failures reproduce identically on the untouched base 70564ae on this machine (the shader ones report "dispatch failed: Not enough memory resources" on the 8 GB NVIDIA card; the GPU failure sets are name-for-name identical), so they are pre-existing environment failures, not changes from this PR - the diff touches only apps/victory and README. The three shader tests: emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride, emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros, emit::synthetic_tests::gathers_at_a_level_match_the_hardware.

Not tested. GPU execution (the tool only reads and decodes files; no device is created). Packs other than the one retail title we have. Geometry and other stages (skipped by design).

Notes. No runtime behaviour changes: a new subcommand and a README entry only; no edits outside apps/victory/src and README.md. The analysis reuses the existing victory_shader IR/structure APIs; written from scratch for this repository, nothing ported.

AI-assisted; used on a real RTX 3060 Ti.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6592566347 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1774). Originally posted by [ryosen0](https://github.com/ryosen0) on 2026-11-24T22:20:46Z. --- **What.** A diagnostics subcommand: ``` victory meshdump [paths] [--hash <16 hex>] [--isa] [--compute] ``` Per container (BLAKE3 of the shader bytes, first 16 hex, the same hash the runtime logs), for each mesh program - and with `--compute` each compute program - it prints one line: - group shape: `ms threads=N lds=B verts=V prims=P` (mesh) or `cs threads=XxYxZ lds=B` (compute); - the `wave64` flag and the `s_barrier` count; - a barrier-divergence verdict: `DIVERGENT` when a barrier sits in a block reachable only through one side of a lane-dependent branch, `all-lanes` otherwise, plus the number of lane-dependent branches; - `--isa` additionally prints the decoded GFX10 instructions with machine offsets; - a summary: `programs N, with barriers N, divergent-barrier N`. The verdict comes from the IR and the control-flow structure (`ir::build` + `structure::structure`), not from text matching: for every lane-dependent branch, reachability from the entry is recomputed with each side of the branch removed; a barrier block that becomes unreachable when one side is removed, but is reachable through the other, is only executed by some lanes. `--hash` filters containers, so a DRED report's hashes can be surveyed directly. **Why.** On hosts whose wave is narrower than the console's, an `s_barrier` in a block only some lanes reach deadlocks the group - one of the standing hypotheses in the NVIDIA world-hang threads (#71, #619, #778). Checking it by hand means decoding each suspect program and tracing branches around every barrier. The existing diagnostics answer runtime questions (#638: what the hang waits for; #509: execution census; #1183: translation census; the new title memory peeks in `7000573`: runtime buffer/slot state); none of them surveys the *static* group shape / LDS / barrier layout of the pack's mesh and compute programs, which is what a hang report's hash list needs first. This tool closes that gap in one command per report. Two commits: `06f29c9` (the survey, mesh + compute, and the CLI wiring) and `6c182d8` (README: the commands list and a short usage note). 212 added lines, no deletions. **Tested.** - Used on all 11 shader hashes from our evening device-removal runs on an RTX 3060 Ti (driver 617.42 / 32.0.16.1742, Windows 11 Pro 22631): 5 mesh programs (`threads=128 lds=0 barriers=2 all-lanes`) and 6 compute programs; divergent-barrier count 0. That closed the barrier hypothesis at the ISA level for those removals and moved the investigation on. - `--hash` filtering, `--isa` output and the summary line checked against the same containers by hand (decoded instructions and barrier offsets match). - Release build on the PR head `6c182d8`, base `main` `70564ae`. - `cargo test --workspace --exclude victory-gpu -- --test-threads=4` on the PR head `6c182d8`: 185 passed / 0 failed / 4 ignored across the other crates (12 test binaries); `victory-shader`: 206 passed / 3 failed / 2 ignored. `cargo test -p victory-gpu --lib -- --test-threads=1`: 7 failed, then the test binary aborts (`0xc0000409`, on `resource::tests::buffer_data_reaches_the_host_texture`). All of these failures reproduce identically on the untouched base `70564ae` on this machine (the shader ones report "dispatch failed: Not enough memory resources" on the 8 GB NVIDIA card; the GPU failure sets are name-for-name identical), so they are pre-existing environment failures, not changes from this PR - the diff touches only `apps/victory` and README. The three shader tests: `emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride`, `emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros`, `emit::synthetic_tests::gathers_at_a_level_match_the_hardware`. **Not tested.** GPU execution (the tool only reads and decodes files; no device is created). Packs other than the one retail title we have. Geometry and other stages (skipped by design). **Notes.** No runtime behaviour changes: a new subcommand and a README entry only; no edits outside `apps/victory/src` and `README.md`. The analysis reuses the existing `victory_shader` IR/structure APIs; written from scratch for this repository, nothing ported. AI-assisted; used on a real RTX 3060 Ti.
DenRakEiw commented 2026-11-24 23:05:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T22:27:04Z.

Review: APPROVED


Verified locally merged onto origin/main (70564ae, Windows 11 x64, Rust 1.98.1 MSVC):

  • cargo test -p victory — 1 passed, 0 failed
  • cargo clippy -p victory --all-targets — 0 warnings
  • cargo xtask policy — ok

Clean meshdump CLI subcommand surveying mesh/compute group shapes, LDS usage, and divergent barriers, documented in README.md. Looks good.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6048389323 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1774#pullrequestreview-6048389323). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-24T22:27:04Z. **Review:** APPROVED --- Verified locally merged onto `origin/main` (`70564ae`, Windows 11 x64, Rust 1.98.1 MSVC): - `cargo test -p victory` — 1 passed, 0 failed - `cargo clippy -p victory --all-targets` — 0 warnings - `cargo xtask policy` — ok Clean `meshdump` CLI subcommand surveying mesh/compute group shapes, LDS usage, and divergent barriers, documented in `README.md`. Looks good. AI-assisted (Gemini 4 Neon).
catminou4 commented 2026-11-24 23:05:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T23:03:41Z.

Review: COMMENTED


Static review only: apps/Windows-only (CLI/run paths) — nothing compiles on macOS; source review of the diff.

meshdump surveys mesh and compute programs for group shape/LDS: apps-side analysis tool, 11K. Useful diagnostic; Windows-only.

<!-- greyfinch-sync:Marvisak/VIctory:review:6048804209 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1774#pullrequestreview-6048804209). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T23:03:41Z. **Review:** COMMENTED --- Static review only: apps/Windows-only (CLI/run paths) — nothing compiles on macOS; source review of the diff. meshdump surveys mesh and compute programs for group shape/LDS: apps-side analysis tool, 11K. Useful diagnostic; Windows-only.
DesertGamer commented 2026-11-24 23:05:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DesertGamer on 2026-11-24T22:23:45Z.


VIctory V2: community PRs, merged and tested

Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.

Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).

⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.

Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2

Unofficial community fork of Marvisak/VIctory, GPL-3.0.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7146176139 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1774#issuecomment-7146176139). Originally posted by [DesertGamer](https://github.com/DesertGamer) on 2026-11-24T22:23:45Z. --- ### VIctory V2: community PRs, merged and tested Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch. **Where it stands today:** launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1). :warning: Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk. Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help: https://DesertGamer/VIctory-V2 *Unofficial community fork of Marvisak/VIctory, GPL-3.0.*
Marvisak commented 2026-11-25 02:06:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:36:01Z.


Automated triage for the maintainers.

Needs rebase. This pull request conflicts with main (conflicting: README.md). It will be reviewed once it is rebased onto the current main.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149734552 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1774#issuecomment-7149734552). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:36:01Z. --- <!-- victory-triage v1 head=6c182d81526e8197324c6c633d848d31fed3e1e2 verdict=needs-rebase at=2026-11-25T01:36:00Z --> Automated triage for the maintainers. **Needs rebase.** This pull request conflicts with `main` (conflicting: `README.md`). It will be reviewed once it is rebased onto the current `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/1774:upstream-pr/1774'
git switch 'upstream-pr/1774'

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