Skip to content

Recompiler: add mesh_poison to test compressed depth/colour after a mesh pass - #3207

Draft
Dremaus wants to merge 1 commit into
xcl-dev:mainfrom
Dremaus:recompiler/mesh-poison-test
Draft

Dremaus wants to merge 1 commit into
xcl-dev:mainfrom
Dremaus:recompiler/mesh-poison-test

Conversation

@Dremaus

@Dremaus Dremaus commented Nov 28, 2026

Copy link
Copy Markdown

Adds a diagnostic that reproduces, offline, the class of GPU hang the two-pass mesh draw causes
in one title: a mesh dispatch that completes but leaves depth/colour compression metadata the
driver trips over on a later operation (~20–25 s later, 0x887A0005, no DRED page fault). The
existing in-tree path (runner::mesh_draw) can't exercise this: it binds no depth buffer and uses
R32G32B32A32_FLOAT, a format that gets no delta colour compression.

What is in it

  • mesh_poison + PoisonReport + MeshDepthStream in crates/xcl/src/gpu/recomp/runner.rs:
    binds the game's target shape (R8G8B8A8_UNORM + a D32_FLOAT_S8X24_UINT depth buffer),
    primes depth compression by writing it, then runs what a normal frame does after — a
    depth-reading pass, a colour resolve/copy, a readback — each a separately fenced submission so
    the first phase to hang or remove the device is named.
  • gpu_mesh_poison in crates/xcl/src/gpu/recomp/tests.rs: drives it with a game-shaped pass
    (128 threads, 128v/128p) at 1024² for 9 frames and asserts every phase completed.

Tested

  • cargo test -p xcl --lib gpu_mesh_poison --no-run: builds clean.
  • Not yet run on a GPU. Pending a run on the affected NVIDIA adapter (and AMD).

Regression run

  • runner.rs is crates/xcl/src (test-support code), so this needs the two xcl-smoke blocks
    (main vs this head) — pending the GPU run. Draft until then; a maintainer may instead apply the
    test-only label after reviewing the diff.

Not tested

  • The GPU run itself.

AI use

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

🤖 Generated with Claude Code

@github-actions github-actions Bot added area:recompiler RDNA2 decoder, HLSL/direct-DXIL recompiler, wave64/wave32 area:tests Unit, integration, e2e tests, or testtitle gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) needs-rebase Has merge conflicts with its base branch labels Nov 28, 2026
…esh pass

A completed two-pass mesh dispatch can leave depth/colour compression
metadata (HiZ/ZCull/DCC) that a later operation trips over ~20-25 s later
(0x887A0005, no DRED page fault). The in-tree path mesh_draw cannot exercise
this: it binds no depth buffer and uses R32G32B32A32_FLOAT, which gets no
delta colour compression.

mesh_poison binds the game's target shape - the rt_formats colour targets
plus a dsv_format depth buffer - primes depth compression by writing it in a
first pass, then runs what a normal frame does after it: a depth-reading
pass, a colour resolve/copy, and a readback, each a separately fenced
submission, so the PoisonReport names the first phase to hang or remove the
device (the 10 s fence wait turns a hang into an error). gpu_mesh_poison
drives it with a game-shaped pass (128 threads, 128v/128p) into three
R8G8B8A8_UNORM targets + a D32_FLOAT_S8X24 depth buffer at 1024 square for 9
frames, matching the 3-RT + depth draws the removal clusters on.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Dremaus
Dremaus force-pushed the recompiler/mesh-poison-test branch from 80aeb85 to 8ab8acb Compare November 28, 2026 21:43
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

This PR has merge conflicts (needs-rebase) and has had no activity for 2 days, so it is marked stale and will be closed in 3 days unless it is rebased onto its base branch.

@github-actions github-actions Bot added the stale No activity for 3 days; closed 4 days later unless something happens label Dec 1, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Review (head 8ab8acb, diff read, not a merge-check; draft, conflicts with main, PR description red):

  • It isn't test-only. runner is a plain pub mod runner (gpu/recomp/mod.rs ~68), so mesh_poison, PoisonReport and MeshDepthStream (runner.rs ~1446-1731) are compiled into the runtime. Moving them under #[cfg(test)] would fix that.
  • It doesn't exercise compressed depth. The depth buffer stays in DEPTH_WRITE throughout, and nothing samples or copies it (~1675), so depth decompression never runs. The "resolve" is a plain CopyResource (~1705).
  • The assertion can't fail where the bug doesn't show. The test (tests.rs ~3846) only checks that no phase timed out (10 s) or removed the device, and never checks pixels. Nine frames take milliseconds, while the description puts the real hang 20-25 s in.
  • Where it does reproduce, it takes the suite down. A device removal kills the shared runner device, so every later GPU test in the process fails. A timeout drops command lists the GPU is still running.
  • Early return before the fence update. A ? on bind_resources (~1685) returns before gpu.value = value (~1729), so the next test's fence wait can return early.
  • Source of the conflict. Main's 46b385a (gpu_mesh_mode_exports_stay_inside_the_record) sits at the same spot. That commit bounds mesh exports that went past the record, which may be the hang this hunts (unverified).

As it stands it's a diagnostic experiment, and it fits better on a branch or in an issue than in the suite. It does skip correctly through gpu_ready / mesh_ready. Related: #3205 (yours), #3350, #3504.

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 8ab8acb

#3205 (same author) has the same synthetic record-writing compute shader, but it sweeps mesh shapes; this PR adds a depth/multi-RT compression scenario (runner::mesh_poison). Not a duplicate. The red check is only PR description. Not yet run on a GPU (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.

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

Labels

area:recompiler RDNA2 decoder, HLSL/direct-DXIL recompiler, wave64/wave32 area:tests Unit, integration, e2e tests, or testtitle gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) needs-rebase Has merge conflicts with its base branch stale No activity for 3 days; closed 4 days later unless something happens

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants