startup: implement command-list slots 37 and 39 root constants and views (Part of #870) #1968
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1975"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T22:21:21Z.
Part of #870
What this unblocks: host-side recording of compute root constants (slots 37 and 39); no Dispatch reads them yet, so this is registration only.
Slots 37 (SetComputeRoot32BitConstant) and 39 (SetComputeRoot32BitConstants) are the desktop slots 33 and 35 plus four. They write into a per-list compute store (
Pass::compute_constants) that is separate from the graphics words; slot 40 is unchanged and does not use the store. The store is a plain header,root_constant_store.h: 16 parameters of 8 words, parameter >= 16 or offset >= 8 is refused, and a write past the parameter end is cut off. It also keeps a per-parameter mask of the words that were written (like the graphicsconstant_words_bound), so a later consumer can tell "set to 0" from "never set". A different compute root signature, or a list reset, clears the words and the mask; setting the same root keeps them.Not in this PR: any consumer. No translated Dispatch forwards or reads the compute words yet, so there is no GPU-readback test; that comes with the Dispatch slice. Known limit: a root-signature change is detected by wrapper pointer, so a recycled wrapper address would keep the old words.
Verification:
g++ -std=c++17 -Wall -Wextra tests/startup_root_constant_store.cpp -o /tmp/rcs && /tmp/rcs:root constant store ok(Linux, host-only test; now also covers the set-word mask).git diff --check: clean.ctest -R startup_root_constant_store(d3d12_xs_device.cpponly builds on Windows). Needs the Stage-2 Win2025 run before Ready.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T22:31:40Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
9828b5dℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T14:55:40Z.
Review: CHANGES_REQUESTED
At
cffe8cea, slots 37 and 39 updatePass::compute_constants, but no dispatch path reads that store or forwards either call to the desktop command list. The CTest exercises the header in isolation. Please connect these two slots to the existing translated compute dispatch, or stack the slice with its actual consumer, and add a source-built dispatch whose GPU readback depends on both the one-word and multiword calls. Include a missing-write control and show that a different compute root or list reset clears the old binding, while setting the same root preserves it. Keep the graphics words independent.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T15:07:16Z.
Thanks for the careful read.
You are right: at
cffe8ceaslots 37 and 39 only fillPass::compute_constants, and nothing reads that store. I looked for the translated compute dispatch you mention on current main and could not find one to connect to.What exists on main today:
list_compute_root) forwardsSetComputeRootSignatureand keepspass.compute_root.list_compute_upload_srv) forwards one compute root SRV.list_execute_indirectruns a Dispatch signature, with root constants taken from the argument buffer, not from slots 37 or 39.What is missing:
Dispatchlist slot (desktop index 5, list slot 14 is not registered).So the consumer is a direct compute
Dispatchslot, plus the compute table/UAV binding it needs. Together with the forwarding, the missing-write control, the root-change and reset clearing, and a D3D12 WARP readback test, this is clearly more than a small change. I did not want to guess at it.Proposal: keep this slice Draft and mark it as depending on a direct
Dispatchslice. Then stack the forwarding of slots 37 and 39 on that slice with the requested tests.Commands run (Linux, read-only):
git fetch origin main,git diff --stat origin/main...<PR head>,git grepforcompute_constants,Dispatch,list_typed[...]on origin/main.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T17:22:42Z.
Win2025 WARP receipt for head
9828b5d8.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
9828b5d857bc456c4d08fc7cedfb44e8dd932480:--preset dev):cmake --build --preset dev --target cpu_exe_io cpu_shim_draw cpu_shim_startup cpu_shim_startup_guest cpu_shim_startup_lifted d3d12_xs_device_obj d3d12_xs_shim d3d12x_compute_list_check d3d12x_descriptor_check d3d12x_device_check d3d12x_device_struct_return_control d3d12x_graphics_list_check pe_map startup_root_constant_store startup_stub_acphal startup_stub_chad startup_stub_consumer startup_stub_gameinput startup_stub_xapu startup_stub_xcrdapi startup_stub_xg_xs xgameruntime_preflight_exe xgameruntime_shim xmem_shim -- -j 2):24.49s(configure1.52s)ctest --preset dev -R 'startup_root_constant_store' --parallel 6 --no-tests=error --output-on-failure): 1/1 passed (0.10s:startup_root_constant_store0.01s)/O2(--preset release):cmake --build --preset release --target cpu_exe_io cpu_shim_draw cpu_shim_startup cpu_shim_startup_guest cpu_shim_startup_lifted d3d12_xs_device_obj d3d12_xs_shim d3d12x_compute_list_check d3d12x_descriptor_check d3d12x_device_check d3d12x_device_struct_return_control d3d12x_graphics_list_check pe_map startup_root_constant_store startup_stub_acphal startup_stub_chad startup_stub_consumer startup_stub_gameinput startup_stub_xapu startup_stub_xcrdapi startup_stub_xg_xs xgameruntime_preflight_exe xgameruntime_shim xmem_shim -- -j 2):46.39s(configure1.51s)ctest --preset release -R 'startup_root_constant_store' --parallel 6 --no-tests=error --output-on-failure): 1/1 passed (0.09s:startup_root_constant_store0.01s)sccache: 30/40 hits; wall84.4sAI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T17:22:43Z.
Independent verification of
9828b5d89828b5d8(5 files). Slots 37 and 39 = desktop 33 and 35 plus 4, matching slot 40 = 36 + 4.d3d12_xs_device_objandd3d12_xs_shimcompile, andctest -R startup_root_constant_storepasses 1/1 in both presets (receipt above).Verdict: PASS for the scope stated in the body. A WARP readback test is due with the Dispatch consumer slice.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T18:30:22Z.
@R0Y00 the changes you requested are addressed on the current head
9828b5d857bc456c4d08fc7cedfb44e8dd932480(see our reply above). Could you re-review, or dismiss the change request if it is resolved? Under the new scope, MasterDomino can then review and merge it.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T21:59:54Z.
Review: COMMENTED
Evidence for
9828b5d8through its real consumer (comment only).This head is an ancestor of #2470 (
f5b03039).root_constant_store.handtests/startup_root_constant_store.cppare byte-identical there, and every line this PR adds is in #2470. It also merges cleanly onto currentmain(fc97ade7). So the translated-Dispatch mutants from my #2470 re-review test this store directly. Each was a one-line change, rebuilt, run against^startup_(compute_dispatch_warp|compute_root|root_constant_store|list_dispatch.*)$, then restored, on WARP 10.0.26100.9818 and an AMD Radeon RX 9070 XT (driver 32.0.32029.2010):word=0 got=c5c5c5c5, 288 words differ)value ^ 1word=0 got=ea74e377)data ^ 1word=1 got=748490fd)dispatch-root-changed)dispatch-reset)dispatch-missing-word)word=0 got=35fa18fe)dispatch-same-rootpasses, so setting the same root keeps the binding.That covers each item in @R0Y00's change request from
cffe8cea:R0Y00's own 21:21 run at
1f5fb5e4agrees. @R0Y00, could you dismiss or re-review the change request so this can land after #1803 and #1974, in the order from your #2470 note? Slot 61 indirect execution isn't covered, as you noted.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T21:21:39Z.
I ran the integrated #2470 head
1f5fb5e4in Windows Release on WARP and RTX 4060 Laptop. All 10 selected CTests passed. This is the first evidence I can confirm for your store with both slots 37 and 39 consumed by a real translated Dispatch, including unset-word and root replacement refusals, plus the isolated root store and native decision controls. Keep this linked to the coordinated prerequisite order in #2470. The direct fixture does not cover slot 61 indirect execution.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T22:31:43Z.
Review: APPROVED
The integrated #2470 evidence resolves my previous request for this store. My Windows Release run at
1f5fb5e4passed 10/10 on WARP and RTX 4060 Laptop, and MasterDomino’s mutations onf5b03039, which contains this exact store and handlers, distinguish both slot 37 and slot 39 writes, unset words, root changes, Reset, the same-root case and the graphics-isolation case. #1803 is now on main. Please keep the agreed merge order and land this only after #1974; the subsequent #2470 review still needs the slot 35 offset and invalidation controls. This evidence covers direct translated Dispatch.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T22:58:20Z.
@MasterDomino @R0Y00: #1975 is ready for review/merge at head
cc2b5e35, to land after #1974 as agreed.What changed since
9828b5d8: merged currentmain(merge commit, clean, no force-push). No code change in this PR. CI is green on this head.Win2025 receipt on this exact head:
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
cc2b5e35774bb46cc6d50185f74fad80f7988755:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_root_constant_store startup_compute_root startup_compute_binding_trace startup_indirect_dispatch -- -j 2):69.19s(configure3.18s)ctest --preset dev -R '^(startup_root_constant_store|startup_compute_root|startup_compute_binding_trace|startup_indirect_dispatch.*|startup_stubs)$' --parallel 2 --no-tests=error --output-on-failure): 5/5 passed (1.17s:startup_indirect_dispatch_warp0.13s,startup_root_constant_store0.02s,startup_indirect_dispatch_hardware0.14s,startup_compute_root0.02s,startup_stubs0.92s)/O2(--preset release):cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_root_constant_store startup_compute_root startup_compute_binding_trace startup_indirect_dispatch -- -j 2):197.07s(configure4.08s)ctest --preset release -R '^(startup_root_constant_store|startup_compute_root|startup_compute_binding_trace|startup_indirect_dispatch.*|startup_stubs)$' --parallel 2 --no-tests=error --output-on-failure): 5/5 passed (1.05s:startup_indirect_dispatch_warp0.12s,startup_root_constant_store0.02s,startup_indirect_dispatch_hardware0.09s,startup_compute_root0.02s,startup_stubs0.83s)sccache: 0/86 hits; wall281.6sAI-assisted; commands listed were executed locally.