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

Merged
tedin7 merged 7 commits from upstream-pr/1938 into main 2026-11-25 14:28:22 +00:00
tedin7 commented 2026-11-24 21:56:44 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T21:56:44Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6592207722 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1938). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T21:56:44Z. --- 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.
chatgpt-codex-connector[bot commented 2026-11-24 22:01:06 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T21:56:57Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7145601993 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1938#issuecomment-7145601993). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T21:56:57Z. --- <!-- 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>
R0Y00 commented 2026-11-24 23:03:08 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T22:18:53Z.

Review: CHANGES_REQUESTED


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6048300874 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1938#pullrequestreview-6048300874). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T22:18:53Z. **Review:** CHANGES_REQUESTED --- 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.
tedin7 commented 2026-11-25 02:02:06 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T01:23:46Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7149500695 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1938#issuecomment-7149500695). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T01:23:46Z. --- 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.
upstream-sync closed this pull request 2026-11-25 15:01:28 +00:00
R0Y00 commented 2026-11-25 15:01:28 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T14:28:09Z.

Review: APPROVED


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6059495084 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1938#pullrequestreview-6059495084). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T14:28:09Z. **Review:** APPROVED --- 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.
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
R0Y00/Xbox2Windows!1931
No description provided.