Repository navigation
compute: name each input view token a dispatch will not bind (Part of #3224) - #3400
Conversation
|
Reviewed
Minor: "names no resource" and "does not name a resource" are hard to tell apart in a census. |
|
Retested Thanks for going through 4980038. The reason table is now a device-free C++ test: every sentence, plus a buffer view and a constant-buffer view that bind. The short-description, wrapper, copied-placement, depth-slot, wrong-kind, and bind controls fail if that guard is dropped. The two resource sentences now say "not a wrapper" and "names an object that is not a resource". Slot 18 forwards every shader-resource view again, graphics included. A past-the-end buffer view there still goes to the desktop and can remove the device. The fixture records that description on its own and does not call slot 18. AI-Assisted |
Leyukaka
left a comment
There was a problem hiding this comment.
Approving bb66d63c. Read by its diff (4980038d..bb66d63c, and the net diff against main 212d4b5f); I did not build or run it.
Point 1. Each weakening from my review now changes a row of the plain startup_input_view_token run (tests/startup_input_view_token_check.cpp):
< 40lowered:short-srv(:134-136) binds instead of the truncated sentence.< 12lowered:short-cbv(:121-124), same.|| !facts.wrapperdropped:wrapper(:149-153) reads "names an object that is not a resource".placement == 2cut:placement(:165-168) reads "has no desktop resource".slot == 21cut:depth(:117-119) reads "unrecognized slot".- wrong-kind owner:
wrong-kind(:155-158) pinsfacts.resource = owner_is_wrapper && owner_is_resourcein the header. The assignment ind3d12_draw.inlis pinned by source text only (startup_compute_input_view_token_check.py:177).
Point 2. Slot 18 is back to main's behaviour: the net diff of d3d12_xs_device.cpp is +14, the fixture export x2w_d3d12_record_uncreated_buffer_srv only. The two resource sentences are now distinct.
Remaining, none blocking:
- The seven
--mutatecontrols change the expected value, not the code. They fail whenever the table is right, so they show nothing the plain run does not. - PR CI does not build or run
startup_input_view_token*: the target is not in theprbuild preset and the names are not in theprtest filter. CI runs only the Python reference and controls (Linux job). The C++ rows rest on your 14/14 onbb66d63cand on my reading of the table. - The PR body still describes the removed slot-18 change ("recorded instead of created") and the
4980038dresults (6 of 6).
git merge-tree against 212d4b5f is clean.
Split the shared refusal into the token's record: unknown, sampler, unordered access, render or depth, truncated views, a non-buffer shader resource view, a missing resource, and a placed or copied resource with no desktop backing. A typed or raw buffer view of a desktop resource still uses the existing range checks. A placed buffer that aliases title memory is bound, and the fixture reads that path back. Refs R0Y00#3224
CreateSampler into the compute CBV/SRV/UAV table faults in the desktop runtime before the dispatch is logged. The fixture now creates the sampler in a one-entry sampler heap and copies that token into the input slot, so the census still refuses it as a sampler. Refs R0Y00#3224
Desktop CreateShaderResourceView removes the device when a buffer view extends past the resource, so the dispatch never reaches its range refusal. That view is now recorded and not created. The past-the-end fixture uses a custom-heap buffer, whose range is checked against the desktop width. Refs R0Y00#3224
A recorded buffer view with no title memory was refused because its heap is not default or upload, before the desktop width was checked. The width check now comes first. A fitting view of that heap still uses the heap sentence. The control fails when the width check is removed. Refs R0Y00#3224
A device-free table covers every refusal and the two views that bind. The controls fail if a threshold, a slot, or the wrapper check is dropped. Slot 18 again forwards every shader-resource view. The past-the-end fixture records its description without that call. Refs R0Y00#3224
A byte-window load still refuses a non-identity component mapping before the token's shape is named. Callers that do not ask for that mapping use the token table as before. Refs R0Y00#3224
bb66d63 to
c4e5785
Compare
Leyukaka
left a comment
There was a problem hiding this comment.
Head c4e5785a, rebased onto main 77d1ba4d. Diff and source reading only, nothing built or run. My approval was on bb66d63c.
git range-diff against bb66d63c: commits 2-4 are unchanged, 1 and 5 differ by rebase context only (main's requires_identity_dst_sel checks now sit in the same function). c4e5785a is new (src/startup_stubs/d3d12_draw.inl, +5/-2).
c4e5785a moves the identity-mapping refusal ahead of input_view_token_refusal (d3d12_draw.inl:2580-2583), for a known slot-18 token of at least 40 bytes. Main also tests the mapping before the owner and the dimension, so every token main refused with an MTBUF sentence gets the same sentence at this head. A slot-17 token still reaches "requires a buffer SRV" (:2585), since the table returns nothing for a constant buffer view of 12 bytes or more. Other tokens get the split sentences, as on bb66d63c.
Missing before I approve this head:
- No run on
c4e5785a. The 14/14 is frombb66d63c, before the rebase. PR CI runs neitherstartup_input_view_token*norstartup_compute_mtbuf_window_*(not in theprtest filter); the Linux job runs only the Python reference and controls. Please postctest --preset dev -j 1 -R "^(startup_input_view_token|startup_compute_input_view_token_|startup_compute_dispatch_input_|startup_compute_mtbuf_window_)"onc4e5785a. - The order from
c4e5785ais not pinned. Intests/startup_compute_mtbuf_window_check.py:128-131theswappedtoken is a buffer view on a valid resource (tests/startup_stream_consumer.cpp:432-437), so the table returns nothing and the mapping sentence comes out in either order. A byte-window token with a swapped mapping and a non-buffer dimension would tell the two orders apart.
Still open, not blocking: the PR body describes the removed slot-18 change ("recorded instead of created") and the 4980038d results.
git merge-tree --write-tree onto origin/main 77d1ba4d: clean.
|
Review of head Checked:
MUST
SHOULD
AI-assisted. |
|
Windows test PC (MSVC,
What ran:
The branch is 5 commits behind main AI-Assisted |
|
Re-check of head Resolved
Still open, not blocking
0 MUST, mergeable, no change request. Merging. AI-assisted. |
Change
Part of #3224. The compute census reported a single "input view is not a desktop buffer" refusal for every input view token that a dispatch does not bind. This PR splits that refusal into named reasons, so a census shows exactly which kind of view stopped the dispatch. It also binds typed and raw buffer views that do have a desktop object.
Two runtime changes came out of the debug-layer runs. Both are needed so the refusal fixture can run without removing the device:
CreateShaderResourceView, so the range refusal can run without the desktop removing the device. That range check now runs before the heap-type check.A byte-window load that asks for identity mapping now refuses a non-identity component mapping before the token table names the view's shape. With that flag off, the token table is unchanged.
The reason order is documented in
docs/experiments/compute-input-view-token.md.Verification
All results below are for commit
c4e5785a88b4442fb088e364127d026b86464076. The branch is 5 commits behind mainaf1cab5ceb7b9ecbe06acf358b5b6477c265de9b(#3389) and still merges cleanly.Windows test PC (MSVC,
--preset dev,-j 1). The command was:It passed 17 of 17 with ctest exit 0.
startup_compute_mtbuf_window_warpdid not run: the WARP adapter reported a 4-lane wave (skip: shader wave32 fixture requires SM 6.6, WaveOps, and a 32-lane wave).startup_compute_mtbuf_window_hardwarepassed. The sevenstartup_input_view_token_*_controltests areWILL_FAILand failed as required.startup_compute_dispatch_output_warpand_hardwarealready fail on main, with "an output token does not identify a slot-19 UAV" (see #3224 (comment)). This PR does not touch them, so they were left out of the regex.Evidence and follow-up
The fixture is hand-built from source words in
tests/startup_stream_consumer.cppand contains no game data. The negative controls instartup_compute_input_view_token_controlsfail if a reason is merged or reordered. For example, deleting the width check makes the past-the-end case report the heap sentence instead of the range sentence. The new order of the identity-mapping refusal is not pinned: theswappedtoken is a buffer view on a valid resource, so that sentence comes out in either order.Checklist
AI-assisted (Cursor)