Skip to content

feat: record compute root signature and descriptor tables (list slots 33 and 35) - #1803

Merged
R0Y00 merged 5 commits into
R0Y00:mainfrom
tedin7:x2w-frontier-compute-root
Nov 25, 2026
Merged

R0Y00 merged 5 commits into
R0Y00:mainfrom
tedin7:x2w-frontier-compute-root

Conversation

@tedin7

@tedin7 tedin7 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #870 (no Fixes).

What this unblocks: a later Dispatch handler (#1441) can read the compute descriptor tables that the title bound with SetComputeRootDescriptorTable.

What

Records the compute descriptor tables of a command list, state only:

  • slot 35 (desktop 31 + 4) SetComputeRootDescriptorTable(parameter, GPU handle). The handle is resolved to the table address in the title's view heap, the same lookup the graphics table (slot 36) uses. It is now shared in resolve_title_table.
  • Slot 33 (SetComputeRootSignature) keeps its existing desktop bind. It also tells the tables about the new signature: a different signature (or none) clears them.
  • SetDescriptorHeaps with a different view heap clears the compute tables too, like the graphics tables.

Dispatch (slot 14) is not touched here. It stays in #1441.

How

  • New portable header src/startup_stubs/list_compute_root.h (ComputeTables), builds with plain g++ on Linux.
  • A parameter at or past 16 is refused and counted (first few logged). A list that is not recording ignores the call.
  • d3d12_xs_device.cpp: one Pass member, one table entry, one line in the slot 33 handler. d3d12_draw.inl: the shared lookup, the slot 35 handler, the clear on a view heap change.
  • Test tests/startup_compute_root.cpp, registered as startup_compute_root.

Verification

Linux:

  • g++ -std=c++17 -Wall -Wextra -Isrc tests/startup_compute_root.cpp and run: ok
  • git diff --check, tests/docs_links_check.py, tests/bidi_controls_check.py: pass

Win2025 (WARP only), head 9c87260b, python3 x2w_pipe.py win2025 1803 --force (default 3-slot pool):

  • Debug (--preset dev) build + ctest: 24/24 passed
  • Release /O2 (--preset release) build + ctest: 24/24 passed
  • Scope: 24 direct downstream tests, including startup_compute_root, startup_stubs, d3d12x_compute_list_warp, cpu_shim_compute_warp, cpu_shim_draw_warp, d3d12x_graphics_list_warp.
  • Hardware tests were excluded (the VM only has WARP).

AI-assisted; commands listed were executed locally.

…33 and 35)

Header-only state in list_compute_root.h with a Linux-testable check. Dispatch (slot 14) is not handled here; the state is exposed through ready() and table() for it. Refs R0Y00#870.
@tedin7

tedin7 commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

Closing this draft for now to help keep the open PR queue manageable; the branch stays preserved on the fork so it can be reopened once the queue clears.

@tedin7 tedin7 closed this Nov 24, 2026
@tedin7 tedin7 reopened this Nov 24, 2026
@tedin7
tedin7 marked this pull request as ready for review November 24, 2026 21:57
@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-24T21:59:51.429672Z 0192a5e 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.

@R0Y00 R0Y00 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Main already binds a desktop compute root signature at slot 33 (6e16e21). This branch registers a state-only handler in the same slot; taking it as written would replace that desktop bind and leave #1974's Pass.compute_root unset. Please preserve the existing bind and focus the remaining delta on slot 35 and descriptor invalidation. Reuse the accepted/rejected dispatch fixture in #1441 and the root-constant cases in #1974/#1975. A nonzero UAV descriptor offset plus one wrong or cleared binding would distinguish the slot 35 path from a default table.

@tedin7

tedin7 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

Verification on head 9c87260b: python3 x2w_pipe.py win2025 1803 --force (default 3-slot pool, WARP).

  • Debug (--preset dev): build ok, ctest 24/24 passed
  • Release /O2 (--preset release): build ok, ctest 24/24 passed
  • Includes startup_compute_root, startup_stubs, d3d12x_compute_list_warp, cpu_shim_compute_warp, cpu_shim_draw_warp, d3d12x_graphics_list_warp

AI-assisted; commands listed were executed locally.

@tedin7
tedin7 requested a review from R0Y00 November 25, 2026 11:18
@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.

@MasterDomino

Copy link
Copy Markdown
Collaborator

Reopening at the unchanged head 9c87260b, per @R0Y00's 21:15 note on #2470: this lands first in the order #1803 → #1974 → #1975 → trimmed #2470 → #2490. @tedin7, it's still your PR, so I've only changed its state.

Where it stands:

  • It merges cleanly onto current main but is 366 commits behind, so CI needs a fresh run.
  • @R0Y00's change request from 0192a5ed is still open.

I'll review the slot 33/35 recording and the heap/root invalidation at this head. That includes keeping the already supported desktop slot-33 bind, plus a mutant control.

AI-assisted.

@MasterDomino MasterDomino left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Review at head 687eb702. It merges current main into 9c87260b; this PR's own changed lines are identical at both commits. It merges cleanly onto main fc97ade7, and CI is green.

@R0Y00, your change request from 0192a5ed looks satisfied on the structural points. Could you re-review, or dismiss it if you agree?

  • Slot 33: it keeps main's desktop compute-root bind (SetComputeRootSignature, compute_root, compute_params, the upload-SRV restore). The only addition there is compute_tables.set_signature(root_info(w)).
  • Slot 35 and invalidation: what's left is slot 35 (list_compute_table), plus clearing the tables on a different compute root and on a slot-32 view-heap change.
    • The tables are also cleared at Close (release_targets resets Pass).
    • Slot 35 on a closed list is ignored.
    • Parameters ≥16 are refused, counted, and logged at most 4 times.
  • Slot 36: its lookup moved into resolve_title_table unchanged, so graphics tables behave as before.

One gap remains against the fixture part of the request.

  • Here: startup_compute_root covers a nonzero descriptor offset and a wrong or cleared binding at header level, but nothing in this PR exercises the slot-35 handler or the slot 32/33 wiring.
  • In the first consumer, #2470's startup_compute_dispatch_*:
    • The table is bound at the heap start.
    • Slot 35 is set again after the root change or reset.
    • Its root-change and reset controls refuse on the entry values before the tables are read.
  • Result: a dropped descriptor offset, a missing clear on a root change and a missing clear on a heap change all pass there; see the mutants below. I'd close this in #2470 (@NiiRoZz) rather than here:
    • Write the descriptors at index ≥1 and pass gpu + k*increment to slot 35.
    • Add a control that sets slot 35, then changes the compute root (or the view heap) and sets the constants again without slot 35, expecting "a table descriptor is not bound".

Minor: the title still says "slots 33 and 35", but slot 33 now only notifies the tables.

Commands and results (Windows 11 build 26300, --preset dev; AMD Radeon RX 9070 XT, driver 32.0.32029.2010; WARP 10.0.26100.9818)

  • cmake --preset dev and cmake --build --preset dev at 687eb702: OK.
  • ctest --preset dev --no-tests=error -R 'startup_compute_root|startup_stubs|d3d12x_compute_list|cpu_shim_compute|cpu_shim_draw|d3d12x_graphics_list|startup_logical_view|startup_draw|desktop_root_signature': 24 run, 22 passed, 0 failed.
    • The _hardware tests ran on the RX 9070 XT.
    • 2 capability skips: startup_logical_view_{warp,hardware} ("adapter accepts 1245184 descriptors directly").
  • #2470 at f5b03039: it contains 9c87260b, every line this PR adds is present, and the header and test are byte-identical. ctest --preset dev --no-tests=error -j1 -R '^startup_compute_dispatch_(warp|hardware)$' -V: 2/2 passed.
    • The debug layer was enabled, with no error message.
    • All 320 words matched, and the 6 refusals behaved as expected.

Mutants (one-line source changes, rebuilt, restored)

mutant startup_compute_root (this PR) startup_compute_dispatch_* (#2470)
no clear on a different signature caught survives
clear() a no-op caught survives
heap-change clear removed (slot 32) survives survives
set_table ignores the parameter (table 0) caught caught ("a table descriptor is not bound")
out-of-range parameter accepted caught (as a crash) survives
slot 33 set_signature call removed survives survives
slot 35 handler a no-op survives caught
slot 35 records parameter 0 survives caught
slot 35 accepted on a closed list not run survives
descriptor offset dropped (the table resolves to the heap start) survives survives

No P1. I have no code changes to request in this PR; the coverage gap above belongs to #2470 or a follow-up.

AI-assisted; commands listed were executed locally.

@R0Y00 R0Y00 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The original slot-33 blocker is resolved. The desktop compute-root bind and parameter upload/restore are preserved. This candidate adds slot 35 table recording and invalidation on compute-root and view-heap changes. I rebuilt 687eb702 in Windows Release and ran ctest --preset release --no-tests=error -R '^(startup_compute_root|startup_stubs)$' -V: 2 passed, 0 skipped. The table offset and invalidation at the real dispatch still need an end-to-end control. I agree with MasterDomino that this belongs on the first consumer, #2470: use a nonzero descriptor index and restore constants after a root or heap change without rebinding slot 35. That check remains a requirement before #2470 lands.

@R0Y00
R0Y00 merged commit 4ce2931 into R0Y00:main Nov 25, 2026
5 checks passed
@tedin7

tedin7 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

@MasterDomino @R0Y00: #1803 is ready for review at head 687eb702.

What changed since 9c87260b: merged current main (merge commit, no force-push). The slot 33 desktop compute bind from main is kept. The delta is only slot 35 table recording and the descriptor/root-signature invalidation. The tests cover a nonzero UAV table offset and a wrong handle that clears the binding. Dispatch consumption is #1974, per the agreed order.

CI is green. Win2025 receipt on this exact head:

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 687eb7028a8be0108cabf1ff1504b5235347462f:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_compute_root startup_indirect_dispatch startup_list_resubmit startup_heap_indexed_root_check startup_storage_root_check startup_logical_view_table_check startup_command_list_slot_names startup_list_queries -- -j 2): 31.25s (configure 2.28s)
    • Test (ctest --preset dev -R '^(startup_compute_root|startup_stubs|startup_indirect_dispatch.*|startup_list_resubmit.*|startup_heap_indexed_root.*|startup_storage_root.*|startup_logical_view_table.*|startup_command_list_slot_names|startup_list_queries.*)$' --parallel 4 --no-tests=error --output-on-failure): 23/23 passed (1.04s: startup_list_queries_default_warp_control 0.09s, startup_indirect_dispatch_warp 0.10s, startup_list_queries_warp 0.12s, startup_command_list_slot_names 0.02s, startup_list_resubmit_nodebug_warp 0.30s, startup_list_resubmit_warp 0.34s, startup_list_resubmit_nodebug_untracked_warp 0.40s, startup_list_resubmit_untracked_warp 0.22s, startup_list_resubmit_hardware 0.20s, startup_list_resubmit_nodebug_hardware 0.20s, startup_indirect_dispatch_hardware 0.07s, startup_stubs 0.86s, startup_list_resubmit_nodebug_untracked_hardware 0.22s, startup_list_resubmit_untracked_hardware 0.22s, startup_list_queries_hardware 0.08s, startup_heap_indexed_root 0.02s, startup_heap_indexed_root_sampler-alone_control 0.02s, startup_heap_indexed_root_bind-unrestorable_control 0.02s, startup_storage_root 0.03s, startup_storage_root_separator_control 0.02s, startup_logical_view_table 0.02s, startup_list_queries_default_hardware_control 0.08s, startup_compute_root 0.02s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_compute_root startup_indirect_dispatch startup_list_resubmit startup_heap_indexed_root_check startup_storage_root_check startup_logical_view_table_check startup_command_list_slot_names startup_list_queries -- -j 2): 46.04s (configure 1.90s)
    • Test (ctest --preset release -R '^(startup_compute_root|startup_stubs|startup_indirect_dispatch.*|startup_list_resubmit.*|startup_heap_indexed_root.*|startup_storage_root.*|startup_logical_view_table.*|startup_command_list_slot_names|startup_list_queries.*)$' --parallel 4 --no-tests=error --output-on-failure): 23/23 passed (1.00s: startup_command_list_slot_names 0.02s, startup_indirect_dispatch_warp 0.09s, startup_list_resubmit_nodebug_warp 0.29s, startup_list_resubmit_warp 0.36s, startup_list_resubmit_nodebug_untracked_warp 0.32s, startup_list_resubmit_untracked_warp 0.22s, startup_list_resubmit_hardware 0.22s, startup_list_resubmit_nodebug_hardware 0.22s, startup_stubs 0.67s, startup_indirect_dispatch_hardware 0.07s, startup_list_resubmit_nodebug_untracked_hardware 0.22s, startup_list_queries_hardware 0.04s, startup_list_resubmit_untracked_hardware 0.22s, startup_heap_indexed_root 0.01s, startup_heap_indexed_root_sampler-alone_control 0.01s, startup_heap_indexed_root_bind-unrestorable_control 0.01s, startup_list_queries_default_warp_control 0.16s, startup_list_queries_warp 0.21s, startup_list_queries_default_hardware_control 0.07s, startup_storage_root 0.03s, startup_storage_root_separator_control 0.02s, startup_logical_view_table 0.02s, startup_compute_root 0.01s)
  • sccache: 3/28 hits; wall 92.5s

AI-assisted; commands listed were executed locally.

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.

3 participants