d3d12: make scene instances of refused title-memory builds inactive #442

Merged
glovepost merged 1 commit from upstream-pr/442 into main 2026-11-29 08:58:24 +00:00
glovepost commented 2026-11-29 04:41:13 +00:00 (Migrated from github.com)

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


Summary

A build into title memory reserved and published its storage before its inputs were translated. When the build was then refused, an unreadable index format or a failed import, scenes reached storage nothing was built into, or a structure the title had replaced.

Publish that storage once the build is recorded. Publish native address 0 when the build is refused, so instance fixups make those instances inactive. Lists recorded earlier still keep storage a later build takes, which current main already returns from guest_memory::target.

ray-tracing-refused-structure builds two structures in title memory, traces them, then rebuilds the first with 8-bit indices. The scene must miss that instance and still hit the second.

Rebased onto current main (28717263). The reserved-scratch 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-refused-structure 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-refused-structure 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-refused-structure 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-refused-structure 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-refused-structure passed=1

Claude Code wrote the original port. This session rebased it onto current main, kept the newer guest-memory release list, 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:5547618622 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/442). Originally posted by [glovepost](https://github.com/glovepost) on 2026-11-29T04:41:13Z. --- ## Summary A build into title memory reserved and published its storage before its inputs were translated. When the build was then refused, an unreadable index format or a failed import, scenes reached storage nothing was built into, or a structure the title had replaced. Publish that storage once the build is recorded. Publish native address 0 when the build is refused, so instance fixups make those instances inactive. Lists recorded earlier still keep storage a later build takes, which current main already returns from `guest_memory::target`. `ray-tracing-refused-structure` builds two structures in title memory, traces them, then rebuilds the first with 8-bit indices. The scene must miss that instance and still hit the second. Rebased onto current `main` (`28717263`). The reserved-scratch 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-refused-structure` 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-refused-structure 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-refused-structure 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-refused-structure 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-refused-structure passed=1 ``` Claude Code wrote the original port. This session rebased it onto current main, kept the newer guest-memory release list, 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!442
No description provided.