lanes: pin the descriptor limit the reclaim self-test counts on #178

Merged
3kynox merged 1 commit from upstream-pr/178 into main 2026-11-25 17:58:37 +00:00
3kynox commented 2026-11-25 16:37:45 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-11-25T16:37:45Z.


Summary

lanes-selftest-descriptor-reclaim (#172) fails on main on this host:

lanes-selftest FAIL descriptor-reclaim: expected E_OUTOFMEMORY on unsubmitted pin overflow, got 0x00000000

The scenario counts on a resident limit of 1,000,000 descriptors. Its last step pins 63 tables of 16,384 descriptors (1,032,192) in open lists and expects Close() to return E_OUTOFMEMORY. CreateDescriptorHeap uses the host's MaxViewDescriptorHeapSize when that is above 1,000,000 (runtime/d3d12/src/device/resources.rs). On such a host the 63 tables fit and nothing overflows.

The provider already has a cap for the resident limit, TUXBOX_DESCRIPTOR_HEAP_LIMIT, read when the heap is created. The scenario now sets it to 1,000,000 around its own CreateDescriptorHeap call and clears it afterwards. It then pages the same way on every host, and a later scenario in the same process (--selftest all) is not affected.

What I saw on this host, with main at 9ca0060:

  • the scenario fails with the line above;
  • with TUXBOX_DESCRIPTOR_HEAP_LIMIT=1000000 exported it passes;
  • with this change it passes without the variable.

I have not read the value this host reports for MaxViewDescriptorHeapSize. The three results above are what points at it.

Verified on Lanes

  • python tuxbox.py check passed on this branch
  • Changed or new behaviour is covered by a Lanes scenario, or the reason it cannot be is stated below

The scenario is descriptor-reclaim itself: on this host it fails without the change and passes with it.

GPU, driver and backend: NVIDIA GeForce RTX 4070 Ti SUPER (10de:2705), driver 595.112.07, Proton Experimental 11.0-20261112. NixOS, Linux 7.2.11, Intel Core i9-12900K, Hyprland (Wayland).

Summary
  passed   Build the shader compiler (10s)
  passed   Python tests (5s)
  passed   Shader compiler tests (4s)
  passed   DXBC tests (1s)
  passed   XG layout tests (1s)
  passed   D3D12 Windows typecheck (1s)
  passed   Build (33s)
  passed   Lanes and fixtures on the GPU (262s)
  passed   D3D12 regression controls (103s)
  passed   Shader translator on the GPU (262s)

All checks passed.

The check ran on this commit (on 7b22d71) with --proton, --prefix and --windows-dxc (Microsoft's x64 DXC 1.8.2505.1): 64 of 64 guest checks and all 17 regression cases pass. Without the change that scenario fails on this base too: it is the one failure in the check of #177.

Checks

  • No Rust code changed. The unit tests and the Windows typecheck are in the summary above.
  • lanes-xbox-replay still passes its import check: SetEnvironmentVariableW resolves to a Windows core API set, so Lanes stays inside its Xbox title profile.

No evidence JSON changed.

<!-- greyfinch-sync:brcly/TuxBox:issue:6609096881 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/178). Originally posted by [3kynox](https://github.com/3kynox) on 2026-11-25T16:37:45Z. --- ## Summary `lanes-selftest-descriptor-reclaim` (#172) fails on `main` on this host: ```text lanes-selftest FAIL descriptor-reclaim: expected E_OUTOFMEMORY on unsubmitted pin overflow, got 0x00000000 ``` The scenario counts on a resident limit of 1,000,000 descriptors. Its last step pins 63 tables of 16,384 descriptors (1,032,192) in open lists and expects `Close()` to return `E_OUTOFMEMORY`. `CreateDescriptorHeap` uses the host's `MaxViewDescriptorHeapSize` when that is above 1,000,000 (`runtime/d3d12/src/device/resources.rs`). On such a host the 63 tables fit and nothing overflows. The provider already has a cap for the resident limit, `TUXBOX_DESCRIPTOR_HEAP_LIMIT`, read when the heap is created. The scenario now sets it to 1,000,000 around its own `CreateDescriptorHeap` call and clears it afterwards. It then pages the same way on every host, and a later scenario in the same process (`--selftest all`) is not affected. What I saw on this host, with `main` at 9ca0060: - the scenario fails with the line above; - with `TUXBOX_DESCRIPTOR_HEAP_LIMIT=1000000` exported it passes; - with this change it passes without the variable. I have not read the value this host reports for `MaxViewDescriptorHeapSize`. The three results above are what points at it. ## Verified on Lanes - [x] `python tuxbox.py check` passed on this branch - [x] Changed or new behaviour is covered by a Lanes scenario, or the reason it cannot be is stated below The scenario is `descriptor-reclaim` itself: on this host it fails without the change and passes with it. GPU, driver and backend: NVIDIA GeForce RTX 4070 Ti SUPER (`10de:2705`), driver 595.112.07, Proton Experimental 11.0-20261112. NixOS, Linux 7.2.11, Intel Core i9-12900K, Hyprland (Wayland). ```text Summary passed Build the shader compiler (10s) passed Python tests (5s) passed Shader compiler tests (4s) passed DXBC tests (1s) passed XG layout tests (1s) passed D3D12 Windows typecheck (1s) passed Build (33s) passed Lanes and fixtures on the GPU (262s) passed D3D12 regression controls (103s) passed Shader translator on the GPU (262s) All checks passed. ``` The check ran on this commit (on 7b22d71) with `--proton`, `--prefix` and `--windows-dxc` (Microsoft's x64 DXC 1.8.2505.1): 64 of 64 guest checks and all 17 regression cases pass. Without the change that scenario fails on this base too: it is the one failure in the check of #177. ## Checks - No Rust code changed. The unit tests and the Windows typecheck are in the summary above. - `lanes-xbox-replay` still passes its import check: `SetEnvironmentVariableW` resolves to a Windows core API set, so Lanes stays inside its Xbox title profile. No evidence JSON changed.
copilot-pull-request-reviewer[bot] commented 2026-11-25 16:45:01 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T16:45:01Z.

Review: COMMENTED


🔵 Needs a closer look

The review evidence is incomplete because one or more reviewer sessions failed.

No open issues 🎉

What changed in this PR

This PR makes the Lanes descriptor-reclaim self-test use the resident descriptor limit its overflow checks expect, avoiding failures on hosts with larger descriptor capacities.

Changes:

  • Set TUXBOX_DESCRIPTOR_HEAP_LIMIT to 1000000 before creating the test heap.
  • Clear the override after heap creation, before checking the result.
File Description
examples/​lanes/​selftest.cpp Temporarily caps the test heap’s resident descriptor limit and documents why it is needed.

Review effort: Balanced

<!-- greyfinch-sync:brcly/TuxBox:review:6061429065 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/178#pullrequestreview-6061429065). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-25T16:45:01Z. **Review:** COMMENTED --- <!-- ccr-overview-v2 --> ### 🔵 Needs a closer look The review evidence is incomplete because one or more reviewer sessions failed. **No open issues** 🎉 <details> <summary><strong>What changed in this PR</strong></summary> This PR makes the Lanes descriptor-reclaim self-test use the resident descriptor limit its overflow checks expect, avoiding failures on hosts with larger descriptor capacities. **Changes:** - Set `TUXBOX_DESCRIPTOR_HEAP_LIMIT` to `1000000` before creating the test heap. - Clear the override after heap creation, before checking the result. | File | Description | | ---- | ----------- | | `examples/​lanes/​selftest.cpp` | Temporarily caps the test heap’s resident descriptor limit and documents why it is needed. | </details> <sub>Review effort: Balanced</sub>
postblink commented 2026-11-25 17:01:41 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by postblink on 2026-11-25T17:01:41Z.


Same failure on a second NVIDIA host, and the same result with this change.

NVIDIA GeForce RTX 5080 (10de:2c02), driver 620.73.04, Proton Experimental 11.0-20261112, CachyOS, KDE Plasma (Wayland). Full default python tuxbox.py verify on the GPU:

Commit Result
7b22d71 (main) 67/68, lanes-selftest FAIL descriptor-reclaim: expected E_OUTOFMEMORY on unsubmitted pin overflow, got 0x00000000
0705a9d (this branch) 68/68

On the host limit you hadn't read: the NVIDIA Vulkan driver here reports maxDescriptorSetUpdateAfterBindSampledImages = 1048576 (RADV on the same machine reports 8388606). If the MaxViewDescriptorHeapSize the host D3D12 reports follows that limit, the heap gets 1,048,576 resident descriptors instead of 1,000,000, and the scenario's 63 × 16,384 = 1,032,192 pinned descriptors fit, so Close() succeeds. I read the Vulkan limit, not the D3D12 value itself, so treat that link as likely rather than measured. It does explain why the scenario passes on hosts that report 1,000,000 or less and fails here, and why pinning the limit in the scenario fixes it.

<!-- greyfinch-sync:brcly/TuxBox:comment:7168890870 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/178#issuecomment-7168890870). Originally posted by [postblink](https://github.com/postblink) on 2026-11-25T17:01:41Z. --- Same failure on a second NVIDIA host, and the same result with this change. NVIDIA GeForce RTX 5080 (`10de:2c02`), driver 620.73.04, Proton Experimental 11.0-20261112, CachyOS, KDE Plasma (Wayland). Full default `python tuxbox.py verify` on the GPU: | Commit | Result | |---|---| | `7b22d71` (main) | 67/68, `lanes-selftest FAIL descriptor-reclaim: expected E_OUTOFMEMORY on unsubmitted pin overflow, got 0x00000000` | | `0705a9d` (this branch) | 68/68 | On the host limit you hadn't read: the NVIDIA Vulkan driver here reports `maxDescriptorSetUpdateAfterBindSampledImages = 1048576` (RADV on the same machine reports 8388606). If the `MaxViewDescriptorHeapSize` the host D3D12 reports follows that limit, the heap gets 1,048,576 resident descriptors instead of 1,000,000, and the scenario's 63 × 16,384 = 1,032,192 pinned descriptors fit, so `Close()` succeeds. I read the Vulkan limit, not the D3D12 value itself, so treat that link as likely rather than measured. It does explain why the scenario passes on hosts that report 1,000,000 or less and fails here, and why pinning the limit in the scenario fixes it.
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!178
No description provided.