Skip to content

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

Closed
tedin7 wants to merge 4 commits into
R0Y00:mainfrom
tedin7:x2w-frontier-slots41-46
Closed

tedin7 wants to merge 4 commits into
R0Y00:mainfrom
tedin7:x2w-frontier-slots41-46

Conversation

@tedin7

@tedin7 tedin7 commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

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
tedin7 marked this pull request as ready for review November 24, 2026 23:14
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread CMakeLists.txt Resolved
Comment thread src/startup_stubs/d3d12_xs_device.cpp Resolved
@R0Y00

R0Y00 commented Nov 24, 2026

Copy link
Copy Markdown
Owner

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.

@tedin7
tedin7 force-pushed the x2w-frontier-slots41-46 branch 4 times, most recently from 978d618 to 73f45c1 Compare November 25, 2026 08:27
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.
@tedin7
tedin7 force-pushed the x2w-frontier-slots41-46 branch from 73f45c1 to 480c6fb Compare November 25, 2026 10:48
@tedin7

tedin7 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

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

tedin7 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

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 tedin7 closed this Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants