d3d12_title_va_test: a BLAS build in title memory no resource covers (RT-BVH-BUILD-TITLE-VA) #1816

Open
github-bot wants to merge 3 commits from github-bot/gh-1816 into main AGit
Owner

@⁠Snooozs on GitHub · 2026-11-25 12:28 UTC · original
Snooozs:bvh-build-title-va-test → main · +118 −0 · 1 files · 3 commits · open

Item: RT-BVH-BUILD-TITLE-VA (#1608). Test only.

I claimed this item to translate the addresses of acceleration-structure builds. #1723 merged that fix first, and it covers more (the BLAS addresses in TLAS instances, copies sized by the build), so my version is dropped. What is left is one case its tests don't have.

d3d12_xdxr_rt_test builds into slot-133 buffers. The new check_bvh_build in d3d12_title_va_test builds a BLAS with the vertices, indices, destination and scratch all in the title's own memory and no resource over any of it, so every address goes through a title window. The test shader reads the header back at the destination and it must have the triangles' bounds. Before anything is submitted, the test checks that every address got a GPU copy, so a missing translation fails without losing the device.

The check is skipped with LEONIDA_GEOMETRY_MB > 0 (d3d12_geometry_views), like the geometry-only checks next to it are skipped without it.

Tested on RTX 5060 Ti, driver 621.01, Windows 10 22H2, main 0d80bc5df:

  • d3d12_title_va and d3d12_title_va_shadow pass, bounds -5 0 1 to 4 8 9. d3d12_com, d3d12_xdxr_rt, xbox_bvh_builder, d3d12_rebound_* and d3d12_api_descriptor_copy* pass.
  • Negative control: with LEONIDA_RT_AS=off the builds are dropped, and the test fails at the address check, before the submission.
  • d3d12_geometry_views fails on this machine, at !root_blob.empty() in main, before any check runs (the Windows 10 host serializer returned no blob for the heap-directly-indexed root signature). This change does not touch that code. I did not run it on main without the change.
  • Not run in the game.

Noticed while placing the check: a stream pool's two alias ranges stay in the table after the pool's memory is freed (remove_title_memory and dropping the pair do not remove them). When the test allocated its block at those addresses, two parts of it shared one copy and the build read zeros. That is why the check runs before check_stream_pool. Whether the retail title ever reuses a pool's addresses I have not checked.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

**@⁠Snooozs** on GitHub · 2026-11-25 12:28 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1816) `Snooozs:bvh-build-title-va-test` → `main` · +118 −0 · 1 files · 3 commits · open Item: RT-BVH-BUILD-TITLE-VA (#1608). Test only. I claimed this item to translate the addresses of acceleration-structure builds. #1723 merged that fix first, and it covers more (the BLAS addresses in TLAS instances, copies sized by the build), so my version is dropped. What is left is one case its tests don't have. `d3d12_xdxr_rt_test` builds into slot-133 buffers. The new `check_bvh_build` in `d3d12_title_va_test` builds a BLAS with the vertices, indices, destination and scratch all in the title's own memory and no resource over any of it, so every address goes through a title window. The test shader reads the header back at the destination and it must have the triangles' bounds. Before anything is submitted, the test checks that every address got a GPU copy, so a missing translation fails without losing the device. The check is skipped with `LEONIDA_GEOMETRY_MB` > 0 (`d3d12_geometry_views`), like the geometry-only checks next to it are skipped without it. Tested on RTX 5060 Ti, driver 621.01, Windows 10 22H2, main `0d80bc5df`: - `d3d12_title_va` and `d3d12_title_va_shadow` pass, bounds -5 0 1 to 4 8 9. `d3d12_com`, `d3d12_xdxr_rt`, `xbox_bvh_builder`, `d3d12_rebound_*` and `d3d12_api_descriptor_copy*` pass. - Negative control: with `LEONIDA_RT_AS=off` the builds are dropped, and the test fails at the address check, before the submission. - `d3d12_geometry_views` fails on this machine, at `!root_blob.empty()` in `main`, before any check runs (the Windows 10 host serializer returned no blob for the heap-directly-indexed root signature). This change does not touch that code. I did not run it on main without the change. - Not run in the game. Noticed while placing the check: a stream pool's two alias ranges stay in the table after the pool's memory is freed (`remove_title_memory` and dropping the pair do not remove them). When the test allocated its block at those addresses, two parts of it shared one copy and the build read zeros. That is why the check runs before `check_stream_pool`. Whether the retail title ever reuses a pool's addresses I have not checked. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
d3d12_xdxr_rt_test builds into slot-133 buffers. Nothing built with every
address (vertices, indices, destination, scratch) in the title's own
memory with no resource over it, which is reached through title windows.
The header read back at the destination must have the triangles' bounds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review notes by PierreEbele on #1816.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:06:52 +00:00
Author
Owner

@⁠potatoe0100 on GitHub · 2026-11-25 13:58 UTC · original

Tested on Windows 11 (26300), NVIDIA GeForce RTX 4060, driver 621.14, VS 2022 RelWithDebInfo + Ninja, merged onto main 384abe5b: d3d12_title_va and d3d12_title_va_shadow pass with the same bounds (-5 0 1 to 4 8 9), and d3d12_geometry_views, d3d12_xdxr_rt, xbox_bvh_builder*, xdxr_build* and vk_xdxr_postbuild_readback pass too. So d3d12_geometry_views passes on Windows 11 here, and the !root_blob.empty() failure you saw looks specific to the Windows 10 serializer. Negative control repeated: with LEONIDA_RT_AS=off, d3d12_title_va fails. Test-only change, and it reads fine to me.

AI-assisted (Claude).

**@⁠potatoe0100** on GitHub · 2026-11-25 13:58 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1816#issuecomment-7164554717) Tested on Windows 11 (26300), NVIDIA GeForce RTX 4060, driver 621.14, VS 2022 RelWithDebInfo + Ninja, merged onto `main` 384abe5b: `d3d12_title_va` and `d3d12_title_va_shadow` pass with the same bounds (-5 0 1 to 4 8 9), and `d3d12_geometry_views`, `d3d12_xdxr_rt`, `xbox_bvh_builder*`, `xdxr_build*` and `vk_xdxr_postbuild_readback` pass too. So `d3d12_geometry_views` passes on Windows 11 here, and the `!root_blob.empty()` failure you saw looks specific to the Windows 10 serializer. Negative control repeated: with `LEONIDA_RT_AS=off`, `d3d12_title_va` fails. Test-only change, and it reads fine to me. AI-assisted (Claude).
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 19:57 UTC · original

Reviewed cf8490c8: coverage-only addition. I only read the code for the new check (it needs Windows + MSVC + GPU, so it was not executed): the dispatch mirrors check_title_memory's proven root-view pattern, and the asserted box at destination bytes 16-39 matches MODE_HEADER in runtime/src/xdxr_build.comp, with expected bounds {-5,0,1}/{4,8,9} correct for the six vertices. What did run (Linux): check_no_game_data.py on the file -> clean; the portable title_va_alias test builds and passes on the PR tree; Linux-built sources are unchanged from main. A GPU run of the d3d12_title_va / d3d12_title_va_shadow ctest entries remains the one open check. Nits: the check never bumps the checks counter its siblings do, and the file header could note that LEONIDA_RT_AS=khr/off in a user environment would fail this check. No finding. AI-assisted review.

Recommendation: Merge

**@⁠PierreEbele** on GitHub · 2026-11-25 19:57 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1816#issuecomment-7172984262) Reviewed cf8490c8: coverage-only addition. I only read the code for the new check (it needs Windows + MSVC + GPU, so it was not executed): the dispatch mirrors check_title_memory's proven root-view pattern, and the asserted box at destination bytes 16-39 matches MODE_HEADER in runtime/src/xdxr_build.comp, with expected bounds {-5,0,1}/{4,8,9} correct for the six vertices. What did run (Linux): check_no_game_data.py on the file -> clean; the portable title_va_alias test builds and passes on the PR tree; Linux-built sources are unchanged from main. A GPU run of the d3d12_title_va / d3d12_title_va_shadow ctest entries remains the one open check. Nits: the check never bumps the `checks` counter its siblings do, and the file header could note that LEONIDA_RT_AS=khr/off in a user environment would fail this check. No finding. AI-assisted review. **Recommendation:** Merge
Author
Owner

@⁠Snooozs on GitHub · 2026-11-25 21:24 UTC · original

Thanks @⁠potatoe0100 and @⁠PierreEbele.

  • Merged current main (be2f4026c) into the branch; it was on 0d80bc5df, which may be why the linux-gpu-tools and macos jobs of the last run failed (cs_imgatomic_ext there). This change adds a Windows test and can't reach those jobs.
  • The two nits are in: the check counts itself (checks), and the comment on it names LEONIDA_RT_AS=khr and off as what fails it.
  • The open check, the GPU run: RTX 5060 Ti, NVIDIA 621.01, Windows 10 19045, MSVC, on the merged branch: d3d12_title_va, d3d12_title_va_shadow and d3d12_title_window_cap pass. Negative control again: with LEONIDA_RT_AS=off d3d12_title_va_test stops at the address check before the submission.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠Snooozs** on GitHub · 2026-11-25 21:24 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1816#issuecomment-7175033678) Thanks @⁠potatoe0100 and @⁠PierreEbele. - Merged current `main` (be2f4026c) into the branch; it was on 0d80bc5df, which may be why the `linux-gpu-tools` and `macos` jobs of the last run failed (`cs_imgatomic_ext` there). This change adds a Windows test and can't reach those jobs. - The two nits are in: the check counts itself (`checks`), and the comment on it names `LEONIDA_RT_AS=khr` and `off` as what fails it. - The open check, the GPU run: RTX 5060 Ti, NVIDIA 621.01, Windows 10 19045, MSVC, on the merged branch: `d3d12_title_va`, `d3d12_title_va_shadow` and `d3d12_title_window_cap` pass. Negative control again: with `LEONIDA_RT_AS=off` `d3d12_title_va_test` stops at the address check before the submission. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠Snooozs on GitHub · 2026-11-26 10:27 UTC · original

The red CI jobs here are failures that main has now too, each with an open fix:

  • windows: vk_xdxr_postbuild_readback fails in 0.02 s on the runner (no device with bufferDeviceAddress), fix #1418.
  • linux-gpu-tools build: vk_null_descriptor_test.cpp:97 uses LEONIDA_TEST_NULL_DESCRIPTORS_SPV, which only exists when glslangValidator is found, fix #2055.
  • macos: cs_imgatomic_ext fails on MoltenVK, fix #1518.

Nothing in this PR touches those files. AI-assisted (Claude Code).

**@⁠Snooozs** on GitHub · 2026-11-26 10:27 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1816#issuecomment-7189397972) The red CI jobs here are failures that `main` has now too, each with an open fix: - `windows`: `vk_xdxr_postbuild_readback` fails in 0.02 s on the runner (no device with bufferDeviceAddress), fix #1418. - `linux-gpu-tools` build: `vk_null_descriptor_test.cpp:97` uses `LEONIDA_TEST_NULL_DESCRIPTORS_SPV`, which only exists when glslangValidator is found, fix #2055. - `macos`: `cs_imgatomic_ext` fails on MoltenVK, fix #1518. Nothing in this PR touches those files. AI-assisted (Claude Code).
Author
Owner

@⁠BadgersMC on GitHub · 2026-11-26 14:49 UTC · original

Independent native Windows GPU check of 97070ee127 merged locally onto upstream fbf100b1b1 (#2350). The merge was clean and the staged diff touched only runtime/test/d3d12_title_va_test.cpp.

  • d3d12_title_va, d3d12_title_va_shadow, and d3d12_title_window_cap all passed. The two BVH readbacks each returned the expected bounds, (-5, 0, 1) to (4, 8, 9).
  • Negative control: LEONIDA_RT_AS=off failed at aliases.shader_va(va + at) != va + at before submitting the BVH command list. This confirms the fixture detects the missing address translation.

RTX 3060 Ti 8 GiB, NVIDIA 610.88, Windows 11 build 26100, MSVC 19.44 RelWithDebInfo. Synthetic inputs only. AI-assisted testing.

**@⁠BadgersMC** on GitHub · 2026-11-26 14:49 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1816#issuecomment-7195388295) Independent native Windows GPU check of `97070ee127` merged locally onto upstream `fbf100b1b1` (#2350). The merge was clean and the staged diff touched only `runtime/test/d3d12_title_va_test.cpp`. - `d3d12_title_va`, `d3d12_title_va_shadow`, and `d3d12_title_window_cap` all passed. The two BVH readbacks each returned the expected bounds, `(-5, 0, 1)` to `(4, 8, 9)`. - Negative control: `LEONIDA_RT_AS=off` failed at `aliases.shader_va(va + at) != va + at` before submitting the BVH command list. This confirms the fixture detects the missing address translation. RTX 3060 Ti 8 GiB, NVIDIA 610.88, Windows 11 build 26100, MSVC 19.44 RelWithDebInfo. Synthetic inputs only. AI-assisted testing.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1816/head:github-bot/gh-1816'
git switch 'github-bot/gh-1816'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1816'
git switch 'github-bot/gh-1816'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1816'
git switch 'github-bot/gh-1816'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1816'
git switch 'main'
git merge --squash 'github-bot/gh-1816'
git switch 'main'
git merge --ff-only 'github-bot/gh-1816'
git switch 'main'
git merge 'github-bot/gh-1816'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.