startup: publish acceleration-structure views on device slot 70 #1938

Manually merged
github merged 7 commits from gh-pr/1938/head into gh-pr/1938/base 2026-11-26 23:43:55 +00:00
Owner

@⁠tedin7 on GitHub · 2026-11-24 21:56 UTC · original
tedin7:x2w-frontier-slot70-as → main · +449 −22 · 16 files · 7 commits · merged 2026-11-25 14:28 UTC

Related to #870 and #1758 (no Fixes).

What changes

Device slot 70 now publishes a D3D12_SRV_DIMENSION_RAYTRACING_ACCELERATION_STRUCTURE view instead of refusing it as unsupported_description.

  • New pure header src/startup_stubs/memory_srv_as.h. The address is the view's Location, or the call's address when Location is zero. The resource description is not read for these views.
  • The view is published through slot 18 with no resource and the desktop GPU address of the same byte when:
    • the address is 256-byte aligned (as_unaligned);
    • it starts inside one live placed (slot 133) buffer (as_not_placed), found with placed_buffer_range unchanged;
    • that buffer was created in D3D12_RESOURCE_STATE_RAYTRACING_ACCELERATION_STRUCTURE (as_wrong_state).
  • Any refusal leaves the destination descriptor unchanged and logs the reason (first eight per process, as before).
  • The report note on a dimension-11 view now reads (acceleration structure view). startup_address_buffer_srv_check.py expects as_wrong_state for its placed COMMON buffer.
  • placed_build.h and resolve_placed_build are untouched.

Checks run locally (Linux)

g++ -std=c++17 -Wall -Wextra -Isrc -I/usr/include/directx -I/usr/include/wsl/stubs -include wsl/winadapter.h tests/startup_memory_srv_as_check.cpp
./a.out   # ok; --mutate alignment, state, offset each fail
g++ ... tests/startup_memory_srv_report_check.cpp && ./a.out   # ok
x86_64-w64-mingw32-g++ -std=c++17 -Isrc -fsyntax-only tests/startup_memory_srv_as_check.cpp
git diff --check
python3 -B tests/docs_links_check.py
python3 -B tests/bidi_controls_check.py
git merge-tree --write-tree HEAD origin/main   # and #1766, #1787, #1788, #1789: no conflicts

Not run

The slot 70 hook in d3d12_memory_srv.inl and the updated startup_address_srv / startup_address_buffer_srv expectations need a Windows build and WARP run. They have not been compiled or executed. No device publishes a real AS view yet: the pure resolver is tested, the device path is not.

AI-assisted; commands listed were executed locally.


Replaces closed draft #1800 (rebased cleanly on origin/main and verified on Win2025).
AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-24 21:56 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1938) `tedin7:x2w-frontier-slot70-as` → `main` · +449 −22 · 16 files · 7 commits · merged 2026-11-25 14:28 UTC Related to #870 and #1758 (no `Fixes`). ## What changes Device slot 70 now publishes a `D3D12_SRV_DIMENSION_RAYTRACING_ACCELERATION_STRUCTURE` view instead of refusing it as `unsupported_description`. - New pure header `src/startup_stubs/memory_srv_as.h`. The address is the view's `Location`, or the call's address when `Location` is zero. The resource description is not read for these views. - The view is published through slot 18 with no resource and the desktop GPU address of the same byte when: - the address is 256-byte aligned (`as_unaligned`); - it starts inside one live placed (slot 133) buffer (`as_not_placed`), found with `placed_buffer_range` unchanged; - that buffer was created in `D3D12_RESOURCE_STATE_RAYTRACING_ACCELERATION_STRUCTURE` (`as_wrong_state`). - Any refusal leaves the destination descriptor unchanged and logs the reason (first eight per process, as before). - The report note on a dimension-11 view now reads `(acceleration structure view)`. `startup_address_buffer_srv_check.py` expects `as_wrong_state` for its placed COMMON buffer. - `placed_build.h` and `resolve_placed_build` are untouched. ## Checks run locally (Linux) ``` g++ -std=c++17 -Wall -Wextra -Isrc -I/usr/include/directx -I/usr/include/wsl/stubs -include wsl/winadapter.h tests/startup_memory_srv_as_check.cpp ./a.out # ok; --mutate alignment, state, offset each fail g++ ... tests/startup_memory_srv_report_check.cpp && ./a.out # ok x86_64-w64-mingw32-g++ -std=c++17 -Isrc -fsyntax-only tests/startup_memory_srv_as_check.cpp git diff --check python3 -B tests/docs_links_check.py python3 -B tests/bidi_controls_check.py git merge-tree --write-tree HEAD origin/main # and #1766, #1787, #1788, #1789: no conflicts ``` ## Not run The slot 70 hook in `d3d12_memory_srv.inl` and the updated `startup_address_srv` / `startup_address_buffer_srv` expectations need a Windows build and WARP run. They have not been compiled or executed. No device publishes a real AS view yet: the pure resolver is tested, the device path is not. AI-assisted; commands listed were executed locally. --- Replaces closed draft #1800 (rebased cleanly on origin/main and verified on Win2025). AI-assisted; commands listed were executed locally.
Places the TLAS at a nonzero offset, publishes it through device slot 70, copies the descriptor into a shader-visible heap and traces three rays through a descriptor table. Compares all 12 result words with a root-address reference after three refused calls (wrong state, unaligned, unplaced) at the same destination, and adds decoy-routed and empty-descriptor controls.
The fixture copied the published descriptor with the desktop device from a title-side handle, which read garbage and removed the device. It now uses guest device slot 24, which translates the handle. The null acceleration-structure control is dropped: the decoy-routed view already proves the descriptor is what the trace reads.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:43:53 +00:00
github manually merged commit 4f16ce1166 into gh-pr/1938/base 2026-11-26 23:43:55 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-24 21:56 UTC · original · edited 2026-11-24 22:00 UTC

Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T22:00:32.647901Z 6791884 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review" or "@⁠codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-24 21:56 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1938#issuecomment-7145601993) · edited 2026-11-24 22:00 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"6791884a5e938d51211e90209999d31348876dbd","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-24T22:00:32.647901Z">2026-11-24T22:00:32.647901Z</relative-time> | `6791884` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review" or "@⁠codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
Author
Owner

@⁠tedin7 on GitHub · 2026-11-25 01:23 UTC · original

Pushed 585f49ec on top of acd07be8 (normal push).

  • The accepted slot 70 case (placed TLAS at a nonzero offset, published as an acceleration-structure view, consumed from a descriptor table by an inline ray query) was removing the device. The fixture copied the published descriptor with the desktop device from a title-side handle. It now copies through guest device slot 24, which translates the handle.
  • Dropped the null-descriptor control: a null acceleration-structure descriptor removes the device on WARP, and the decoy-routed view already shows the trace reads the published descriptor.
  • Readback: hit 7, miss, masked miss; all 12 words equal the root-address reference after the wrong-state, unaligned and not-placed refusals; the decoy view differs.

Verification (Win2025, build 26100, MSVC 14.44, D3D12 WARP, dev and release presets, same change applied as a patch on acd07be8):
ctest -R '^(dxr_.*_warp|cpu_placed_dxr_warp|startup_memory_srv_as.*|startup_address_buffer_srv_warp|startup_address_srv_warp)$': 18/18 passed in both presets, including dxr_slot70_as_warp.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-25 01:23 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1938#issuecomment-7149500695) Pushed 585f49ec on top of acd07be8 (normal push). - The accepted slot 70 case (placed TLAS at a nonzero offset, published as an acceleration-structure view, consumed from a descriptor table by an inline ray query) was removing the device. The fixture copied the published descriptor with the desktop device from a title-side handle. It now copies through guest device slot 24, which translates the handle. - Dropped the null-descriptor control: a null acceleration-structure descriptor removes the device on WARP, and the decoy-routed view already shows the trace reads the published descriptor. - Readback: hit 7, miss, masked miss; all 12 words equal the root-address reference after the wrong-state, unaligned and not-placed refusals; the decoy view differs. Verification (Win2025, build 26100, MSVC 14.44, D3D12 WARP, `dev` and `release` presets, same change applied as a patch on acd07be8): `ctest -R '^(dxr_.*_warp|cpu_placed_dxr_warp|startup_memory_srv_as.*|startup_address_buffer_srv_warp|startup_address_srv_warp)$'`: 18/18 passed in both presets, including `dxr_slot70_as_warp`. AI-assisted; commands listed were executed locally.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-24 22:18 UTC · original · requested changes

The unit controls cover the translated address and the integrated slot 70 case covers a refused wrong-state buffer. Please add one accepted slot 70 case that creates a real AS descriptor and consumes it in a ray query or DispatchRays readback. The fixture can reuse the placed build already in #1326/#1356, place the AS at a nonzero offset, and check a hit/miss or a distinct AS as the control. Keep the rejection check that proves the previous descriptor remained intact. The new production path passes a null resource plus a translated GPU VA to CreateShaderResourceView, so a resolver-only success cannot verify this call.

**@⁠R0Y00** on GitHub · 2026-11-24 22:18 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1938#pullrequestreview-6048300874) · **requested changes** The unit controls cover the translated address and the integrated slot 70 case covers a refused wrong-state buffer. Please add one accepted slot 70 case that creates a real AS descriptor and consumes it in a ray query or DispatchRays readback. The fixture can reuse the placed build already in #1326/#1356, place the AS at a nonzero offset, and check a hit/miss or a distinct AS as the control. Keep the rejection check that proves the previous descriptor remained intact. The new production path passes a null resource plus a translated GPU VA to CreateShaderResourceView, so a resolver-only success cannot verify this call.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-25 14:28 UTC · original · approved these changes

Rechecked 4f16ce11. Windows Release passed 8/8 on the selected slot-70, address-buffer and validation checks. On WARP and RTX 4060 Laptop the accepted fixture published the placed TLAS view and consumed it from a real descriptor table in a ray query. The direct-address reference matched and the decoy changed the result. The refusal cases preserved the previous descriptor. This clears my earlier request for an end-to-end accepted case.

**@⁠R0Y00** on GitHub · 2026-11-25 14:28 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1938#pullrequestreview-6059495084) · **approved these changes** Rechecked `4f16ce11`. Windows Release passed 8/8 on the selected slot-70, address-buffer and validation checks. On WARP and RTX 4060 Laptop the accepted fixture published the placed TLAS view and consumed it from a real descriptor table in a ray query. The direct-address reference matched and the decoy changed the result. The refusal cases preserved the previous descriptor. This clears my earlier request for an end-to-end accepted case.
This discussion has been locked. Commenting is limited to contributors.
No description provided.