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

Closed
tedin7 wants to merge 4 commits from upstream-pr/2017 into main
tedin7 commented 2026-11-24 23:11:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T23:11:12Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6593282867 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2017). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T23:11:12Z. --- 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.
chatgpt-codex-connector[bot commented 2026-11-25 00:04:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:22:29Z.

Review: COMMENTED


💡 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".

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6048988282 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2017#pullrequestreview-6048988282). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T23:22:29Z. **Review:** COMMENTED --- <!-- 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>
chatgpt-codex-connector[bot commented 2026-11-25 01:01:54 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:14:27Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7147174980 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2017#issuecomment-7147174980). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T23:14:27Z. --- <!-- 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>
R0Y00 commented 2026-11-25 01:01:55 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T23:31:41Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7147500610 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2017#issuecomment-7147500610). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T23:31:41Z. --- 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.
chatgpt-codex-connector[bot commented 2026-11-25 01:02:10 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:22:29Z.

Code review location: CMakeLists.txt; line 1112

@@ -1105,6 +1105,11 @@ add_test(NAME startup_translated_sampler_bindings COMMAND startup_translated_sam
 add_test(NAME startup_translated_sampler_bindings_shared_axis_control
     COMMAND startup_translated_sampler_bindings_check --mutate shared-axis)
 set_tests_properties(startup_translated_sampler_bindings_shared_axis_control PROPERTIES WILL_FAIL TRUE)
+# Root descriptor views set through list slots 41, 43, 45 and 46 (src/startup_stubs/root_view_store.h), host-only.
+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)

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 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4687906689 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2017#discussion_r4687906689). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T23:22:29Z. **Code review location:** `CMakeLists.txt`; line 1112 ~~~~diff @@ -1105,6 +1105,11 @@ add_test(NAME startup_translated_sampler_bindings COMMAND startup_translated_sam add_test(NAME startup_translated_sampler_bindings_shared_axis_control COMMAND startup_translated_sampler_bindings_check --mutate shared-axis) set_tests_properties(startup_translated_sampler_bindings_shared_axis_control PROPERTIES WILL_FAIL TRUE) +# Root descriptor views set through list slots 41, 43, 45 and 46 (src/startup_stubs/root_view_store.h), host-only. +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) ~~~~ --- **<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 -->
chatgpt-codex-connector[bot commented 2026-11-25 01:02:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:22:29Z.

Code review location: src/startup_stubs/d3d12_xs_device.cpp; line 2347

@@ -2318,6 +2325,61 @@ void __stdcall list_root_cbv(Wrapper* self, UINT parameter, u64 address)
     }
     pass.root_address[parameter] = (address && readable_window(address, 1)) ? address : 0;
 }
+// Declared type of a root parameter, or ~0u when the root signature has no such parameter.
+unsigned declared_root_type(const std::vector<RootParameter>* params, UINT parameter)
+{
+    return params && parameter < params->size() ? static_cast<unsigned>((*params)[parameter].type) : ~0u;
+}
+void log_root_view_refusal(const char* what, UINT parameter, x2w_startup::RootViewResult result)
+{
+    static LONG refused;
+    if (first_calls(refused, 6)) log("x2w-render %s %u ignored: %s", what, parameter, x2w_startup::root_view_reason(result));
+}
+// List slots 41 / 43 (desktop 37 / 39 + 4), SetComputeRootConstantBufferView / SetComputeRootShaderResourceView.
+// The bytes at the title address are copied to desktop memory and the copy is bound, as for slot 44. The
+// view is dropped from the store when no copy can be made.
+void compute_read_view(Wrapper* self, UINT parameter, u64 address, unsigned wanted, const char* what)
+{
+    auto* list = recording(self);
+    if (!list) return;
+    Pass& pass = pass_of(self);
+    const unsigned declared = declared_root_type(pass.compute_params, parameter);
+    const std::size_t bytes = address ? readable_window(address, 0x10000) : 0;

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 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4687906697 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2017#discussion_r4687906697). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T23:22:29Z. **Code review location:** `src/startup_stubs/d3d12_xs_device.cpp`; line 2347 ~~~~diff @@ -2318,6 +2325,61 @@ void __stdcall list_root_cbv(Wrapper* self, UINT parameter, u64 address) } pass.root_address[parameter] = (address && readable_window(address, 1)) ? address : 0; } +// Declared type of a root parameter, or ~0u when the root signature has no such parameter. +unsigned declared_root_type(const std::vector<RootParameter>* params, UINT parameter) +{ + return params && parameter < params->size() ? static_cast<unsigned>((*params)[parameter].type) : ~0u; +} +void log_root_view_refusal(const char* what, UINT parameter, x2w_startup::RootViewResult result) +{ + static LONG refused; + if (first_calls(refused, 6)) log("x2w-render %s %u ignored: %s", what, parameter, x2w_startup::root_view_reason(result)); +} +// List slots 41 / 43 (desktop 37 / 39 + 4), SetComputeRootConstantBufferView / SetComputeRootShaderResourceView. +// The bytes at the title address are copied to desktop memory and the copy is bound, as for slot 44. The +// view is dropped from the store when no copy can be made. +void compute_read_view(Wrapper* self, UINT parameter, u64 address, unsigned wanted, const char* what) +{ + auto* list = recording(self); + if (!list) return; + Pass& pass = pass_of(self); + const unsigned declared = declared_root_type(pass.compute_params, parameter); + const std::size_t bytes = address ? readable_window(address, 0x10000) : 0; ~~~~ --- **<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 -->
tedin7 commented 2026-11-25 02:01:26 +00:00 (Migrated from github.com)

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

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6049983720 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2017#pullrequestreview-6049983720). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T01:06:22Z. **Review:** COMMENTED --- _No description provided._
tedin7 commented 2026-11-25 02:01:26 +00:00 (Migrated from github.com)

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

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6049983987 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2017#pullrequestreview-6049983987). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T01:06:24Z. **Review:** COMMENTED --- _No description provided._
tedin7 commented 2026-11-25 02:02:14 +00:00 (Migrated from github.com)

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

Code review location: CMakeLists.txt; line 1112

@@ -1105,6 +1105,11 @@ add_test(NAME startup_translated_sampler_bindings COMMAND startup_translated_sam
 add_test(NAME startup_translated_sampler_bindings_shared_axis_control
     COMMAND startup_translated_sampler_bindings_check --mutate shared-axis)
 set_tests_properties(startup_translated_sampler_bindings_shared_axis_control PROPERTIES WILL_FAIL TRUE)
+# Root descriptor views set through list slots 41, 43, 45 and 46 (src/startup_stubs/root_view_store.h), host-only.
+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)

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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4688792030 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2017#discussion_r4688792030). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T01:06:22Z. **Code review location:** `CMakeLists.txt`; line 1112 ~~~~diff @@ -1105,6 +1105,11 @@ add_test(NAME startup_translated_sampler_bindings COMMAND startup_translated_sam add_test(NAME startup_translated_sampler_bindings_shared_axis_control COMMAND startup_translated_sampler_bindings_check --mutate shared-axis) set_tests_properties(startup_translated_sampler_bindings_shared_axis_control PROPERTIES WILL_FAIL TRUE) +# Root descriptor views set through list slots 41, 43, 45 and 46 (src/startup_stubs/root_view_store.h), host-only. +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) ~~~~ --- 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 commented 2026-11-25 02:02:14 +00:00 (Migrated from github.com)

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

Code review location: src/startup_stubs/d3d12_xs_device.cpp; line 2347

@@ -2318,6 +2325,61 @@ void __stdcall list_root_cbv(Wrapper* self, UINT parameter, u64 address)
     }
     pass.root_address[parameter] = (address && readable_window(address, 1)) ? address : 0;
 }
+// Declared type of a root parameter, or ~0u when the root signature has no such parameter.
+unsigned declared_root_type(const std::vector<RootParameter>* params, UINT parameter)
+{
+    return params && parameter < params->size() ? static_cast<unsigned>((*params)[parameter].type) : ~0u;
+}
+void log_root_view_refusal(const char* what, UINT parameter, x2w_startup::RootViewResult result)
+{
+    static LONG refused;
+    if (first_calls(refused, 6)) log("x2w-render %s %u ignored: %s", what, parameter, x2w_startup::root_view_reason(result));
+}
+// List slots 41 / 43 (desktop 37 / 39 + 4), SetComputeRootConstantBufferView / SetComputeRootShaderResourceView.
+// The bytes at the title address are copied to desktop memory and the copy is bound, as for slot 44. The
+// view is dropped from the store when no copy can be made.
+void compute_read_view(Wrapper* self, UINT parameter, u64 address, unsigned wanted, const char* what)
+{
+    auto* list = recording(self);
+    if (!list) return;
+    Pass& pass = pass_of(self);
+    const unsigned declared = declared_root_type(pass.compute_params, parameter);
+    const std::size_t bytes = address ? readable_window(address, 0x10000) : 0;

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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4688792291 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2017#discussion_r4688792291). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T01:06:24Z. **Code review location:** `src/startup_stubs/d3d12_xs_device.cpp`; line 2347 ~~~~diff @@ -2318,6 +2325,61 @@ void __stdcall list_root_cbv(Wrapper* self, UINT parameter, u64 address) } pass.root_address[parameter] = (address && readable_window(address, 1)) ? address : 0; } +// Declared type of a root parameter, or ~0u when the root signature has no such parameter. +unsigned declared_root_type(const std::vector<RootParameter>* params, UINT parameter) +{ + return params && parameter < params->size() ? static_cast<unsigned>((*params)[parameter].type) : ~0u; +} +void log_root_view_refusal(const char* what, UINT parameter, x2w_startup::RootViewResult result) +{ + static LONG refused; + if (first_calls(refused, 6)) log("x2w-render %s %u ignored: %s", what, parameter, x2w_startup::root_view_reason(result)); +} +// List slots 41 / 43 (desktop 37 / 39 + 4), SetComputeRootConstantBufferView / SetComputeRootShaderResourceView. +// The bytes at the title address are copied to desktop memory and the copy is bound, as for slot 44. The +// view is dropped from the store when no copy can be made. +void compute_read_view(Wrapper* self, UINT parameter, u64 address, unsigned wanted, const char* what) +{ + auto* list = recording(self); + if (!list) return; + Pass& pass = pass_of(self); + const unsigned declared = declared_root_type(pass.compute_params, parameter); + const std::size_t bytes = address ? readable_window(address, 0x10000) : 0; ~~~~ --- 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 commented 2026-11-25 11:02:32 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T10:48:53Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7160208466 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2017#issuecomment-7160208466). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T10:48:53Z. --- 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.
upstream-sync closed this pull request 2026-11-25 14:04:25 +00:00
tedin7 commented 2026-11-25 14:05:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T13:51:35Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7164394230 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2017#issuecomment-7164394230). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T13:51:35Z. --- 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.

Pull request closed

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!2010
No description provided.