d3d12: build with private scratch where the host cannot reach a title's #443

Merged
glovepost merged 1 commit from upstream-pr/443 into main 2026-11-29 09:03:33 +00:00
glovepost commented 2026-11-29 04:41:15 +00:00 (Migrated from github.com)

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


Summary

A build whose scratch lies in title memory the host cannot import was refused, and scratch the title only reserved reached the host as a raw address. Scratch holds nothing before or after a build, so that build gets device-local scratch the list keeps.

ray-tracing-reserved-scratch builds a structure in title memory with scratch the title only reserved. The scene over it must be hit.

Rebased onto current main (28717263). An update that has no source structure still takes the existing full-build scratch path. The refused-build change is a separate branch and also edits the ray-tracing build path and the Lanes lists, so one of the two will need a rebase after the other merges.

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:

lanes-selftest-ray-tracing-reserved-scratch is the new scenario. The full lanes-selftest suite is 25/25 on both adapters, including that scenario and the existing ray-tracing cases. The lanes package was built with python3 build.py bvh and then python3 build.py lanes, because the lanes target copies XboxBvhBuilder.dll and does not build it.

Code checks on this rebase:

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

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_check tests.test_lanes_compute_root tests.test_lanes_raster
# Ran 31 tests, OK

# gamescope --backend headless -w 1280 -h 720 --prefer-vk-device <adapter>
# ENABLE_GAMESCOPE_WSI=0
python3 tuxbox.py verify --backend proton --proton <proton> --prefix <prefix> \
  --adapter 10de:1e84 --only lanes-selftest --output <output>
# 25/25 passed
# lanes-selftest PASS pci=10de:1e84 scenario=ray-tracing-reserved-scratch passed=1

python3 tuxbox.py verify --backend proton --proton <proton> --prefix <prefix> \
  --adapter 1002:13c0 --only lanes-selftest --output <output>
# 25/25 passed
# lanes-selftest PASS pci=1002:13c0 scenario=ray-tracing-reserved-scratch passed=1

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>
# 10/10 passed, adapter 10de:1e84

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>
# 10/10 passed, adapter 1002:13c0

# gamescope --backend headless -w 1280 -h 720 --prefer-vk-device <adapter>
# ENABLE_GAMESCOPE_WSI=0
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>
# 73/73 passed, pci=10de:1e84
# lanes-selftest PASS pci=10de:1e84 scenario=ray-tracing-reserved-scratch passed=1

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>
# 73/73 passed, pci=1002:13c0
# lanes-selftest PASS pci=1002:13c0 scenario=ray-tracing-reserved-scratch passed=1

Claude Code wrote the original port. This session rebased it onto current main, kept the newer Lanes scenarios, reran the code checks, and recorded the Lanes suite above.

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:5547618866 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/443). Originally posted by [glovepost](https://github.com/glovepost) on 2026-11-29T04:41:15Z. --- ## Summary A build whose scratch lies in title memory the host cannot import was refused, and scratch the title only reserved reached the host as a raw address. Scratch holds nothing before or after a build, so that build gets device-local scratch the list keeps. `ray-tracing-reserved-scratch` builds a structure in title memory with scratch the title only reserved. The scene over it must be hit. Rebased onto current `main` (`28717263`). An update that has no source structure still takes the existing full-build scratch path. The refused-build change is a separate branch and also edits the ray-tracing build path and the Lanes lists, so one of the two will need a rebase after the other merges. ## 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: `lanes-selftest-ray-tracing-reserved-scratch` is the new scenario. The full `lanes-selftest` suite is 25/25 on both adapters, including that scenario and the existing ray-tracing cases. The lanes package was built with `python3 build.py bvh` and then `python3 build.py lanes`, because the lanes target copies `XboxBvhBuilder.dll` and does not build it. 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_check tests.test_lanes_compute_root tests.test_lanes_raster ``` 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_check tests.test_lanes_compute_root tests.test_lanes_raster # Ran 31 tests, OK # gamescope --backend headless -w 1280 -h 720 --prefer-vk-device <adapter> # ENABLE_GAMESCOPE_WSI=0 python3 tuxbox.py verify --backend proton --proton <proton> --prefix <prefix> \ --adapter 10de:1e84 --only lanes-selftest --output <output> # 25/25 passed # lanes-selftest PASS pci=10de:1e84 scenario=ray-tracing-reserved-scratch passed=1 python3 tuxbox.py verify --backend proton --proton <proton> --prefix <prefix> \ --adapter 1002:13c0 --only lanes-selftest --output <output> # 25/25 passed # lanes-selftest PASS pci=1002:13c0 scenario=ray-tracing-reserved-scratch passed=1 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> # 10/10 passed, adapter 10de:1e84 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> # 10/10 passed, adapter 1002:13c0 # gamescope --backend headless -w 1280 -h 720 --prefer-vk-device <adapter> # ENABLE_GAMESCOPE_WSI=0 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> # 73/73 passed, pci=10de:1e84 # lanes-selftest PASS pci=10de:1e84 scenario=ray-tracing-reserved-scratch passed=1 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> # 73/73 passed, pci=1002:13c0 # lanes-selftest PASS pci=1002:13c0 scenario=ray-tracing-reserved-scratch passed=1 ``` Claude Code wrote the original port. This session rebased it onto current main, kept the newer Lanes scenarios, reran the code checks, and recorded the Lanes suite above. ## Checks CI runs the Python unit tests, the shader compiler, DXBC, and XG layout tests, and a Windows typecheck of `tuxbox-d3d12`.
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!443
No description provided.