Skip to content

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

Draft
Dremaus wants to merge 1 commit into
xcl-dev:mainfrom
Dremaus:tests/mesh-shape-sweep
Draft

Dremaus wants to merge 1 commit into
xcl-dev:mainfrom
Dremaus:tests/mesh-shape-sweep

Conversation

@Dremaus

@Dremaus Dremaus commented Nov 28, 2026

Copy link
Copy Markdown

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

The translated two-pass mesh draw hangs (0x887A0005) in one retail title
about 20-25 s after the first mesh pass, while a minimal single-dispatch
repro completes. gpu_mesh_shape_sweep drives the real two-pass draw path
(runner::mesh_draw_split) across the MsInterface shapes a title produces:
thread counts, vertex/primitive counts up to the D3D12 maximum of 256/256,
and output-element counts that cross the 32 KB per-group output limit into
the split path, with one synthetic full record per shape. A shape-dependent
removal shows up as the one shape whose draw errors (the 10 s fence wait
turns a hang into an error too) while smaller shapes pass; all passing means
the pipeline shape alone is not the trigger.

Test-only: one #[test] in crates/xcl/src/gpu/recomp/tests.rs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Foniass

Foniass commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Review (head c6a92d9, 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 46b385a (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

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

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

Joori commented Dec 1, 2026

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants