startup: implement command-list slots 41/43/45/46 root constants and views (Part of #870) #2017

Closed
github-bot wants to merge 4 commits from gh-pr/2017/head into gh-pr/2017/base
Owner

@⁠tedin7 on GitHub · 2026-11-24 23:11 UTC · original
tedin7:x2w-frontier-slots41-46 → main · +228 −16 · 5 files · 4 commits · closed without merging

Part of #870

What this unblocks: compute root CBV/SRV arguments and both root UAV slots on a recording list (slots 41, 43, 45, 46), so compute and UAV-writing draws stop losing their root views.

Slots 41, 43, 45 and 46 are the desktop slots 37, 39, 41 and 42 plus four (compute CBV, compute SRV, compute UAV, graphics UAV). Checked first: none is on main and no open PR touches them (#1975 covers 37/39, #1726 slot 38, #1803 slots 33/35).

  • Slots 41 and 43: the bytes at the title address are copied to desktop memory (upload_from_title, as slot 44 does) and bound on the desktop list. Only with a real compute root set.
  • Slots 45 and 46: recorded only. A copy would lose the shader's writes, so nothing is forwarded until the address maps to a placed desktop buffer.
  • A call is refused when no root is set, the parameter is 16 or higher, or the root signature declares that parameter as another type. A new root signature clears the stored views.
  • The accept/refuse rule is a plain header, root_view_store.h, with a host-only test.

Verification:

  • g++ -std=c++17 -Wall -Wextra -Isrc tests/startup_root_view_store.cpp -o /tmp/rvs && /tmp/rvs: root view store ok (run on Linux).
  • git diff --check: clean.
  • Not run yet: the Win2025 Release build and ctest -R startup_root_view_store. d3d12_xs_device.cpp only builds on Windows, so the wiring is uncompiled. Needs the Win2025 target before merge.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-24 23:11 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2017) `tedin7:x2w-frontier-slots41-46` → `main` · +228 −16 · 5 files · 4 commits · closed without merging Part of #870 What this unblocks: compute root CBV/SRV arguments and both root UAV slots on a recording list (slots 41, 43, 45, 46), so compute and UAV-writing draws stop losing their root views. Slots 41, 43, 45 and 46 are the desktop slots 37, 39, 41 and 42 plus four (compute CBV, compute SRV, compute UAV, graphics UAV). Checked first: none is on main and no open PR touches them (#1975 covers 37/39, #1726 slot 38, #1803 slots 33/35). - Slots 41 and 43: the bytes at the title address are copied to desktop memory (`upload_from_title`, as slot 44 does) and bound on the desktop list. Only with a real compute root set. - Slots 45 and 46: recorded only. A copy would lose the shader's writes, so nothing is forwarded until the address maps to a placed desktop buffer. - A call is refused when no root is set, the parameter is 16 or higher, or the root signature declares that parameter as another type. A new root signature clears the stored views. - The accept/refuse rule is a plain header, `root_view_store.h`, with a host-only test. Verification: - `g++ -std=c++17 -Wall -Wextra -Isrc tests/startup_root_view_store.cpp -o /tmp/rvs && /tmp/rvs`: `root view store ok` (run on Linux). - `git diff --check`: clean. - Not run yet: the Win2025 Release build and `ctest -R startup_root_view_store`. `d3d12_xs_device.cpp` only builds on Windows, so the wiring is uncompiled. Needs the Win2025 target before merge. AI-assisted; commands listed were executed locally.
Compute root CBV and SRV are copied to desktop memory and bound; both UAV slots
are recorded only. A new root signature clears the stored views.
A root UAV or non-upload SRV whose address lies in a live aliased placed buffer (COMMON-tracked, aligned offset, UAV flag for writes) is forwarded at its desktop address plus the known offset. Other addresses stay recorded only. Adds RootViewStore::covers for the Dispatch root-completeness check.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:50:06 +00:00
github-bot closed this pull request 2026-11-26 23:50:06 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:14 UTC · original · edited 2026-11-24 23:22 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-24T23:22:32.257356Z 42c71e2 Draft marked ready
ℹ️ 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 23:14 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2017#issuecomment-7147174980) · edited 2026-11-24 23:22 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"42c71e2a02ddcf1e73df1347fde1f1f2d07175ac","has_any_findings":true,"has_unresolved_findings":true,"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-24T23:22:32.257356Z">2026-11-24T23:22:32.257356Z</relative-time> | `42c71e2` | Draft marked ready | <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>
@ -1580,0 +1581,4 @@
add_executable(startup_root_view_store_check tests/startup_root_view_store.cpp)
target_include_directories(startup_root_view_store_check PRIVATE src)
target_compile_features(startup_root_view_store_check PRIVATE cxx_std_17)
add_test(NAME startup_root_view_store COMMAND startup_root_view_store_check)
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:22 UTC · original

P1 Badge Document the new root-view experiment and its limitations

This adds publicly observable startup behavior and a new CTest, but updates neither the README nor docs/experiments.md, contrary to the public-capability documentation requirement in AGENTS.md. Searching those documents for startup_root_view_store finds no reproduction guidance. Add the host-only test command and describe the implementation boundary—compute CBV/SRV data is copied, while UAV addresses are only recorded—so contributors can reproduce the measured behavior without mistaking stored UAV bindings for working GPU writes.

AGENTS.md reference: AGENTS.md:L208-L209

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-24 23:22 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2017#discussion_r4687906689) **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Document the new root-view experiment and its limitations** This adds publicly observable startup behavior and a new CTest, but updates neither the README nor `docs/experiments.md`, contrary to the public-capability documentation requirement in `AGENTS.md`. Searching those documents for `startup_root_view_store` finds no reproduction guidance. Add the host-only test command and describe the implementation boundary—compute CBV/SRV data is copied, while UAV addresses are only recorded—so contributors can reproduce the measured behavior without mistaking stored UAV bindings for working GPU writes. AGENTS.md reference: [AGENTS.md:L208-L209](https://github.com/R0Y00/Xbox2Windows/blob/42c71e2a02ddcf1e73df1347fde1f1f2d07175ac/AGENTS.md#L208-L209) Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:22 UTC · original

P2 Badge Do not apply the CBV's 64 KiB limit to compute SRVs

When slot 43 binds a root SRV into a buffer larger than 64 KiB, this copies only its first 0x10000 bytes. Root SRVs are not subject to the constant-buffer size limit: a valid shader access such as ByteAddressBuffer.Load(0x10000) will read beyond this upload slice into uninitialized ring memory or the next upload, silently producing incorrect compute results. Resolve the backing buffer/range or otherwise determine the SRV's required extent instead of using the same fixed copy limit for both view types.

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-24 23:22 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2017#discussion_r4687906697) **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Do not apply the CBV's 64 KiB limit to compute SRVs** When slot 43 binds a root SRV into a buffer larger than 64 KiB, this copies only its first `0x10000` bytes. Root SRVs are not subject to the constant-buffer size limit: a valid shader access such as `ByteAddressBuffer.Load(0x10000)` will read beyond this upload slice into uninitialized ring memory or the next upload, silently producing incorrect compute results. Resolve the backing buffer/range or otherwise determine the SRV's required extent instead of using the same fixed copy limit for both view types. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-24 23:31 UTC · original

Please connect this to the shared compute acceptance fixture in #1441/#1974/#1975. The stored UAV address has not reached the native list, and copying an arbitrary CBV/SRV prefix cannot establish the guest range the shader may read. Bind a live placed buffer with a known offset, or constrain a copied read-only range to a validated layout and size. A fenced UAV readback with a nonzero offset and a missing-root refusal should verify that Dispatch records only when all required root arguments are bound.

**@⁠R0Y00** on GitHub · 2026-11-24 23:31 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2017#issuecomment-7147500610) Please connect this to the shared compute acceptance fixture in #1441/#1974/#1975. The stored UAV address has not reached the native list, and copying an arbitrary CBV/SRV prefix cannot establish the guest range the shader may read. Bind a live placed buffer with a known offset, or constrain a copied read-only range to a validated layout and size. A fenced UAV readback with a nonzero offset and a missing-root refusal should verify that Dispatch records only when all required root arguments are bound.
@ -1580,0 +1581,4 @@
add_executable(startup_root_view_store_check tests/startup_root_view_store.cpp)
target_include_directories(startup_root_view_store_check PRIVATE src)
target_compile_features(startup_root_view_store_check PRIVATE cxx_std_17)
add_test(NAME startup_root_view_store COMMAND startup_root_view_store_check)
Author
Owner

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

Fixed in 494df6d6: docs/experiments.md now has a section for slots 41/43/45/46 with the host-only ctest command and the implementation boundary (compute CBV is copied, compute SRV and UAV addresses are only recorded, a stored UAV address is not a working GPU write).

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-25 01:06 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2017#discussion_r4688792030) Fixed in 494df6d6: `docs/experiments.md` now has a section for slots 41/43/45/46 with the host-only ctest command and the implementation boundary (compute CBV is copied, compute SRV and UAV addresses are only recorded, a stored UAV address is not a working GPU write). AI-assisted; commands listed were executed locally.
Author
Owner

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

Fixed in 494df6d6: the 64 KiB prefix copy now applies to the CBV only. A root SRV has no such bound and its extent is unknown, so slot 43 only records the address and binds nothing, so no read can return unrelated ring memory. Win2025 dev and release: 22/22 ctest passed at this head.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-25 01:06 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2017#discussion_r4688792291) Fixed in 494df6d6: the 64 KiB prefix copy now applies to the CBV only. A root SRV has no such bound and its extent is unknown, so slot 43 only records the address and binds nothing, so no read can return unrelated ring memory. Win2025 dev and release: 22/22 ctest passed at this head. AI-assisted; commands listed were executed locally.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-25 10:48 UTC · original

Thanks, this was right: the stored UAV address did not reach the native list, and a prefix copy cannot establish what a root SRV may read.

Pushed 480c6fb7, rebased onto current main (25317c63):

  • Compute root SRV: no prefix copy. An address in the recording's own upload pages, or inside a live aliased placed buffer (COMMON-tracked, 16-byte aligned offset), is bound at its desktop address plus the known offset. Any other address is only recorded.
  • Compute root UAV: bound only when the address lies in a live aliased placed buffer that allows unordered access, so writes land in the title-visible memory at that offset. Otherwise only recorded. Graphics UAV stays recorded only.
  • CBV keeps its copy, which is bounded by the 64 KiB CBV limit.
  • Added RootViewStore::covers(mask), the check a Dispatch will use to record only when every declared root view is bound. tests/startup_root_view_store.cpp covers it, including the missing-root case.
  • docs/experiments.md states this boundary.

Not done yet: the fenced UAV readback with a nonzero offset and the missing-root Dispatch refusal. Both need the direct Dispatch (slot 14) from #1974, which is still open. I will add them here after #1974 lands on main, tied to the shared compute fixture in #1441/#1974/#1975. Until then the binding is unmeasured on a live dispatch; the docs say so.

Verification (local, Linux only):

  • g++ -std=c++17 -Isrc tests/startup_root_view_store.cpp then run: root view store ok
  • git diff --check: clean
  • Windows build and WARP/hardware runs: not run yet.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-25 10:48 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2017#issuecomment-7160208466) Thanks, this was right: the stored UAV address did not reach the native list, and a prefix copy cannot establish what a root SRV may read. Pushed `480c6fb7`, rebased onto current `main` (`25317c63`): - Compute root SRV: no prefix copy. An address in the recording's own upload pages, or inside a live aliased placed buffer (COMMON-tracked, 16-byte aligned offset), is bound at its desktop address plus the known offset. Any other address is only recorded. - Compute root UAV: bound only when the address lies in a live aliased placed buffer that allows unordered access, so writes land in the title-visible memory at that offset. Otherwise only recorded. Graphics UAV stays recorded only. - CBV keeps its copy, which is bounded by the 64 KiB CBV limit. - Added `RootViewStore::covers(mask)`, the check a Dispatch will use to record only when every declared root view is bound. `tests/startup_root_view_store.cpp` covers it, including the missing-root case. - `docs/experiments.md` states this boundary. Not done yet: the fenced UAV readback with a nonzero offset and the missing-root Dispatch refusal. Both need the direct Dispatch (slot 14) from #1974, which is still open. I will add them here after #1974 lands on `main`, tied to the shared compute fixture in #1441/#1974/#1975. Until then the binding is unmeasured on a live dispatch; the docs say so. Verification (local, Linux only): - `g++ -std=c++17 -Isrc tests/startup_root_view_store.cpp` then run: `root view store ok` - `git diff --check`: clean - Windows build and WARP/hardware runs: not run yet. AI-assisted; commands listed were executed locally.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-25 13:51 UTC · original

Closing this PR for now to keep the Windows test queue short. Nothing is wrong with it and the branch stays as it is.

We will reopen it once the queue is clear, re-run the Win2025 WARP checks at its head, and post the result here.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-25 13:51 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2017#issuecomment-7164394230) Closing this PR for now to keep the Windows test queue short. Nothing is wrong with it and the branch stays as it is. We will reopen it once the queue is clear, re-run the Win2025 WARP checks at its head, and post the result here. AI-assisted; commands listed were executed locally.
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:22 UTC · original · reviewed

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 42c71e2a02

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@⁠codex address that feedback".

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-24 23:22 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2017#pullrequestreview-6048988282) · **reviewed** <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `42c71e2a02` <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". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@⁠codex address that feedback". </details>

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.