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

Open
Dremaus wants to merge 1 commit from upstream-pr/3207 into main
Dremaus commented 2026-11-28 20:01:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Dremaus on 2026-11-28T20:01:59Z.


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

<!-- greyfinch-sync:ivall/xcl:issue:5544069807 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3207). Originally posted by [Dremaus](https://github.com/Dremaus) on 2026-11-28T20:01:59Z. --- 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](https://claude.com/claude-code)
github-actions[bot] commented 2026-12-01 02:31:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:31:33Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7298709822 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3207#issuecomment-7298709822). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-12-01T02:31:33Z. --- 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.
Foniass commented 2026-12-01 09:39:21 +00:00 (Migrated from github.com)

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


Review (head 8ab8acb6, 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 46b385a9 (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.

<!-- greyfinch-sync:ivall/xcl:comment:7307013862 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3207#issuecomment-7307013862). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T09:39:21Z. --- Review (head 8ab8acb6, 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 46b385a9 (`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 commented 2026-12-01 09:43:48 +00:00 (Migrated from github.com)

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


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.

<!-- greyfinch-sync:ivall/xcl:comment:7307120461 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3207#issuecomment-7307120461). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T09:43:48Z. --- **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.
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/3207:upstream-pr/3207'
git switch 'upstream-pr/3207'

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