d3d12: skip the work that reads a refused paged descriptor table instead of failing its list #463

Merged
Jerkin42 merged 3 commits from upstream-pr/463 into main 2026-11-29 14:37:13 +00:00
Jerkin42 commented 2026-11-29 10:51:31 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by Jerkin42 on 2026-11-29T10:51:31Z.


Summary

When the descriptor arena refuses a paged table (gpu_table returns E_INVALIDARG), SetGraphicsRootDescriptorTable and SetComputeRootDescriptorTable set the list's recording error. Close then fails, and the whole list is dropped. The labels that list would have written never get written, so every queue waiting on them stops until the title's GPU watchdog ends the game.

This change records the refused slot instead. Each draw or dispatch is skipped while a refused table is bound, and the record clears when that slot is set again. The rest of the list still runs, including its label writes.

Tested

  • The checks relevant to this change passed: only the type check and one ProjectScarlett run (below). The lanes and d3d12-* suites haven't been run.
  • Changed or new behaviour is covered by a Lanes scenario: no. Covered by a unit test instead, a_refused_table_skips_work_until_its_slot_is_set_again in tests/commands/compute_bindings.rs.
  • AMD and NVIDIA: AMD only. NVIDIA still needs to run the checks.

GPU, driver and backend: RX 9060 XT, RADV (Mesa), GE-Proton11-14, vkd3d-proton.

Commands run and their results:

cargo check --locked --target x86_64-pc-windows-msvc -p tuxbox-d3d12 --tests   # passes

The unit test was compiled but not run: no link.exe on this host.

ProjectScarlett, first story mission (main 28717263 with #389, #390, #436, #442, #443, #445 and #448):

  • Before: one command list failed 0x80070057 (#1) in the command at runtime/d3d12/src/commands/descriptors.rs:168 and one Close rejected. Then stalled label ... written by list ... submitted to a type 0 queue, and the watchdog stopped the game.
  • After: no list failures and no Close rejected.

Checks

No evidence JSON changed.

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:issue:5549994372 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/463). Originally posted by [Jerkin42](https://github.com/Jerkin42) on 2026-11-29T10:51:31Z. --- ## Summary When the descriptor arena refuses a paged table (`gpu_table` returns `E_INVALIDARG`), `SetGraphicsRootDescriptorTable` and `SetComputeRootDescriptorTable` set the list's recording error. `Close` then fails, and the whole list is dropped. The labels that list would have written never get written, so every queue waiting on them stops until the title's GPU watchdog ends the game. This change records the refused slot instead. Each draw or dispatch is skipped while a refused table is bound, and the record clears when that slot is set again. The rest of the list still runs, including its label writes. ## Tested - [ ] The checks relevant to this change passed: only the type check and one ProjectScarlett run (below). The `lanes` and `d3d12-*` suites haven't been run. - [ ] Changed or new behaviour is covered by a Lanes scenario: no. Covered by a unit test instead, `a_refused_table_skips_work_until_its_slot_is_set_again` in `tests/commands/compute_bindings.rs`. - [ ] AMD and NVIDIA: AMD only. NVIDIA still needs to run the checks. GPU, driver and backend: RX 9060 XT, RADV (Mesa), GE-Proton11-14, vkd3d-proton. Commands run and their results: ```text cargo check --locked --target x86_64-pc-windows-msvc -p tuxbox-d3d12 --tests # passes ``` The unit test was compiled but not run: no `link.exe` on this host. **ProjectScarlett, first story mission** (`main` 28717263 with #389, #390, #436, #442, #443, #445 and #448): - **Before:** one `command list failed 0x80070057 (#1) in the command at runtime/d3d12/src/commands/descriptors.rs:168` and one `Close rejected`. Then `stalled label ... written by list ... submitted to a type 0 queue`, and the watchdog stopped the game. - **After:** no list failures and no `Close rejected`. ## Checks No evidence JSON changed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
NickStallman commented 2026-11-29 11:01:02 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T11:01:02Z.


We have hit the same refusal (one list lost at Close, then the labels it would have written) on an RTX 5090, and I had a parked branch with the same idea. I won't open mine, yours is here. From comparing the two by reading, things you may want:

  • The record outlives the root signature. compute_root, graphics_root and heaps clear the bound tables but not refused_tables, so after a refusal, work under a new root that doesn't set that slot is skipped too, until the slot number is set again. Clearing the entries for that bind point in the first two, and all in heaps, where they clear the tables, would do it.
  • Ray dispatches and bundles can use the refused table as well. My branch skips those too (ray_dispatch.rs, standard.rs). I didn't look at ExecuteIndirect in either.
  • The log line in mine names the table's place in its heap, which helped tell which draw it was.

I've queued the NVIDIA full check of f96fb326 on an RTX 5090, after my own, and will post the result. If any of my branch would help I can push it.

<!-- greyfinch-sync:brcly/TuxBox:comment:7254821889 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/463#issuecomment-7254821889). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T11:01:02Z. --- We have hit the same refusal (one list lost at `Close`, then the labels it would have written) on an RTX 5090, and I had a parked branch with the same idea. I won't open mine, yours is here. From comparing the two by reading, things you may want: - **The record outlives the root signature.** `compute_root`, `graphics_root` and `heaps` clear the bound tables but not `refused_tables`, so after a refusal, work under a new root that doesn't set that slot is skipped too, until the slot number is set again. Clearing the entries for that bind point in the first two, and all in `heaps`, where they clear the tables, would do it. - **Ray dispatches and bundles** can use the refused table as well. My branch skips those too (`ray_dispatch.rs`, `standard.rs`). I didn't look at `ExecuteIndirect` in either. - The log line in mine names the table's place in its heap, which helped tell which draw it was. I've queued the NVIDIA full check of `f96fb326` on an RTX 5090, after my own, and will post the result. If any of my branch would help I can push it.
Jerkin42 commented 2026-11-29 11:31:32 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by Jerkin42 on 2026-11-29T11:31:32Z.


Thanks, all three are in 2e3e39c3 (rebased on main df67a64f):

  • Record lifetime. compute_root and graphics_root drop that bind point's refusals when the root changes, and heaps drops them all, alongside the bound tables. New unit test: new_descriptor_heaps_clear_refused_tables.
  • Ray dispatches and bundles are skipped while a refused table is bound. Bundles read the caller's graphics tables. They can't hold label writes, because adopt_bundle refuses any with waits, so skipping one loses none.
  • ExecuteIndirect was already covered: it records through compute_dispatch / draw, which run the same check.
  • Log. It now names the slot, the table length and the arena slot the table starts at.

Type check passes (cargo check --locked --target x86_64-pc-windows-msvc -p tuxbox-d3d12 --tests). Thanks for queuing the 5090 run. Since the branch moved, it would need 2e3e39c3 rather than f96fb326.

<!-- greyfinch-sync:brcly/TuxBox:comment:7255170486 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/463#issuecomment-7255170486). Originally posted by [Jerkin42](https://github.com/Jerkin42) on 2026-11-29T11:31:32Z. --- Thanks, all three are in 2e3e39c3 (rebased on `main` df67a64f): - **Record lifetime.** `compute_root` and `graphics_root` drop that bind point's refusals when the root changes, and `heaps` drops them all, alongside the bound tables. New unit test: `new_descriptor_heaps_clear_refused_tables`. - **Ray dispatches and bundles** are skipped while a refused table is bound. Bundles read the caller's graphics tables. They can't hold label writes, because `adopt_bundle` refuses any with waits, so skipping one loses none. - **`ExecuteIndirect`** was already covered: it records through `compute_dispatch` / `draw`, which run the same check. - **Log.** It now names the slot, the table length and the arena slot the table starts at. Type check passes (`cargo check --locked --target x86_64-pc-windows-msvc -p tuxbox-d3d12 --tests`). Thanks for queuing the 5090 run. Since the branch moved, it would need `2e3e39c3` rather than `f96fb326`.
brcly commented 2026-11-29 11:39:12 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-29T11:39:12Z.


NVIDIA run of 2e3e39c3 merged onto main (d2eb99ed), RTX 4070 Ti SUPER (620.73.04), GE-Proton11-14:

  • lanes-selftest: 25/27. descriptor-reclaim and descriptor-reclaim-split fail with expected E_OUTOFMEMORY on unsubmitted pin overflow, got 0x00000000. main alone passes 27/27 on the same card, and the earlier head (before your three changes) failed the same two the same way.
  • lanes-bindless-compute 20/20, d3d12-tables 1/1.
  • d3d12 --lib under Wine: 373 passed; failures::tests::a_failed_pipeline_reaches_the_file failed once in the full run and passed twice on its own, so I read that as flaky rather than this change.

The scenario pins more descriptors than an unsubmitted list can hold and expects its Close to report E_OUTOFMEMORY. With this change the refused table no longer fails the list, which is the point of it, so either the scenario's expectation moves to the new rule (the list closes, and the draw that reads the refused table is skipped, which the test could check instead), or pin overflow keeps failing the list as a distinct case from the refusals this is aimed at. Which one fits is your call.

<!-- greyfinch-sync:brcly/TuxBox:comment:7255257927 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/463#issuecomment-7255257927). Originally posted by [brcly](https://github.com/brcly) on 2026-11-29T11:39:12Z. --- NVIDIA run of `2e3e39c3` merged onto `main` (`d2eb99ed`), RTX 4070 Ti SUPER (620.73.04), GE-Proton11-14: - `lanes-selftest`: 25/27. `descriptor-reclaim` and `descriptor-reclaim-split` fail with `expected E_OUTOFMEMORY on unsubmitted pin overflow, got 0x00000000`. `main` alone passes 27/27 on the same card, and the earlier head (before your three changes) failed the same two the same way. - `lanes-bindless-compute` 20/20, `d3d12-tables` 1/1. - d3d12 `--lib` under Wine: 373 passed; `failures::tests::a_failed_pipeline_reaches_the_file` failed once in the full run and passed twice on its own, so I read that as flaky rather than this change. The scenario pins more descriptors than an unsubmitted list can hold and expects its `Close` to report `E_OUTOFMEMORY`. With this change the refused table no longer fails the list, which is the point of it, so either the scenario's expectation moves to the new rule (the list closes, and the draw that reads the refused table is skipped, which the test could check instead), or pin overflow keeps failing the list as a distinct case from the refusals this is aimed at. Which one fits is your call.
NickStallman commented 2026-11-29 11:49:38 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T11:49:38Z.


Thanks for taking all of that on so quickly. brcly's run of 2e3e39c3 on a 4070 Ti SUPER covers what I'd queued, so I've dropped my own run, which hadn't started, until the descriptor-reclaim expectation is settled. I don't have a view on which way to go beyond what brcly said; I'd rerun on the 5090 once you've picked.

<!-- greyfinch-sync:brcly/TuxBox:comment:7255376957 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/463#issuecomment-7255376957). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T11:49:38Z. --- Thanks for taking all of that on so quickly. brcly's run of `2e3e39c3` on a 4070 Ti SUPER covers what I'd queued, so I've dropped my own run, which hadn't started, until the `descriptor-reclaim` expectation is settled. I don't have a view on which way to go beyond what brcly said; I'd rerun on the 5090 once you've picked.
Jerkin42 commented 2026-11-29 12:40:26 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by Jerkin42 on 2026-11-29T12:40:26Z.


Thanks for the run. I went with the second option in 42d74c6f, rebased on main 6e2c5dab:

  • Pin overflow still fails the list. gpu_table refusing with E_OUTOFMEMORY sets the recording error as before, so Close reports it and descriptor-reclaim / descriptor-reclaim-split keep their expectation.
  • Every other refusal skips only the work that reads the table. The one seen in ProjectScarlett was E_INVALIDARG (0x80070057 at descriptors.rs:168), so the case this PR targets is unchanged.

Pin overflow is a capacity limit the title is told about. The other refusals are the ones that silently lost a list's label writes.

The type check passes. I haven't run lanes-selftest here: on this host every Proton check opens a visible window on the desktop, so I've been leaving the suites to CI and to runs like yours.

<!-- greyfinch-sync:brcly/TuxBox:comment:7255981609 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/463#issuecomment-7255981609). Originally posted by [Jerkin42](https://github.com/Jerkin42) on 2026-11-29T12:40:26Z. --- Thanks for the run. I went with the second option in 42d74c6f, rebased on `main` 6e2c5dab: - **Pin overflow still fails the list.** `gpu_table` refusing with `E_OUTOFMEMORY` sets the recording error as before, so `Close` reports it and `descriptor-reclaim` / `descriptor-reclaim-split` keep their expectation. - **Every other refusal skips only the work that reads the table.** The one seen in ProjectScarlett was `E_INVALIDARG` (`0x80070057` at `descriptors.rs:168`), so the case this PR targets is unchanged. Pin overflow is a capacity limit the title is told about. The other refusals are the ones that silently lost a list's label writes. The type check passes. I haven't run `lanes-selftest` here: on this host every Proton check opens a visible window on the desktop, so I've been leaving the suites to CI and to runs like yours.
NickStallman commented 2026-11-29 13:26:04 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T13:26:04Z.


Full check of 42d74c6f on an RTX 5090 (620.70.10, GE-Proton11-14): 187 pass, 0 fail, including both descriptor-reclaim cases. No game was running.

<!-- greyfinch-sync:brcly/TuxBox:comment:7256534657 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/463#issuecomment-7256534657). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T13:26:04Z. --- Full check of `42d74c6f` on an RTX 5090 (620.70.10, GE-Proton11-14): 187 pass, 0 fail, including both `descriptor-reclaim` cases. No game was running.
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
brcly/TuxBox!463
No description provided.