d3d12: map title memory far past root SRVs and UAVs #441

Closed
glovepost wants to merge 3 commits from upstream-pr/441 into main
glovepost commented 2026-11-29 04:41:10 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by glovepost on 2026-11-29T04:41:10Z.


Summary

A root SRV or UAV has no size of its own. ProjectScarlett reads about 80 KiB past one, and the device was lost 32 KiB past a one-page import. Import up to 4 MiB behind the address, from the 4 MiB boundary below when that memory is committed, otherwise from the address's page, and span 8 MiB clipped to the committed run. Root constant buffers stay 64 KiB.

Lookups check up to eight preceding registry entries. Command imports stay in a 1024-entry cache only while their pages stay mapped, so a title VirtualAlloc import does not outlive memory the title has released.

The root-srv-reach control reads 0, 65280, 65536, 81920 and 1048576 bytes past a root SRV.

A non-null address waits for a pending page mapping over that 8 MiB window before VirtualQuery and before a covering import is reused. Sampling first kept the one-page fallback, or a GPU address the remap was about to retire.

A root view of an address already returned by GetGPUVirtualAddress binds that buffer. Widening the host GPU address imported committed memory around it, and NVIDIA rejected the command list.

Rebased onto current main (28717263). This branch does not touch the ray-tracing builds in the companion pull requests.

Tested

Run the checks relevant to this change.

  • The checks relevant to this change passed
  • Changed or new behaviour is covered by a Lanes scenario, or the reason it cannot be is stated below
  • Where the table calls for AMD and NVIDIA, they passed on both. Otherwise, say which vendor still needs to run them:

The reach is the root-srv-reach D3D12 regression control, not a Lanes scenario. A Lanes dispatch does not place a root view over title memory the way this import does, and it does not queue a CopyPageMappings behind that bind. The wait is the same case: nothing in Lanes holds a page mapping pending across the import.

The first command block is 4065d2c5, before the wait. 4657a53c passed the regression controls on both adapters and the guest suites on AMD, and failed lanes-selftest-thread-dimensions on NVIDIA (close list failed: 0x80070057). f244a687 binds an existing buffer instead of widening that address. On that commit both adapters passed the regression controls and the guest suites, 72/72, including thread-dimensions.

Code checks on this rebase:

cargo check --offline --locked --target x86_64-pc-windows-msvc -p tuxbox-d3d12 --tests
python3 -m unittest tests.test_d3d12_regressions tests.test_check

Both exited 0. cargo check printed two existing warnings in descriptor_paging.rs and tests/device/placement/upload.rs.

GPU, driver and backend:

  • NVIDIA GeForce RTX 2070 SUPER, 10de:1e84, driver 620.73.04
  • AMD Ryzen 7 9800X3D (RADV RAPHAEL_MENDOCINO), 1002:13c0, Mesa 26.3.1
  • Proton GE-Proton11-14, prefix upstream-pr-checks, --windows-dxc pointing at Microsoft's x64 dxcompiler.dll and dxil.dll

Commands run and their results:

cargo check --offline --locked --target x86_64-pc-windows-msvc -p tuxbox-d3d12 --tests
# Finished, exit 0

python3 -m unittest tests.test_d3d12_regressions tests.test_check
# Ran 21 tests, OK

python3 tools/check_d3d12_regressions.py --build-dir build/d3d12-smoke \
  --proton <proton> --prefix <prefix> --compiler-dir <windows-dxc> \
  --adapter 10de:1e84 --case root-srv-reach --case root-cbv-window \
  --work <work> --output <output>
# root-srv-reach PASS pci=10de:1e84 words=20/20 offsets=0,65280,65536,81920,1048576
# root-cbv-window PASS pci=10de:1e84 words=120/120 window=65536 offsets=0,256,65280,65536,65792

python3 tools/check_d3d12_regressions.py --build-dir build/d3d12-smoke \
  --proton <proton> --prefix <prefix> --compiler-dir <windows-dxc> \
  --adapter 1002:13c0 --case root-srv-reach --case root-cbv-window \
  --work <work> --output <output>
# root-srv-reach PASS pci=1002:13c0 words=20/20 offsets=0,65280,65536,81920,1048576
# root-cbv-window PASS pci=1002:13c0 words=120/120 window=65536 offsets=0,256,65280,65536,65792

4657a53c, rebuilt before these runs. Gamescope was --backend headless -w 1280 -h 720 --prefer-vk-device <adapter> with ENABLE_GAMESCOPE_WSI=0.

python3 tools/check_d3d12_regressions.py --build-dir build/d3d12-smoke \
  --proton <proton> --prefix <prefix> --compiler-dir <windows-dxc> \
  --adapter 10de:1e84 --work <work> --output <output>
# 11/11 passed, adapter 10de:1e84
# root-srv-reach PASS pci=10de:1e84 words=20/20 offsets=0,65280,65536,81920,1048576

python3 tools/check_d3d12_regressions.py --build-dir build/d3d12-smoke \
  --proton <proton> --prefix <prefix> --compiler-dir <windows-dxc> \
  --adapter 10de:1e84 --case root-cbv-window \
  --work <work> --output <output>
# root-cbv-window PASS pci=10de:1e84 words=120/120 window=65536 offsets=0,256,65280,65536,65792

python3 tuxbox.py verify --backend proton --proton <proton> --prefix <prefix> \
  --adapter 10de:1e84 \
  --only guest-frame --only present \
  --only d3d12-exports --only d3d12-features --only d3d12-indirect \
  --only d3d12-queries --only d3d12-queues --only d3d12-tables \
  --only d3d12-heaps --only d3d12-placement --only d3d12-copy-resource \
  --only d3d12-draw --only d3d12-stream --only d3d12-frame-events \
  --only d3d12-guids --only d3d12-signatures --only d3d12-mesh \
  --only lanes --only lanes-selftest \
  --only lanes-compute-root --only lanes-compute-root-recovery \
  --only lanes-compute-root-srv --only lanes-bindless-compute \
  --only lanes-compute-heap-stride \
  --output <output>
# 71/72 passed, pci=10de:1e84
# FAIL lanes-selftest-thread-dimensions: close list failed: 0x80070057
# lanes-bindless-compute-wide PASS
# lanes-compute-root-srv PASS

python3 tools/check_d3d12_regressions.py --build-dir build/d3d12-smoke \
  --proton <proton> --prefix <prefix> --compiler-dir <windows-dxc> \
  --adapter 1002:13c0 --work <work> --output <output>
# 11/11 passed, adapter 1002:13c0
# root-srv-reach PASS pci=1002:13c0 words=20/20 offsets=0,65280,65536,81920,1048576

python3 tools/check_d3d12_regressions.py --build-dir build/d3d12-smoke \
  --proton <proton> --prefix <prefix> --compiler-dir <windows-dxc> \
  --adapter 1002:13c0 --case root-cbv-window \
  --work <work> --output <output>
# root-cbv-window PASS pci=1002:13c0 words=120/120 window=65536 offsets=0,256,65280,65536,65792

python3 tuxbox.py verify --backend proton --proton <proton> --prefix <prefix> \
  --adapter 1002:13c0 \
  --only guest-frame --only present \
  --only d3d12-exports --only d3d12-features --only d3d12-indirect \
  --only d3d12-queries --only d3d12-queues --only d3d12-tables \
  --only d3d12-heaps --only d3d12-placement --only d3d12-copy-resource \
  --only d3d12-draw --only d3d12-stream --only d3d12-frame-events \
  --only d3d12-guids --only d3d12-signatures --only d3d12-mesh \
  --only lanes --only lanes-selftest \
  --only lanes-compute-root --only lanes-compute-root-recovery \
  --only lanes-compute-root-srv --only lanes-bindless-compute \
  --only lanes-compute-heap-stride \
  --output <output>
# 72/72 passed, pci=1002:13c0
# lanes-selftest PASS pci=1002:13c0 scenario=thread-dimensions passed=1

f244a687, rebuilt before these runs. Gamescope was --backend headless -w 1280 -h 720 --prefer-vk-device <adapter> with ENABLE_GAMESCOPE_WSI=0.

python3 tools/check_d3d12_regressions.py --build-dir build/d3d12-smoke \
  --proton <proton> --prefix <prefix> --compiler-dir <windows-dxc> \
  --adapter 10de:1e84 --work <work> --output <output>
# 11/11 passed, adapter 10de:1e84
# root-srv-reach PASS pci=10de:1e84 words=20/20 offsets=0,65280,65536,81920,1048576

python3 tools/check_d3d12_regressions.py --build-dir build/d3d12-smoke \
  --proton <proton> --prefix <prefix> --compiler-dir <windows-dxc> \
  --adapter 10de:1e84 --case root-cbv-window \
  --work <work> --output <output>
# root-cbv-window PASS pci=10de:1e84 words=120/120 window=65536 offsets=0,256,65280,65536,65792

python3 tuxbox.py verify --backend proton --proton <proton> --prefix <prefix> \
  --adapter 10de:1e84 \
  --only guest-frame --only present \
  --only d3d12-exports --only d3d12-features --only d3d12-indirect \
  --only d3d12-queries --only d3d12-queues --only d3d12-tables \
  --only d3d12-heaps --only d3d12-placement --only d3d12-copy-resource \
  --only d3d12-draw --only d3d12-stream --only d3d12-frame-events \
  --only d3d12-guids --only d3d12-signatures --only d3d12-mesh \
  --only lanes --only lanes-selftest \
  --only lanes-compute-root --only lanes-compute-root-recovery \
  --only lanes-compute-root-srv --only lanes-bindless-compute \
  --only lanes-compute-heap-stride \
  --output <output>
# 72/72 passed, pci=10de:1e84
# lanes-selftest PASS pci=10de:1e84 scenario=thread-dimensions passed=1

python3 tools/check_d3d12_regressions.py --build-dir build/d3d12-smoke \
  --proton <proton> --prefix <prefix> --compiler-dir <windows-dxc> \
  --adapter 1002:13c0 --work <work> --output <output>
# 11/11 passed, adapter 1002:13c0
# root-srv-reach PASS pci=1002:13c0 words=20/20 offsets=0,65280,65536,81920,1048576

python3 tools/check_d3d12_regressions.py --build-dir build/d3d12-smoke \
  --proton <proton> --prefix <prefix> --compiler-dir <windows-dxc> \
  --adapter 1002:13c0 --case root-cbv-window \
  --work <work> --output <output>
# root-cbv-window PASS pci=1002:13c0 words=120/120 window=65536 offsets=0,256,65280,65536,65792

python3 tuxbox.py verify --backend proton --proton <proton> --prefix <prefix> \
  --adapter 1002:13c0 \
  --only guest-frame --only present \
  --only d3d12-exports --only d3d12-features --only d3d12-indirect \
  --only d3d12-queries --only d3d12-queues --only d3d12-tables \
  --only d3d12-heaps --only d3d12-placement --only d3d12-copy-resource \
  --only d3d12-draw --only d3d12-stream --only d3d12-frame-events \
  --only d3d12-guids --only d3d12-signatures --only d3d12-mesh \
  --only lanes --only lanes-selftest \
  --only lanes-compute-root --only lanes-compute-root-recovery \
  --only lanes-compute-root-srv --only lanes-bindless-compute \
  --only lanes-compute-heap-stride \
  --output <output>
# 72/72 passed, pci=1002:13c0
# lanes-selftest PASS pci=1002:13c0 scenario=thread-dimensions passed=1

Claude Code wrote the original port. This session rebased it onto current main, added the wait and the existing-buffer bind, and recorded the runs above. cargo check --offline --locked --target x86_64-pc-windows-msvc -p tuxbox-d3d12 --tests on the wait commit exited 0, with the same two existing warnings. The buffer-bind commit was built with python3 build.py d3d12 and python3 build.py lanes.

Checks

CI runs the Python unit tests, the shader compiler, DXBC, and XG layout tests, and a Windows typecheck of tuxbox-d3d12.

<!-- greyfinch-sync:brcly/TuxBox:issue:5547618417 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/441). Originally posted by [glovepost](https://github.com/glovepost) on 2026-11-29T04:41:10Z. --- ## Summary A root SRV or UAV has no size of its own. ProjectScarlett reads about 80 KiB past one, and the device was lost 32 KiB past a one-page import. Import up to 4 MiB behind the address, from the 4 MiB boundary below when that memory is committed, otherwise from the address's page, and span 8 MiB clipped to the committed run. Root constant buffers stay 64 KiB. Lookups check up to eight preceding registry entries. Command imports stay in a 1024-entry cache only while their pages stay mapped, so a title `VirtualAlloc` import does not outlive memory the title has released. The `root-srv-reach` control reads 0, 65280, 65536, 81920 and 1048576 bytes past a root SRV. A non-null address waits for a pending page mapping over that 8 MiB window before `VirtualQuery` and before a covering import is reused. Sampling first kept the one-page fallback, or a GPU address the remap was about to retire. A root view of an address already returned by `GetGPUVirtualAddress` binds that buffer. Widening the host GPU address imported committed memory around it, and NVIDIA rejected the command list. Rebased onto current `main` (`28717263`). This branch does not touch the ray-tracing builds in the companion pull requests. ## Tested Run the [checks relevant to this change](../CONTRIBUTING.md#test-what-your-change-touches). - [x] The checks relevant to this change passed - [x] Changed or new behaviour is covered by a Lanes scenario, or the reason it cannot be is stated below - [x] Where the table calls for AMD and NVIDIA, they passed on both. Otherwise, say which vendor still needs to run them: The reach is the `root-srv-reach` D3D12 regression control, not a Lanes scenario. A Lanes dispatch does not place a root view over title memory the way this import does, and it does not queue a `CopyPageMappings` behind that bind. The wait is the same case: nothing in Lanes holds a page mapping pending across the import. The first command block is `4065d2c5`, before the wait. `4657a53c` passed the regression controls on both adapters and the guest suites on AMD, and failed `lanes-selftest-thread-dimensions` on NVIDIA (`close list failed: 0x80070057`). `f244a687` binds an existing buffer instead of widening that address. On that commit both adapters passed the regression controls and the guest suites, 72/72, including `thread-dimensions`. Code checks on this rebase: ```text cargo check --offline --locked --target x86_64-pc-windows-msvc -p tuxbox-d3d12 --tests python3 -m unittest tests.test_d3d12_regressions tests.test_check ``` Both exited 0. `cargo check` printed two existing warnings in `descriptor_paging.rs` and `tests/device/placement/upload.rs`. GPU, driver and backend: - NVIDIA GeForce RTX 2070 SUPER, `10de:1e84`, driver 620.73.04 - AMD Ryzen 7 9800X3D (RADV RAPHAEL_MENDOCINO), `1002:13c0`, Mesa 26.3.1 - Proton GE-Proton11-14, prefix `upstream-pr-checks`, `--windows-dxc` pointing at Microsoft's x64 `dxcompiler.dll` and `dxil.dll` Commands run and their results: ```text cargo check --offline --locked --target x86_64-pc-windows-msvc -p tuxbox-d3d12 --tests # Finished, exit 0 python3 -m unittest tests.test_d3d12_regressions tests.test_check # Ran 21 tests, OK python3 tools/check_d3d12_regressions.py --build-dir build/d3d12-smoke \ --proton <proton> --prefix <prefix> --compiler-dir <windows-dxc> \ --adapter 10de:1e84 --case root-srv-reach --case root-cbv-window \ --work <work> --output <output> # root-srv-reach PASS pci=10de:1e84 words=20/20 offsets=0,65280,65536,81920,1048576 # root-cbv-window PASS pci=10de:1e84 words=120/120 window=65536 offsets=0,256,65280,65536,65792 python3 tools/check_d3d12_regressions.py --build-dir build/d3d12-smoke \ --proton <proton> --prefix <prefix> --compiler-dir <windows-dxc> \ --adapter 1002:13c0 --case root-srv-reach --case root-cbv-window \ --work <work> --output <output> # root-srv-reach PASS pci=1002:13c0 words=20/20 offsets=0,65280,65536,81920,1048576 # root-cbv-window PASS pci=1002:13c0 words=120/120 window=65536 offsets=0,256,65280,65536,65792 ``` `4657a53c`, rebuilt before these runs. Gamescope was `--backend headless -w 1280 -h 720 --prefer-vk-device <adapter>` with `ENABLE_GAMESCOPE_WSI=0`. ```text python3 tools/check_d3d12_regressions.py --build-dir build/d3d12-smoke \ --proton <proton> --prefix <prefix> --compiler-dir <windows-dxc> \ --adapter 10de:1e84 --work <work> --output <output> # 11/11 passed, adapter 10de:1e84 # root-srv-reach PASS pci=10de:1e84 words=20/20 offsets=0,65280,65536,81920,1048576 python3 tools/check_d3d12_regressions.py --build-dir build/d3d12-smoke \ --proton <proton> --prefix <prefix> --compiler-dir <windows-dxc> \ --adapter 10de:1e84 --case root-cbv-window \ --work <work> --output <output> # root-cbv-window PASS pci=10de:1e84 words=120/120 window=65536 offsets=0,256,65280,65536,65792 python3 tuxbox.py verify --backend proton --proton <proton> --prefix <prefix> \ --adapter 10de:1e84 \ --only guest-frame --only present \ --only d3d12-exports --only d3d12-features --only d3d12-indirect \ --only d3d12-queries --only d3d12-queues --only d3d12-tables \ --only d3d12-heaps --only d3d12-placement --only d3d12-copy-resource \ --only d3d12-draw --only d3d12-stream --only d3d12-frame-events \ --only d3d12-guids --only d3d12-signatures --only d3d12-mesh \ --only lanes --only lanes-selftest \ --only lanes-compute-root --only lanes-compute-root-recovery \ --only lanes-compute-root-srv --only lanes-bindless-compute \ --only lanes-compute-heap-stride \ --output <output> # 71/72 passed, pci=10de:1e84 # FAIL lanes-selftest-thread-dimensions: close list failed: 0x80070057 # lanes-bindless-compute-wide PASS # lanes-compute-root-srv PASS python3 tools/check_d3d12_regressions.py --build-dir build/d3d12-smoke \ --proton <proton> --prefix <prefix> --compiler-dir <windows-dxc> \ --adapter 1002:13c0 --work <work> --output <output> # 11/11 passed, adapter 1002:13c0 # root-srv-reach PASS pci=1002:13c0 words=20/20 offsets=0,65280,65536,81920,1048576 python3 tools/check_d3d12_regressions.py --build-dir build/d3d12-smoke \ --proton <proton> --prefix <prefix> --compiler-dir <windows-dxc> \ --adapter 1002:13c0 --case root-cbv-window \ --work <work> --output <output> # root-cbv-window PASS pci=1002:13c0 words=120/120 window=65536 offsets=0,256,65280,65536,65792 python3 tuxbox.py verify --backend proton --proton <proton> --prefix <prefix> \ --adapter 1002:13c0 \ --only guest-frame --only present \ --only d3d12-exports --only d3d12-features --only d3d12-indirect \ --only d3d12-queries --only d3d12-queues --only d3d12-tables \ --only d3d12-heaps --only d3d12-placement --only d3d12-copy-resource \ --only d3d12-draw --only d3d12-stream --only d3d12-frame-events \ --only d3d12-guids --only d3d12-signatures --only d3d12-mesh \ --only lanes --only lanes-selftest \ --only lanes-compute-root --only lanes-compute-root-recovery \ --only lanes-compute-root-srv --only lanes-bindless-compute \ --only lanes-compute-heap-stride \ --output <output> # 72/72 passed, pci=1002:13c0 # lanes-selftest PASS pci=1002:13c0 scenario=thread-dimensions passed=1 ``` `f244a687`, rebuilt before these runs. Gamescope was `--backend headless -w 1280 -h 720 --prefer-vk-device <adapter>` with `ENABLE_GAMESCOPE_WSI=0`. ```text python3 tools/check_d3d12_regressions.py --build-dir build/d3d12-smoke \ --proton <proton> --prefix <prefix> --compiler-dir <windows-dxc> \ --adapter 10de:1e84 --work <work> --output <output> # 11/11 passed, adapter 10de:1e84 # root-srv-reach PASS pci=10de:1e84 words=20/20 offsets=0,65280,65536,81920,1048576 python3 tools/check_d3d12_regressions.py --build-dir build/d3d12-smoke \ --proton <proton> --prefix <prefix> --compiler-dir <windows-dxc> \ --adapter 10de:1e84 --case root-cbv-window \ --work <work> --output <output> # root-cbv-window PASS pci=10de:1e84 words=120/120 window=65536 offsets=0,256,65280,65536,65792 python3 tuxbox.py verify --backend proton --proton <proton> --prefix <prefix> \ --adapter 10de:1e84 \ --only guest-frame --only present \ --only d3d12-exports --only d3d12-features --only d3d12-indirect \ --only d3d12-queries --only d3d12-queues --only d3d12-tables \ --only d3d12-heaps --only d3d12-placement --only d3d12-copy-resource \ --only d3d12-draw --only d3d12-stream --only d3d12-frame-events \ --only d3d12-guids --only d3d12-signatures --only d3d12-mesh \ --only lanes --only lanes-selftest \ --only lanes-compute-root --only lanes-compute-root-recovery \ --only lanes-compute-root-srv --only lanes-bindless-compute \ --only lanes-compute-heap-stride \ --output <output> # 72/72 passed, pci=10de:1e84 # lanes-selftest PASS pci=10de:1e84 scenario=thread-dimensions passed=1 python3 tools/check_d3d12_regressions.py --build-dir build/d3d12-smoke \ --proton <proton> --prefix <prefix> --compiler-dir <windows-dxc> \ --adapter 1002:13c0 --work <work> --output <output> # 11/11 passed, adapter 1002:13c0 # root-srv-reach PASS pci=1002:13c0 words=20/20 offsets=0,65280,65536,81920,1048576 python3 tools/check_d3d12_regressions.py --build-dir build/d3d12-smoke \ --proton <proton> --prefix <prefix> --compiler-dir <windows-dxc> \ --adapter 1002:13c0 --case root-cbv-window \ --work <work> --output <output> # root-cbv-window PASS pci=1002:13c0 words=120/120 window=65536 offsets=0,256,65280,65536,65792 python3 tuxbox.py verify --backend proton --proton <proton> --prefix <prefix> \ --adapter 1002:13c0 \ --only guest-frame --only present \ --only d3d12-exports --only d3d12-features --only d3d12-indirect \ --only d3d12-queries --only d3d12-queues --only d3d12-tables \ --only d3d12-heaps --only d3d12-placement --only d3d12-copy-resource \ --only d3d12-draw --only d3d12-stream --only d3d12-frame-events \ --only d3d12-guids --only d3d12-signatures --only d3d12-mesh \ --only lanes --only lanes-selftest \ --only lanes-compute-root --only lanes-compute-root-recovery \ --only lanes-compute-root-srv --only lanes-bindless-compute \ --only lanes-compute-heap-stride \ --output <output> # 72/72 passed, pci=1002:13c0 # lanes-selftest PASS pci=1002:13c0 scenario=thread-dimensions passed=1 ``` Claude Code wrote the original port. This session rebased it onto current main, added the wait and the existing-buffer bind, and recorded the runs above. `cargo check --offline --locked --target x86_64-pc-windows-msvc -p tuxbox-d3d12 --tests` on the wait commit exited 0, with the same two existing warnings. The buffer-bind commit was built with `python3 build.py d3d12` and `python3 build.py lanes`. ## Checks CI runs the Python unit tests, the shader compiler, DXBC, and XG layout tests, and a Windows typecheck of `tuxbox-d3d12`.
NickStallman commented 2026-11-29 04:58:32 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T04:58:32Z.


Thanks for putting this on current main. One thing about root_view_address, found by reading only: I haven't reproduced it, and I'm not saying it causes any fault reported here. The same code is in #389.

It queries the regions and calls covering_buffer before anything waits for a pending CopyPageMappings. buffer_at waits first, but only after the window has been chosen. Example: the title queues a mapping for pages at or after A behind GPU work, then binds a root SRV at A. While the mapping is pending, VirtualQuery still sees the old state, so:

  • if A isn't committed yet, the window is None and the one-byte path imports only A's 64 KiB page;
  • if only pages after A are pending, the window ends early;
  • if covering_buffer finds an import over the range, it's returned without a wait, although the pending mapping may be about to retire it.

The smallest fix I can see is to wait before sampling, for a non-null address, at the top of the function:

let start = address & !(ROOT_VIEW_REACH - 1);
crate::commands::page_mapping::GPU_APERTURE.wait(start, 2 * ROOT_VIEW_REACH)?;

That can wait for more than the binding needs; waiting only for address..address + ROOT_VIEW_REACH would be narrower. If I've missed a reason it can't happen, say so.

We'll run the full check on an RTX 5090 and an RDNA 2 iGPU for this PR, #440, #442 and #443 and post the results.

<!-- greyfinch-sync:brcly/TuxBox:comment:7250972659 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/441#issuecomment-7250972659). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T04:58:32Z. --- Thanks for putting this on current `main`. One thing about `root_view_address`, **found by reading only: I haven't reproduced it, and I'm not saying it causes any fault reported here.** The same code is in #389. It queries the regions and calls `covering_buffer` before anything waits for a pending `CopyPageMappings`. `buffer_at` waits first, but only after the window has been chosen. Example: the title queues a mapping for pages at or after A behind GPU work, then binds a root SRV at A. While the mapping is pending, `VirtualQuery` still sees the old state, so: - if A isn't committed yet, the window is `None` and the one-byte path imports only A's 64 KiB page; - if only pages after A are pending, the window ends early; - if `covering_buffer` finds an import over the range, it's returned without a wait, although the pending mapping may be about to retire it. The smallest fix I can see is to wait before sampling, for a non-null address, at the top of the function: ```rust let start = address & !(ROOT_VIEW_REACH - 1); crate::commands::page_mapping::GPU_APERTURE.wait(start, 2 * ROOT_VIEW_REACH)?; ``` That can wait for more than the binding needs; waiting only for `address..address + ROOT_VIEW_REACH` would be narrower. If I've missed a reason it can't happen, say so. We'll run the full check on an RTX 5090 and an RDNA 2 iGPU for this PR, #440, #442 and #443 and post the results.
DrArroway commented 2026-11-29 07:33:46 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-29T07:33:46Z.


Tested this in ProjectScarlett on AMD RDNA 2 (RX 6900 XT, 1002:73bf, Mesa RADV 26.3.1, GE-Proton11-14, Linux 7.3.6, offline, 3840x2160):

  • Baseline (main 2871726 + local BLAS branch, without #441): two consecutive runs hit a deterministic TCP read GPUVM fault (RW: 0, PERMISSION_FAULTS: 3) right after entering 3D (0x8005a2542000 and 0x8001f9bc0000, outside all AS ranges) inside draw VS 281b4977 PS 96e8aaaa (2 and 17 unfinished draws reported by TUXBOX_TRACE_GPU_FAULT=1; VS 281b4977 reads root/heap SRVs with no raytracing instructions).
  • With #441 applied on top: passed that draw cleanly and rendered 24+ consecutive 3D world frames over 545.6s (2 frames / 15-19s, live AS churn up to 998/173 MiB) with 0 GPUVM faults and 0 VK_ERROR_DEVICE_LOST (the run eventually exited on a title CPU access violation at game_scarlett_master.exe + 0x7B61A7).

(tuxbox.py check was not run separately on standalone #441 here.)

<!-- greyfinch-sync:brcly/TuxBox:comment:7252549191 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/441#issuecomment-7252549191). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-11-29T07:33:46Z. --- Tested this in ProjectScarlett on AMD RDNA 2 (`RX 6900 XT`, `1002:73bf`, Mesa RADV 26.3.1, GE-Proton11-14, Linux 7.3.6, offline, 3840x2160): - **Baseline (`main` `2871726` + local BLAS branch, without `#441`):** two consecutive runs hit a deterministic `TCP` read GPUVM fault (`RW: 0`, `PERMISSION_FAULTS: 3`) right after entering 3D (`0x8005a2542000` and `0x8001f9bc0000`, outside all AS ranges) inside `draw VS 281b4977 PS 96e8aaaa` (2 and 17 unfinished draws reported by `TUXBOX_TRACE_GPU_FAULT=1`; `VS 281b4977` reads root/heap SRVs with no raytracing instructions). - **With `#441` applied on top:** passed that draw cleanly and rendered **24+ consecutive 3D world frames** over `545.6s` (`2 frames / 15-19s`, live AS churn up to `998/173 MiB`) with **0 GPUVM faults** and **0 `VK_ERROR_DEVICE_LOST`** (the run eventually exited on a title CPU access violation at `game_scarlett_master.exe + 0x7B61A7`). (`tuxbox.py check` was not run separately on standalone `#441` here.)
brcly commented 2026-11-29 15:08:17 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-29T15:08:17Z.


This carries the same root_view_address change as #389. I posted our memory measurements and two open questions there: https://github.com/brcly/TuxBox/pull/389#issuecomment-7257849244. They apply here too. Please settle between the two PRs which one carries on.

<!-- greyfinch-sync:brcly/TuxBox:comment:7257849571 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/441#issuecomment-7257849571). Originally posted by [brcly](https://github.com/brcly) on 2026-11-29T15:08:17Z. --- This carries the same `root_view_address` change as #389. I posted our memory measurements and two open questions there: https://github.com/brcly/TuxBox/pull/389#issuecomment-7257849244. They apply here too. Please settle between the two PRs which one carries on.
ReverendOzmund commented 2026-11-29 16:02:23 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by ReverendOzmund on 2026-11-29T16:02:23Z.


Tested on NVIDIA: RTX 3080 Ti, driver 620.73.04, GE-Proton11-14, Bazzite (kernel 7.3.5), with #441 merged onto main at 065a7f9a.

tuxbox.py check passes every guest check, including lanes-selftest-thread-dimensions, compute-root-srv and compute-root-recovery. Regression controls weren't run (no Windows DXC here).

Running ProjectScarlett with it next; I'll report whether the Xid 31 unmapped read from my earlier runs comes back.

<!-- greyfinch-sync:brcly/TuxBox:comment:7258567422 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/441#issuecomment-7258567422). Originally posted by [ReverendOzmund](https://github.com/ReverendOzmund) on 2026-11-29T16:02:23Z. --- Tested on NVIDIA: RTX 3080 Ti, driver 620.73.04, GE-Proton11-14, Bazzite (kernel 7.3.5), with #441 merged onto main at 065a7f9a. `tuxbox.py check` passes every guest check, including lanes-selftest-thread-dimensions, compute-root-srv and compute-root-recovery. Regression controls weren't run (no Windows DXC here). Running ProjectScarlett with it next; I'll report whether the Xid 31 unmapped read from my earlier runs comes back.
glovepost commented 2026-11-29 17:01:20 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by glovepost on 2026-11-29T17:01:20Z.


Closing in favor of #389, as the maintainer asked. The two additions this PR had over #389 (the CopyPageMappings wait and the existing-buffer bind) are described there, with the dual-GPU results.

<!-- greyfinch-sync:brcly/TuxBox:comment:7259357765 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/441#issuecomment-7259357765). Originally posted by [glovepost](https://github.com/glovepost) on 2026-11-29T17:01:20Z. --- Closing in favor of #389, as the maintainer asked. The two additions this PR had over #389 (the CopyPageMappings wait and the existing-buffer bind) are described there, with the dual-GPU results.

Pull request closed

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!441
No description provided.