Skip to content

compute: publish root_buffer_srv compute runtime manifests - #3504

Merged
JohnConnorNPC merged 6 commits into
R0Y00:mainfrom
Ammmae0x:compute/root-buffer-srv-manifest
Nov 30, 2026
Merged

JohnConnorNPC merged 6 commits into
R0Y00:mainfrom
Ammmae0x:compute/root-buffer-srv-manifest

Conversation

@Ammmae0x

@Ammmae0x Ammmae0x commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Refs #3224, #2935

In the #3224 census, SRV kind root_buffer_srv was an unclaimed compiled, no runtime manifest item (10 shaders / 47,110 dispatches). The dispatch reader (src/startup_stubs/d3d12_compute_dispatch.inl) and the graphics manifest already parsed and executed srv <i> buf root <param>; only the compute manifest publisher refused it.

Change

format_compute_runtime_manifest (src/direct_compute_cache.cpp) publishes a root_buffer_srv view as srv <register> buf root <parameter>, only when byte_offset == 0, array_count == 1 and !requires_identity_dst_sel, matching format_graphics_runtime_manifest and the compute Dispatch reader. Any other shape stays refused by name (SRV kind root_buffer_srv, with array appended when array_count != 1), and a root_buffer_srv named in stride_srvs stays refused (stride words from a view that is not one raw vector SRV).

Tests

  • tests/native_compute_manifest_reasons.cpp: publishes a root_buffer_srv at byte offset 0 (srv 0 buf root 1) and keeps the byte-offset, array, identity_dst_sel and stride_srvs refusals.
  • tests/native_compute_manifest_reasons_check.py: the no-manifest case is now the cube comparison sample (SRV kind cube_comparison_srv cube, the sampled program with its image_sample_c_lz dimension patched from 2D to cube) through --requests, --refusals, --watch and triage_run.py. A control keeps verifying the raw-root program publishes srv 0 buf root 1 (CBV at parameter 1) and srv 1 buf root 2 (SRV at parameter 2) via compile_dxil --requests.
  • tests/startup_compute_root_srv_native_check.py (new, with tests/cmake/startup_compute_root_srv_native.cmake and tests/checks/python-linux/root-buffer-srv-manifest.txt): its compile mode publishes the single-root-SRV program through compile_dxil --requests; its warp/hardware modes dispatch the published program through the stand-in without X2W_NATIVE_SHADERS and match all 320 output words against the CPU model, with the root-CBV wrong-kind control (manifest publishes, Dispatch refuses with a compute root input is not a shader resource view parameter).
  • Docs: new note docs/experiments/compute-root-buffer-srv-manifest.md; the refusals doc now uses the cube comparison as its example and records the root-buffer publication rule; docs/experiments.md and docs/experiments/startup-compute-root-srv.md updated.

Linux verification

./out/pe-env/bin/python -B tests/form_coverage_check.py
# form coverage checks passed
./out/pe-env/bin/python -B tests/docs_links_check.py
# Self-test passed. Checked 177 Markdown files and 716 links.
./out/pe-env/bin/python -B tests/bidi_controls_check.py
# (passed)
./out/pe-env/bin/python -B tests/startup_compute_root_srv_native_check.py
# root SRV native controls (single-root program manifest, root CBV variant) passed
python -B tools/run_checks_parallel.py --from-dir tests/checks/python-linux/root-buffer-srv-manifest.txt
# all 1 checks passed
git diff --check
# clean

The manifest-reasons unit test passes 0 of 42 manifest reasons wrong against a verbatim extract of the formatter compiled with the real tests/native_compute_manifest_reasons.cpp on Linux (the full C++ build needs Windows). Five spot-mutations on throwaway copies are all killed: reverting the root_buffer_srv branch (the publish case and the stride case fail), dropping the array_count == 1 guard (the array refusal fails), dropping the byte_offset == 0 guard (the byte-offset refusal fails), admitting requires_identity_dst_sel (the identity refusal fails), and admitting root_buffer_srv in stride_srvs (the stride refusal fails).

Two points for Windows to arbitrate: the _requests check now mixes two request-writing helpers in one --requests directory (the existing one for the root/control requests, the translate one for the cube request), and --refusals on the cube request is new (the Python translator refuses the cube program outright, so the cube case is native-path only).

Fix (WIN-VERIFY round 2)

Windows verification of 1cc8caa7 (dev) passed native_compute_manifest_reasons, native_compute_manifest_reasons_requests, startup_compute_root_srv_dispatch_(warp|hardware) and the form/docs/bidi checks, but startup_compute_root_srv_native_(controls|warp|hardware) failed at compile_dxil: the program loaded its output UAV descriptor from table byte 16 and the native compiler refused it with unaligned descriptor table entry (the store at +0x70).

This head moves the load to table byte 32 (uav 0 table 1 32): make_program() takes a uav_imm (default 0x10, so the Python-translator dispatch test is unchanged) and the native check uses 0x20 with the new dispatch-root-srv-records32 consumer mode, which places the descriptor at byte 32 and zeroes byte 16. The byte-16 program stays as an explicit compile_dxil --requests refusal control (no manifest, no DXIL, a .fail naming the reason), and the plain layout stays as a no-descriptor-at-byte-32 bind refusal control. The root-CBV wrong-kind control moves to the byte-32 program too.

Linux verification of this head: form/docs/bidi pass (177 files, 716 links), the new check's pure-Python controls pass, run_checks_parallel passes 1/1, manifest-reasons 0 of 42 against a verbatim formatter extract, and 5/5 spot-mutations are killed (3 formatter re-runs plus 2 new controls mutations).

Hardening (pre-ready, full 32-thread wave)

Windows verification of 5c686870 passed on hardware: dev 6 passed, 1 skipped and
release 6 passed, 1 skipped, plus the repo health checks, with
startup_compute_root_srv_native_warp skipping 77 on Win11 4-lane WARP
(adapter has no 32-lane waves).

Pre-ready audit found one blocking risk for WARP 1.0.22 (Server 2025, which has
32-lane waves): the native check used the dispatch check's GROUP = (2, 3, 4)
(24 threads), a partial wave under WaveSize(32) that hits the
WaveActiveBallot(true) failure (#3160, which caused CHANGES_REQUESTED on PR
#3427). This head gives the native program its own full 32-thread wave
NATIVE_GROUP = (8, 4, 1) (v_mad_u32_u24 v3, v1, 8, v0, group offset
(tgid_x + 3 * tgid_y) * 32) and dispatches Dispatch(3, 3, 1) (9 groups) for
dispatch-root-srv-records32; 9 groups x 32 threads cover the same 288 active
words with 32 trailing sentinels, still matching
reference(two_srvs=False, offset0=0). dispatch-root-srv stays at
(3, 2, 2), so startup_compute_root_srv_dispatch_check.py is untouched. All
existing controls are kept (byte-16 unaligned refusal, plain-layout refusal,
root-CBV wrong-kind refusal).

Linux verification of this head:

./out/pe-env/bin/python -B tests/startup_compute_root_srv_native_check.py
# root SRV native controls (32-byte records manifest, root CBV variant, byte-16 layout) passed
./out/pe-env/bin/python -B tools/run_checks_parallel.py --from-dir tests/checks/python-linux
# all 59 checks passed
./out/pe-env/bin/python -B tests/form_coverage_check.py
# form coverage checks passed
./out/pe-env/bin/python -B tests/docs_links_check.py
# Self-test passed. Checked 177 Markdown files and 716 links.
./out/pe-env/bin/python -B tests/bidi_controls_check.py
# Checked 2678 tracked source, script and build/CI files: no bidirectional controls.
git diff --check
# clean
git merge-tree --write-tree origin/main HEAD
# exits 0 (origin/main d3e306a7)

An offline harness disassembles the new program (v_mad_u32_u24 v3, v1, 8, v0,
s_mul_i32 s24, s11, 3, s_add_u32 s24, s24, s10, s_mul_i32 s24, s24, 32,
s_load_dwordx4 ... 0x20) and simulates Dispatch(3, 3, 1) x (8, 4, 1):
the index set is exactly 0..287, and reference(two_srvs=False, offset0=0) is
288 active words + 32 trailing sentinels. 6/6 spot-mutations on throwaway
copies are killed: NATIVE_GROUP back to (2, 3, 4) (numthreads pin), the
v_mad multiplier 8 to 2, the group s_mul 32 to 24, a records32
Dispatch(3, 3, 1) assertion back to (3, 2, 2), the consumer records32
dispatch back to (3, 2, 2), and the plain-layout assertion to (3, 3, 1).

Full compile_dxil / native CTest verification needs Windows (this Linux host
cannot build or run them); the dispatch check itself is untouched, so its
Windows run is unchanged.

Windows Verification (ec98a65)

Commit: ec98a6585f7bf18cefda85cdb71213b9257aa2cb
Adapter: NVIDIA GeForce RTX 4050 Laptop GPU (driver 32.0.15.9186)
dev: cmake --build --preset dev --target compile_dxil native_compute_manifest_reasons startup_stream_consumer
dev: ctest --preset dev --no-tests=error -R '^(native_compute_manifest_reasons(_requests)?|startup_compute_root_srv_dispatch_.*|startup_compute_root_srv_native_.*)$' --output-on-failure -> 6 passed, 1 skipped (27.39s)
release: cmake --build --preset release --target compile_dxil native_compute_manifest_reasons startup_stream_consumer
release: ctest --preset release --no-tests=error -R '^(native_compute_manifest_reasons(_requests)?|startup_compute_root_srv_dispatch_.*|startup_compute_root_srv_native_.*)$' -E 'cpu_native_archive_' --output-on-failure -> 6 passed, 1 skipped (21.46s)
Skips (exit 77): Win11 inbox WARP has no 32-lane waves (startup_compute_root_srv_native_warp)
Checks: startup_compute_root_srv_native_check.py, form_coverage_check.py, docs_links_check.py (177 files, 716 links), bidi_controls_check.py (2678 files) -> passed

AI-assisted.

Fix (review: refuse root CBVs at manifest publish time)

Addresses @Leyukaka's SHOULD review of ec98a658 (PRR_kwDOV10-fc8AAAABa9kvmQ): a root CBV got a
published manifest that every Dispatch then refused. compile_dxil now records the root parameter
type on each root_buffer_srv binding (binding.scalar_table: declared_cbv for a root CBV, srv
for a root SRV; src/gfx1013_compute_native.cpp:1928) and format_compute_runtime_manifest
(src/direct_compute_cache.cpp:969) refuses a root CBV (declared_cbv/reflected_cbv) as
SRV kind root_buffer_srv, so the program compiles to DXIL with no manifest instead of publishing
one that never dispatches. Cache serialization already round-trips scalar_table
(src/direct_compute_cache.cpp:96,140); native_mesh57.inl handles direct separately and is
unaffected. The Dispatch bind-time CBV refusal stays as defense in depth.

Tests: tests/native_compute_manifest_reasons.cpp gains declared_cbv/reflected_cbv refusals and
an srv publish case (still publishes for unknown); tests/native_compute_manifest_reasons_check.py
now uses the raw-root program (CBV at parameter 1) as the CBV no-manifest case and the same code under
a pure-SRV root signature as the two-line publish control (srv 0 buf root 1, srv 1 buf root 2);
tests/startup_compute_root_srv_native_check.py wrong-kind control now expects compile_dxil --requests to report no_manifest ... SRV kind root_buffer_srv with .cs.cso but no .txt/.fail,
and Dispatch staying refused with no translation. Docs record the refusal and the ec98a658
Windows results.

Linux verification of this head:

./out/pe-env/bin/python -B tests/startup_compute_root_srv_native_check.py
# root SRV native controls (32-byte records manifest, root CBV variant, byte-16 layout) passed
./out/pe-env/bin/python -B tools/run_checks_parallel.py --from-dir tests/checks/python-linux
# all 59 checks passed
./out/pe-env/bin/python -B tests/form_coverage_check.py
# form coverage checks passed
./out/pe-env/bin/python -B tests/docs_links_check.py
# Self-test passed. Checked 177 Markdown files and 716 links.
./out/pe-env/bin/python -B tests/bidi_controls_check.py
# Checked 2678 tracked source, script and build/CI files: no bidirectional controls.
git diff --check
# clean
git merge-tree --write-tree origin/main HEAD
# exits 0

The manifest-reasons unit test passes 0 of 45 manifest reasons wrong against a verbatim extract
of the formatter compiled with the real tests/native_compute_manifest_reasons.cpp on Linux (the full
C++ build needs Windows). Branch-by-branch mutation audit on throwaway copies, 9/9 killed on the
formatter gate (revert the gate, drop either scalar_table check, flip either != to ==,
drop/flip byte_offset == 0, drop array_count == 1, drop !requires_identity_dst_sel), plus the
publish/refuse matrix for the recording (unknown/srv publish, declared_cbv/reflected_cbv
refuse) killing drop/swap/always-srv/always-declared_cbv recording mutations, and the new
assert_no_manifest helper verified against positive and negative cases.

Full compile_dxil / native CTest verification needs Windows (this Linux host cannot build or run them).

Windows Verification (9e987c4)

Commit: 9e987c4405ae3338fd7fa25716579e0cd2e7615a
Adapter: NVIDIA GeForce RTX 4050 Laptop GPU (driver 32.0.15.9186)
dev: cmake --build out/build/dev --target compile_dxil native_compute_manifest_reasons startup_stream_consumer
dev: ctest --preset dev --no-tests=error -R '^(native_compute_manifest_reasons(_requests)?|startup_compute_root_srv_dispatch_.*|startup_compute_root_srv_native_.*)$' --output-on-failure -> 6 passed, 1 skipped (23.92s)
release: cmake --build out/build/release --target compile_dxil native_compute_manifest_reasons startup_stream_consumer
release: ctest --preset release --no-tests=error -E 'cpu_native_archive_' -R '^(native_compute_manifest_reasons(_requests)?|startup_compute_root_srv_dispatch_.*|startup_compute_root_srv_native_.*)$' --output-on-failure -> 6 passed, 1 skipped (16.38s)
Hardware: startup_compute_root_srv_dispatch_hardware (9.30s dev / 9.22s release) & startup_compute_root_srv_native_hardware (1.87s dev / 1.82s release) -> passed
Skips (exit 77): Win11 inbox WARP has no 32-lane waves (startup_compute_root_srv_native_warp)
Checks: startup_compute_root_srv_native_check.py, form_coverage_check.py, docs_links_check.py (177 files, 716 links), bidi_controls_check.py (2678 files) -> passed

AI-assisted.

Merge (upstream/main ff9dcef, PR #3427)

Merged origin/main ff9dcef0 (PR #3427) into compute/root-buffer-srv-manifest. The only conflict was in tests/startup_stream_consumer.cpp (two hunks, both sides kept verbatim): the records32 descriptor-move condition now includes both dispatch-root-srv-records32 and the X2W_TEST_RECORDS32=1 term, and the dispatch keeps dispatch-root-srv-records32 at (3, 3, 1) before the full_wave ? 3 : 2 / 1 : 2 fallback. Also removed the in-tree reviewer handle in docs/experiments/compute-root-buffer-srv-manifest.md:103 per the review. No #3498 changes folded in.

Linux verification of this head:

./out/pe-env/bin/python -B tests/startup_compute_root_srv_native_check.py
# root SRV native controls (32-byte records manifest, root CBV variant, byte-16 layout) passed
./out/pe-env/bin/python -B tools/run_checks_parallel.py --from-dir tests/checks/python-linux
# all 60 checks passed
./out/pe-env/bin/python -B tests/form_coverage_check.py
# form coverage checks passed
./out/pe-env/bin/python -B tests/docs_links_check.py
# Self-test passed. Checked 179 Markdown files and 719 links.
./out/pe-env/bin/python -B tests/bidi_controls_check.py
# Checked 2682 tracked source, script and build/CI files: no bidirectional controls.
git diff --check
# clean
git merge-tree --write-tree origin/main HEAD
# exits 0

Note on the merge: the merged consumer hunks are a verbatim union of both sides (all 6 lines from both sides asserted present), but the Linux suite cannot see Windows-only consumer code — 4/4 spot-mutations of the merged hunks (drop either records32 condition term, drop the records32 dispatch branch, revert the full_wave ternary) survive all 60 Linux checks on throwaway copies. The consumer behavior is therefore covered by Windows verification, not by the Linux run.

Windows Verification (46c8346)

Commit: 46c8346db81cf448ab65ed395585651d1f1262fe (merge-tree upstream/main -> clean, exit 0)
Host: Windows 11 build 26100.7623, NVIDIA GeForce RTX 4050 Laptop GPU (driver 32.0.15.9186, XBOX2WINDOWS_ADAPTER=NVIDIA), stock D3D12 debug layer unavailable (no D3D12 sev=0/1 warnings)
dev: cmake --build --preset dev --target compile_dxil native_compute_manifest_reasons startup_stream_consumer native_store_replay
dev: ctest --preset dev --no-tests=error -R '^(native_compute_manifest_reasons(_requests)?|startup_compute_root_srv_dispatch_.*|startup_compute_root_srv_native_.*|startup_compute_d16_sample_srv_.*|startup_compute_comparison_srv_.*|native_compute_raw_root)$' --output-on-failure -> 11 passed, 3 skipped (116.84s; root_srv_native_hardware 10.59s, root_srv_dispatch_hardware 18.26s)
release: cmake --build --preset release --target compile_dxil native_compute_manifest_reasons startup_stream_consumer native_store_replay
release: ctest --preset release --no-tests=error -R '^(native_compute_manifest_reasons(_requests)?|startup_compute_root_srv_dispatch_.*|startup_compute_root_srv_native_.*|startup_compute_d16_sample_srv_.*|startup_compute_comparison_srv_.*|native_compute_raw_root)$' -E 'cpu_native_archive_' --output-on-failure -> 11 passed, 3 skipped (131.94s; root_srv_native_hardware 8.80s, root_srv_dispatch_hardware 34.05s)
Skips (exit 77): Win11 inbox WARP has no 32-lane waves (startup_compute_comparison_srv_warp, startup_compute_d16_sample_srv_warp, startup_compute_root_srv_native_warp)
Unit: native_compute_manifest_reasons.exe -> 0 of 59 manifest reasons wrong
Checks: startup_compute_root_srv_native_check.py, form_coverage_check.py, docs_links_check.py (187 files, 738 links), bidi_controls_check.py (2727 files) -> passed

AI-assisted.

Refs R0Y00#3224, R0Y00#2935

format_compute_runtime_manifest publishes ComputeViewKind::root_buffer_srv
as 'srv N buf root R' when byte_offset == 0, array_count == 1 and
!requires_identity_dst_sel, matching format_graphics_runtime_manifest and
the compute Dispatch reader. Other shapes stay refused by name, and
stride_srvs still refuses a root_buffer_srv (not a raw vector SRV).

Tests: native_compute_manifest_reasons gains the publish case plus
byte-offset, array, identity_dst_sel and stride refusals; its --requests
check now uses the cube comparison sample as the no-manifest case and keeps
a control that the raw-root program publishes 'srv 0 buf root 1' and
'srv 1 buf root 2'; a new startup_compute_root_srv_native check publishes
the single-root-SRV program through compile_dxil --requests and dispatches
it (plus the root-CBV wrong-kind control) on WARP and hardware.
…e check

Refs R0Y00#3224, R0Y00#2935

WIN-VERIFY on 1cc8caa refused the single-root-SRV program at compile_dxil:
the native compiler reads descriptor-table entries as 32-byte records, so
the byte-16 UAV load is refused as 'unaligned descriptor table entry'.
Load the descriptor from table byte 32 (uav 0 table 1 32) and dispatch
through the new dispatch-root-srv-records32 consumer mode, which places it
there and zeroes byte 16. The byte-16 program stays as an explicit
compile_dxil refusal control, and the plain layout stays as a
no-descriptor-at-byte-32 bind refusal control.
@Ammmae0x
Ammmae0x marked this pull request as ready for review November 29, 2026 19:07

@Leyukaka Leyukaka 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.

Diff-only review at ec98a65; nothing built or run here.

  • SHOULD: a root CBV gets a published manifest that every Dispatch then refuses. compile_dxil accepts a CBV or SRV root descriptor for a root_buffer_srv binding (src/gfx1013_compute_native.cpp:1923-1927), the formatter emits srv N buf root R without knowing the parameter type, and compute_root_srv_buffer refuses any non-SRV parameter (src/startup_stubs/d3d12_compute_dispatch.inl:614-617). Such a key moves from no_manifest to a manifest that never dispatches. The doc and the CBV control record this, but either refuse it at publish (the root is available in compile_dxil at that point) or give the SRV/CBV split of the affected shaders.
  • The new native check is consistent: group (8, 4, 1) with Dispatch(3, 3, 1) indexes x + 8*y + (tgid_x + 3*tgid_y)*32, so words 0..287 are each written once and reference(two_srvs=False, offset0=0) still applies.
  • startup_compute_root_srv_native_(controls|warp|hardware) results are reported for 5c68687 only (docs/experiments/compute-root-buffer-srv-manifest.md:84-86); none yet for ec98a65, and the PR CI run does not execute them (82 tests, none of these names in the log).
  • Conflicts with #3498 (d99425f): tests/native_compute_manifest_reasons.cpp at the end of main() (keep both sets of blocks, final count + 6) and the "has a line" sentence in docs/experiments/native-compile-dxil-refusals.md:29-30 (both additions needed).

compile_dxil records the root parameter type on each root_buffer_srv
binding (scalar_table) and format_compute_runtime_manifest refuses a root
CBV as SRV kind root_buffer_srv, so a root-CBV program compiles to DXIL
without a manifest instead of publishing one Dispatch always refuses.
The manifest-reasons unit test gains declared_cbv/reflected_cbv refusals
and an srv publish case; the --requests/--refusals/--watch check now
uses the raw-root program as the CBV no-manifest case and a pure-SRV
root signature as the two-line publish control; the native check's
wrong-kind control now expects no manifest and Dispatch still refused
with no translation. Docs record the refusal and ec98a65 Windows
results (dev/release 6 passed, 1 skipped, hardware passed).
@Ammmae0x

Copy link
Copy Markdown
Contributor Author

Addressed @Leyukaka's review on ec98a658 in 9e987c44:

  • Root CBV bindings for root_buffer_srv now record scalar_table (declared_cbv vs srv) in compile_dxil and are refused at manifest publish time as SRV kind root_buffer_srv (compiles to DXIL with no manifest, rather than publishing a manifest Dispatch would always refuse), while keeping Dispatch's bind-time CBV check as defense in depth.
  • Updated tests/native_compute_manifest_reasons.cpp, tests/native_compute_manifest_reasons_check.py, tests/startup_compute_root_srv_native_check.py, and the docs for the new refusal/control expectations.
  • Noted the potential conflict sites with #3498 (tests/native_compute_manifest_reasons.cpp final count + 6 and docs/experiments/native-compile-dxil-refusals.md); I will rebase whichever PR remains if #3498 lands first.

Windows Verification (9e987c44)

Adapter: NVIDIA GeForce RTX 4050 Laptop GPU (driver 32.0.15.9186)
dev: 6 passed, 1 skipped (23.92s) - includes startup_compute_root_srv_native_controls (0.49s) and startup_compute_root_srv_native_hardware (1.87s)
release: 6 passed, 1 skipped (16.38s) - includes startup_compute_root_srv_native_controls (0.44s) and startup_compute_root_srv_native_hardware (1.82s)
Skips (exit 77): startup_compute_root_srv_native_warp (Win11 4-lane WARP lacks 32-lane waves)
Checks: startup_compute_root_srv_native_check.py, form_coverage_check.py, docs_links_check.py (177 files / 716 links), bidi_controls_check.py (2678 files) -> passed

AI-assisted.

@Leyukaka Leyukaka 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.

Re-review of 9e987c4, diff only (nothing built or run here). The root CBV point from ec98a65 is fixed: src/gfx1013_compute_native.cpp:1928-1934 records the root parameter type in scalar_table (declared_cbv / srv), and src/direct_compute_cache.cpp:969-972 publishes srv N buf root R only when it is not a CBV. Stale .csir entries are not reused, since X2W_NATIVE_SHADER_REVISION hashes both files.

CI is green, but its 82-test run lists no manifest_reasons or root_srv test, so the compile_dxil checks that cover the gfx1013_compute_native.cpp assignment (startup_compute_root_srv_native_check.py:200-210) did not run there; the doc says Windows re-verification of this head is pending.

Not blocking:

  • The root CBV refusal reuses the generic SRV kind root_buffer_srv reason, the same text as the offset / array / identity_dst_sel shapes, so triage cannot tell them apart.
  • scalar_table unknown (no root signature) still publishes srv N buf root R.
  • docs/experiments/compute-root-buffer-srv-manifest.md:103 names a reviewer handle in-tree.
  • Mechanical conflicts, keep both sides: with #3498 in tests/native_compute_manifest_reasons.cpp and docs/experiments/native-compile-dxil-refusals.md; with #3427 in tests/startup_stream_consumer.cpp (two hunks).

@Leyukaka Leyukaka 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.

Re-approving on 3939007 (merge of main ff9dcef into 9e987c4). git show --remerge-diff shows only the two conflict hunks in tests/startup_stream_consumer.cpp, both resolved as a union (the PR's dispatch-root-srv-records32 mode and invoke, main's X2W_TEST_RECORDS32 condition and full_wave arguments), plus one reworded doc line; the diff against main is otherwise the one reviewed at 9e987c4 (13 files, +634/-37). CI is green on this head.

Nit, not blocking: after the auto-merge with main's root-UAV support, the assignment at src/gfx1013_compute_native.cpp:1949-1951 also runs for root_buffer_uav, so root UAVs get scalar_table = srv and compile_dxil prints table_view=srv on their u lines (tools/startup/compile_dxil.cpp:214). Limiting it to kind == root_buffer_srv would avoid the misleading label.

@Not-Saii Not-Saii left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review of 393900706b956a961267ed9e6ebcfbe3655172ec: diff read in full, then built and run in an isolated Windows Sandbox (network off, PR tree exported with git archive, read-only). No MUST findings. Approving.

Findings

No MUST.

The change reads correctly. format_compute_runtime_manifest emits srv <reg> buf root <param> only for root_buffer_srv at byte offset 0, array_count == 1, no identity_dst_sel, and a scalar_table that is neither declared_cbv nor reflected_cbv (src/direct_compute_cache.cpp:969-979). Every other shape falls through to view_shape. translate_program records the root parameter type after the existing type check (src/gfx1013_compute_native.cpp:1950-1952). apply_reflected_table_use returns early for root kinds (:2046-2048), and apply_scalar_table_layout only touches accepts_cbv_window kinds, so nothing else writes scalar_table on a root binding. Outside the formatter, scalar_table is read only by the compile_dxil report (tools/startup/compile_dxil.cpp:212-214) and the mesh table branch (src/startup_stubs/native_mesh57.inl:377, which does not apply to root bindings), so emitted DXIL does not change. The frontend cache round-trips the new value: ScalarTable::srv is the last enum value (src/gfx1013_compute_native.h:94), which bounds the read at src/direct_compute_cache.cpp:140. The other checks on compile_dxil report lines match substrings (tests/native_global_load_check.py:160,195, tests/native_wave_request_check.py:203, tests/native_compute_raw_root_check.py:46-47, tests/native_global_store_check.py:315-327), so the appended table_view=... breaks none of them. native_compute_raw_root and native_global_store_* pass in the run below.

Earlier review points: the root CBV is refused at publish time, the in-tree handle is removed, and the #3427 consumer hunks are a union. Still open: #3498 conflicts in tests/native_compute_manifest_reasons.cpp and docs/experiments/native-compile-dxil-refusals.md, and both PRs add the same cube_program() / two_srv_root() / CUBE_REASON to tests/native_compute_manifest_reasons_check.py. Whichever lands second should keep one copy. This head merges cleanly with current main 2ff74a6a (git merge-tree --write-tree).

  • SHOULD (PR body): the Windows verification blocks give commit, adapter and driver, but no Windows build and no debug-layer status. AGENTS.md says GPU reports must identify both. Not blocking: the run below gives them for this head.
  • NIT docs/experiments/compute-root-buffer-srv-manifest.md:67-106: the Verification section is a per-iteration log and is stale at this head. It still says Windows re-verification "is pending" (:88, :106), and it names origin/main 77d63db8 (:67) and 0 of 42 (:70). The unit test prints 0 of 52 here. The passing 9e987c4 and 3939007 runs are only in the PR body. A single result for the final head would read better.
  • NIT (follow-up): the Python translator still publishes srv N buf root R for a root CBV, and tests/startup_compute_root_srv_native_check.py:140-149 pins that behavior. The two publishers now disagree; the Python manifest is refused at Dispatch bind time. A follow-up could make both refuse at publish time.
  • On the earlier root-UAV nit (the assignment at src/gfx1013_compute_native.cpp:1950 also runs for root_buffer_uav): its only effect is table_view=srv on the compile_dxil u report line, so it is cosmetic. Limiting the assignment to root_buffer_srv is still cleaner.

What each test proves

  • native_compute_manifest_reasons: the formatter publishes srv 0 buf root 1 for scalar_table unknown and srv. It refuses byte offset != 0, array, identity_dst_sel, declared_cbv, reflected_cbv, and a root view in stride_srvs. It sets scalar_table directly, so it does not cover the recording in gfx1013_compute_native.cpp.
  • native_compute_manifest_reasons_requests: runs end to end through compile_dxil --requests, --refusals, --watch and triage_run.py. The CBV+SRV root program compiles with no manifest (SRV kind root_buffer_srv). The same code under a pure-SRV root signature publishes both root lines. The cube comparison sample gives the other no-manifest reason. This test covers the recording.
  • startup_compute_root_srv_native_controls: compile_dxil --requests publishes srv 0 buf root 2 and uav 0 table 1 32. The root-CBV variant compiles with no manifest, and the byte-16 program is refused as unaligned descriptor table entry.
  • startup_compute_root_srv_native_{warp,hardware}: the published native translation dispatches without X2W_NATIVE_SHADERS, and all 320 words match the CPU model. The plain layout is refused at bind, and the CBV variant stays at no translation.
  • startup_compute_root_srv_dispatch_{warp,hardware}: the Python-translator path is unchanged by the defaulted uav_imm.
  • Regression on the same code paths: native_compute_raw_root, native_global_store_{encodings,hardware}, and startup_compute_d16_sample_srv_*, which shares the records32 condition and invoke chain in the consumer.

Mutation

Reverted the fix by deleting the root_buffer_srv branch at src/direct_compute_cache.cpp:969-979 in a scratch copy inside the sandbox. The rebuild changed compile_dxil.exe, native_compute_manifest_reasons.exe and native_store_replay.exe, so the build compiled the mutant. 5 of 13 tests failed:

  • native_compute_manifest_reasons: 3 of 52 manifest reasons wrong (both publish cases, plus the stride case, which now gets SRV kind root_buffer_srv)
  • native_compute_manifest_reasons_requests: the pure-SRV key loses its manifest
  • startup_compute_root_srv_native_controls, _warp and _hardware: assert_published finds no manifest

With the file restored from the head (sha256 matches), all 13 pass again.

Evidence (AGENTS.md)

  • Commit: 393900706b956a961267ed9e6ebcfbe3655172ec, configured cmake --preset dev -DX2W_WITH_OPUS=OFF (Debug, MSVC 19.44.35230), with Agility 1.620.2 and app-local WARP directories set.
  • Build: cmake --build --preset dev --target compile_dxil native_compute_manifest_reasons startup_stream_consumer native_store_replay offscreen_check
  • Test: ctest --preset dev --no-tests=error --output-on-failure -V -R '^(native_compute_manifest_reasons(_requests)?|startup_compute_root_srv_(dispatch|native)_.*|startup_compute_d16_sample_srv_.*|native_compute_raw_root|native_global_store_(encodings|hardware))$'
  • Head: 13 passed, 0 failed, 0 skipped (77). Passed: native_compute_raw_root, native_compute_manifest_reasons (0 of 52 manifest reasons wrong), native_compute_manifest_reasons_requests, native_global_store_encodings, native_global_store_hardware, startup_compute_d16_sample_srv_{controls,warp,hardware}, startup_compute_root_srv_dispatch_{warp,hardware}, startup_compute_root_srv_native_{controls,warp,hardware}. The startup_compute_root_srv_native_warp test passed outright on this host's WARP; it did not skip 77 as on the author's Win11 WARP.
  • Mutant: 8 passed, 5 failed (listed above), 0 skipped. Restored: 13 passed, 0 failed, 0 skipped.
  • Base comparison: not needed (no head failures).
  • Adapter: NVIDIA GeForce RTX 4090 through the sandbox vGPU, driver 10.0.26100.1150 as WMI reports it inside the sandbox (the fixtures do not print a driver). Microsoft Remote Display Adapter is also present.
  • OS: Windows 11 Enterprise 10.0.26100 (sandbox; host build 26300).
  • Debug layer: off. The fixtures print debug: unavailable / debug layer: unavailable. A System32 d3d12SDKLayers.dll (10.0.26100.9818) was copied in, and Agility's copy is in the build directory, but the fixtures still did not enable it; they print no HRESULT.
  • CI at this head (run 46308816857, green): the Windows job ran the pr preset's 82 tests, none of them from this PR or the regression set above. The Linux job ran tests/startup_compute_root_srv_native_check.py with no arguments (pure-Python controls only).

@R0Y00 R0Y00 added the priority: P0 Highest project priority label Nov 30, 2026 — with ChatGPT Codex Connector

@Not-Saii Not-Saii left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-review of 46c8346db81cf448ab65ed395585651d1f1262fe, a merge of main 844e57da into 39390070, which I approved earlier. I compared the PR's diff against its merge base before and after the merge (git diff ff9dcef0 39390070 vs git diff 844e57da 46c8346d) and read the conflict resolutions with git show --remerge-diff. I also reran the same sandbox set. Approving.

What the merge changed in the PR's work

  • Conflicts, all resolved as unions.
    • src/direct_compute_cache.cpp: the root_buffer_srv branch is unchanged, and main's typed_dword_view_bytes condition on the next branch is kept.
    • tests/native_compute_manifest_reasons.cpp: both root-SRV blocks and main's two smpc sampler blocks are kept. The count is + 8 (main's 6 plus the PR's 2), and the test prints 0 of 59.
    • tests/startup_stream_consumer.cpp: the records32 condition keeps both dispatch-root-srv-records32 and main's native_totals.
    • docs/experiments/native-compile-dxil-refusals.md: the root-SRV sentence is merged into main's comparison-texture wording.
  • One behavior change inside the merge commit: src/gfx1013_compute_native.cpp:2060-2063 now records scalar_table only for root_buffer_srv, so a root UAV keeps unknown. This resolves the earlier root-UAV label nit. Root UAVs are back to main's behavior, and the root-SRV path is unchanged. NIT: next time, put a behavior change like this in its own commit rather than the merge.
  • Docs: docs/experiments/compute-root-buffer-srv-manifest.md no longer says verification is pending. It records the 3939007 Windows run and says the merge head is unverified; the run below covers it. :67 still names origin/main 77d63db8 (minor).
  • No downloads, network calls, CI, CMake or agent-config changes in the PR's diff. The PR touches the same 13 files as before.

Sandbox rerun at 46c8346

Same commands as the previous review: cmake --preset dev -DX2W_WITH_OPUS=OFF (Debug, Agility 1.620.2 and app-local WARP), the five targets, and ctest --preset dev --no-tests=error --output-on-failure -V -R '^(native_compute_manifest_reasons(_requests)?|startup_compute_root_srv_(dispatch|native)_.*|startup_compute_d16_sample_srv_.*|native_compute_raw_root|native_global_store_(encodings|hardware))$'.

  • Head: 13 passed, 0 failed, 0 skipped (77). native_compute_manifest_reasons prints 0 of 59 manifest reasons wrong. startup_compute_root_srv_native_warp passes outright.
  • Mutation: the same revert (delete the root_buffer_srv publish branch, now at src/direct_compute_cache.cpp:1078-1088). The rebuild relinked compile_dxil.exe and native_compute_manifest_reasons.exe. Result: 8 passed, 5 failed:
    • native_compute_manifest_reasons: 3 of 59 manifest reasons wrong
    • native_compute_manifest_reasons_requests
    • startup_compute_root_srv_native_controls, _warp and _hardware
  • Restored from head (sha256 matches): 13 passed, 0 failed, 0 skipped.
  • Base comparison: not needed (no head failures).
  • Adapter: NVIDIA GeForce RTX 4090 through the sandbox vGPU, driver 10.0.26100.1150 (WMI inside the sandbox). OS: Windows 11 Enterprise 10.0.26100.
  • Debug layer: enabled this time. A System32 d3d12SDKLayers.dll probe returned D3D12GetDebugInterface hr=0x00000000, and the fixtures print debug layer: enabled / debug: enabled, no error message.
  • CI at this head (run 46421844696) is green. As before, its Windows pr preset runs none of these tests.

The earlier findings still stand, minus the root-UAV nit: the SHOULD on missing Windows build and debug-layer fields in the PR body's GPU reports, and the Python-translator root-CBV follow-up. Neither blocks.

@JohnConnorNPC

Copy link
Copy Markdown
Collaborator

Review of 46c8346: merge-ready, no MUST.

  • The 11-line formatter branch is exact. Seven mutants of it (offset, array count, identity dst-sel, declared and reflected CBV guards, branch disabled, wrong register field) each turn native_compute_manifest_reasons red (baseline 0 of 59 wrong).
  • A trial merge into current main has no conflicts. The earlier reviewers' approvals are on this head and all threads are resolved.
  • Hygiene is clean: noreply authors, no trailers, no binaries.

SHOULD

  1. The new Windows tests (native_compute_manifest_reasons, startup_compute_root_srv_native_*) did not run in the CI preset: the Windows job passed 87 tests and none of them. A later regression would pass CI. Consider adding them to the preset in a follow-up.

NIT
2. startup_compute_root_srv_native_warp is a capability skip (77), since 4-lane WARP lacks 32-lane waves. Only the hardware test covers the dispatch.

AI-assisted.

@JohnConnorNPC
JohnConnorNPC merged commit 7f13a4c into R0Y00:main Nov 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: P0 Highest project priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants