Tests: sweep two-pass mesh shapes to pin a shape-dependent hang #3205

Open
Dremaus wants to merge 1 commit from upstream-pr/3205 into main
Dremaus commented 2026-11-28 19:56:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Dremaus on 2026-11-28T19:56:13Z.


Adds a GPU test that sweeps the pass-through mesh pipeline across the MsInterface shapes a
retail title produces, to pin down a shape-dependent GPU hang in the translated two-pass mesh
draw (the one behind 0x887A0005 ~20–25 s after the first mesh pass, while a minimal
single-dispatch repro completes).

What is in it

  • gpu_mesh_shape_sweep in crates/xcl/src/gpu/recomp/tests.rs: for each shape (thread count,
    vertex/primitive counts up to 256/256, output rows crossing the 32 KB per-group limit into
    the split path) it writes one synthetic full record with a compute shader and rasterises it
    through the real two-pass path (runner::mesh_draw_split). The first shape whose draw errors
    (a hang becomes an error via the 10 s fence wait) is reported with its parameters; all passing
    means the pipeline shape alone is not the trigger.

Tested

  • cargo test -p xcl --lib gpu_mesh_shape_sweep --no-run: builds clean.
  • Not yet run on a GPU. Pending a run on the affected NVIDIA adapter (and AMD): fill in
    cargo test --workspace -- --test-threads=4 counts and any SKIPPED.

Not tested

  • The GPU run itself — draft until it has been run on hardware.

AI use

  • Claude Code, Claude Opus 4.8 — wrote the test.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5544024442 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3205). Originally posted by [Dremaus](https://github.com/Dremaus) on 2026-11-28T19:56:13Z. --- Adds a GPU test that sweeps the pass-through mesh pipeline across the `MsInterface` shapes a retail title produces, to pin down a shape-dependent GPU hang in the translated two-pass mesh draw (the one behind `0x887A0005` ~20–25 s after the first mesh pass, while a minimal single-dispatch repro completes). **What is in it** - `gpu_mesh_shape_sweep` in `crates/xcl/src/gpu/recomp/tests.rs`: for each shape (thread count, vertex/primitive counts up to 256/256, output rows crossing the 32 KB per-group limit into the split path) it writes one synthetic full record with a compute shader and rasterises it through the real two-pass path (`runner::mesh_draw_split`). The first shape whose draw errors (a hang becomes an error via the 10 s fence wait) is reported with its parameters; all passing means the pipeline shape alone is not the trigger. **Tested** - `cargo test -p xcl --lib gpu_mesh_shape_sweep --no-run`: builds clean. - Not yet run on a GPU. Pending a run on the affected NVIDIA adapter (and AMD): fill in `cargo test --workspace -- --test-threads=4` counts and any `SKIPPED`. **Not tested** - The GPU run itself — draft until it has been run on hardware. **AI use** - Claude Code, Claude Opus 4.8 — wrote the test. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Foniass commented 2026-12-01 09:42:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:42:17Z.


Review (head c6a92d94, diff read, not a merge-check; draft, test-only, conflicts with main):

  • It can only fail where the hang reproduces, and then it takes the suite down. The assertion is that no shape's draw returned an error. A device removal poisons the shared runner device, so every later GPU test in the process fails too. The 10 s fence wait turns a hang into an error but leaves the GPU running the dropped lists. On hardware where it doesn't reproduce it passes without checking pixels. As a diagnostic it is useful; as a suite test it's risky. An opt-in through an environment variable (like the XCL_SAMPLE_* tests) would keep it out of normal runs.
  • The conflict is with main's 46b385a9 (gpu_mesh_mode_exports_stay_inside_the_record) at the same spot in tests.rs. That commit bounds mesh exports that went past the record, which may be the hang this is after (unverified). A rerun of the repro on current main would say whether the sweep is still needed.

Fine: it skips through gpu_ready() / mesh_ready(), stops at the first failure and names its shape, and the shapes cover the split path past 32 KB per group and the retail 21-row shape. Related: #3207 (yours) and #3350.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7307084107 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3205#issuecomment-7307084107). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T09:42:17Z. --- Review (head c6a92d94, diff read, not a merge-check; draft, test-only, conflicts with main): - **It can only fail where the hang reproduces, and then it takes the suite down.** The assertion is that no shape's draw returned an error. A device removal poisons the shared runner device, so every later GPU test in the process fails too. The 10 s fence wait turns a hang into an error but leaves the GPU running the dropped lists. On hardware where it doesn't reproduce it passes without checking pixels. As a diagnostic it is useful; as a suite test it's risky. An opt-in through an environment variable (like the `XCL_SAMPLE_*` tests) would keep it out of normal runs. - The conflict is with main's 46b385a9 (`gpu_mesh_mode_exports_stay_inside_the_record`) at the same spot in `tests.rs`. That commit bounds mesh exports that went past the record, which may be the hang this is after (unverified). A rerun of the repro on current main would say whether the sweep is still needed. Fine: it skips through `gpu_ready()` / `mesh_ready()`, stops at the first failure and names its shape, and the shapes cover the split path past 32 KB per group and the retail 21-row shape. Related: #3207 (yours) and #3350. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Foniass commented 2026-12-01 09:43:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:43:16Z.


Triage (#1607) – head c6a92d9

#3207 (same author) has the same synthetic record-writing compute shader, but it tests a different hypothesis: depth/colour compression after a mesh pass, not the mesh shape. Not a duplicate, though one shared helper would avoid the copied HLSL if both land. Neither test has run on a GPU yet (per the description). No problems found in the diff.

Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7307107527 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3205#issuecomment-7307107527). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T09:43:16Z. --- **Triage (#1607)** – head c6a92d9 #3207 (same author) has the same synthetic record-writing compute shader, but it tests a different hypothesis: depth/colour compression after a mesh pass, not the mesh shape. Not a duplicate, though one shared helper would avoid the copied HLSL if both land. Neither test has run on a GPU yet (per the description). No problems found in the diff. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Joori commented 2026-12-01 12:07:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Joori on 2026-12-01T12:07:59Z.


Test report for c6a92d94 (on main 5b711248), on an NVIDIA card with the two-pass mesh hang.

Tested

  • RTX 4090 (driver 621.40), Ryzen 9 5950X, Windows 10 19045, Rust 1.100.1, debug build.
  • cargo test -p xcl --lib gpu_mesh_shape_sweep -- --nocapture: 1 passed, 0 failed, 0 ignored, finished in 1.31 s. No skip: the GPU, DXC and mesh-shader checks passed, so all nine shapes were drawn.

So on this card the pass-through mesh pipeline draws every shape in the sweep. That includes 256/256, the split path, the retail 21-row shape and the compact-group split, all with well-formed records.

On Foniass's point about 46b385a9: this head does not have it (its base 5b711248 predates the merge), and the sweep passes anyway. The synthetic records never export past their slots, so the sweep doesn't reach the case 46b385a9 bounds. Also, the title still hangs here on main 1bd9cee1, which has 46b385a9.

For context: on this card the retail title still hangs in the two-pass mesh pass, in the café (#505, comments 7308187998 and 7308721098). There it is 0x887a0006 with MMU faults at GPU VA 0x0. Since the shapes pass with well-formed records, I'm now looking at what the mesh pass reads in the title (its records and the addresses in them), not the pipeline shape.

Not tested

  • the whole suite at this commit;
  • a release build;
  • AMD;
  • with the title's real records instead of synthetic ones.

AI use: Claude Code with Claude Opus 5.5 built the PR in a separate worktree, ran the test, read its code, and wrote this report. The run was on this machine.

<!-- greyfinch-sync:ivall/xcl:comment:7310696005 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3205#issuecomment-7310696005). Originally posted by [Joori](https://github.com/Joori) on 2026-12-01T12:07:59Z. --- Test report for `c6a92d94` (on `main` `5b711248`), on an NVIDIA card with the two-pass mesh hang. **Tested** - RTX 4090 (driver 621.40), Ryzen 9 5950X, Windows 10 19045, Rust 1.100.1, debug build. - `cargo test -p xcl --lib gpu_mesh_shape_sweep -- --nocapture`: 1 passed, 0 failed, 0 ignored, finished in 1.31 s. No skip: the GPU, DXC and mesh-shader checks passed, so all nine shapes were drawn. So on this card the pass-through mesh pipeline draws every shape in the sweep. That includes 256/256, the split path, the retail 21-row shape and the compact-group split, all with well-formed records. On Foniass's point about `46b385a9`: this head does not have it (its base `5b711248` predates the merge), and the sweep passes anyway. The synthetic records never export past their slots, so the sweep doesn't reach the case `46b385a9` bounds. Also, the title still hangs here on `main` `1bd9cee1`, which has `46b385a9`. For context: on this card the retail title still hangs in the two-pass mesh pass, in the café (#505, comments 7308187998 and 7308721098). There it is `0x887a0006` with MMU faults at GPU VA 0x0. Since the shapes pass with well-formed records, I'm now looking at what the mesh pass reads in the title (its records and the addresses in them), not the pipeline shape. **Not tested** - the whole suite at this commit; - a release build; - AMD; - with the title's real records instead of synthetic ones. AI use: Claude Code with Claude Opus 5.5 built the PR in a separate worktree, ran the test, read its code, and wrote this report. The run was on this machine.
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/3205:upstream-pr/3205'
git switch 'upstream-pr/3205'

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