Repository navigation
runtime: bind published typed buffer outputs with 32-bit components - #3397
Conversation
format_compute_runtime_manifest writes `srv <i> typed table <param> <byte> bytes <n>` for a typed_buffer_srv (buffer_load_format_*, read as Buffer<uint4>), n being the widest load. The stand-in resolves the title's hardware descriptor or slot 18 typed buffer view token as a buffer range and binds a UINT view of its 32-bit components; every other shape is refused with a named reason. Refs R0Y00#3224 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
format_compute_runtime_manifest writes `uav <i> typed table <param> <byte> bytes <n>` for a typed_buffer_uav (buffer_store_format_*, an RWBuffer<uint4>). The stand-in binds it as a UINT typed UAV: a hardware descriptor through the output path of the R0Y00#3302 D16 stores, with the FORMAT checks of the R0Y00#3386 typed inputs (now shared) and an exact component width; a slot 19 token through native_buffer_store_view, the native route's typed-store contract. Typed UAV store support is checked by one helper for both half and 32-bit typed outputs. Refs R0Y00#3224 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bits Review of R0Y00#3386: four mutations of the typed input view still passed. The hardware check now also reads each width through its UINT and SINT FORMATs and through a descriptor based one element into the buffer (new consumer mode dispatch-records32-input-at-<bytes>), and refuses a base 4 bytes in (2 or more components) and a stride field with bit 30. Refs R0Y00#3224 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… bits The gaps the R0Y00#3386 review found in the typed input check exist for the typed outputs too. Each stored width now also writes through its UINT and SINT FORMATs and through a descriptor 8 bytes into the output buffer (shifted for 1 and 2 components, refused as not element-aligned for 3 and 4), and a stride field with word 1 bit 30 is refused. Refs R0Y00#3224 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KelboLive
left a comment
There was a problem hiding this comment.
LGTM — thorough, well-documented.
Adds typed buffer inputs (buffer_load_format_) and outputs (buffer_store_format_) on the published compute route. Helper functions validate gfx10 unified buffer FORMAT, stride, DST_SEL, bounds mode, and typed UAV store support. Manifest emits srv/uav typed table <param> <byte> bytes <n> lines. Dispatch stub resolves table entries, binds UINT views of 32-bit components, and refuses invalid descriptors with precise reasons. Test fixtures cover 1–4 components, UINT/SINT FORMATs, view tokens, and multiple refusal controls per width.
Ready to land.
KelboLive
left a comment
There was a problem hiding this comment.
LGTM — clean, well-tested.
Adds srv/uav typed manifest lines for 32-bit component typed buffer inputs and outputs. typed_dword_format_channels maps gfx10 unified FORMAT codes to channel counts; typed_dword_descriptor validates FORMAT, stride, DST_SEL, and bounds mode; typed_dword_input_view resolves table descriptors and view tokens to UINT views; typed_buffer_store_supported checks UAV_TYPED_STORE capability. Each invalid shape is refused with a named reason. Test fixtures cover 1-4 component inputs and outputs with negative controls.
Ready to land.
KelboLive
left a comment
There was a problem hiding this comment.
LGTM — publishes typed buffer inputs and outputs on the compute manifest route.
Adds srv typed and uav typed manifest lines for buffer_load_format_* and buffer_store_format_* bindings. The runtime reader resolves them as UINT views of 32-bit components with FORMAT/stride/DST_SEL/bounds validation. typed_dword_descriptor checks hardware descriptors; typed_dword_input_view handles view tokens and null buffers. typed_buffer_store_supported checks UAV store capability.
Refusal reasons cover FORMAT width, stride, DST_SEL, swizzle, channel count, element alignment, and token compatibility. Indirect dispatch requires fixed-table raw buffers for typed views.
Tests cover 1-4 component widths, UINT/SINT/FLOAT FORMATs, view tokens, and multiple invalid descriptor controls. Manifest reasons test updated to reject 20-byte typed stores.
Documentation is thorough with clear validation rules and measured results.
KelboLive
left a comment
There was a problem hiding this comment.
LGTM — publishes typed buffer inputs and outputs on the compute manifest route.
Adds srv typed and uav typed manifest lines for buffer_load_format_* and buffer_store_format_* bindings. The runtime reader resolves them as UINT views of 32-bit components with FORMAT/stride/DST_SEL/bounds validation. typed_dword_descriptor checks hardware descriptors; typed_dword_input_view handles view tokens and null buffers. typed_buffer_store_supported checks UAV store capability.
Refusal reasons cover FORMAT width, stride, DST_SEL, swizzle, channel count, element alignment, and token compatibility. Indirect dispatch requires fixed-table raw buffers for typed views.
Tests cover 1-4 component widths, UINT/SINT/FLOAT FORMATs, view tokens, and multiple invalid descriptor controls. Manifest reasons test updated to reject 20-byte typed stores.
Documentation is thorough with clear validation rules and measured results.
|
Reviewed
Gaps 2-4 are in lines that arrive with #3386 and now sit in the shared Minor: the docs say six refusal controls per width; the script now runs 7, 7, 8 and 8. This changes runtime binding, so a start-up run before and after is the useful check; in the 900 s census on #3224, |
|
Review of head MUST
SHOULD
AI-assisted. |
main added an optional identity_dst_sel suffix to the srv buf table line in the manifest writer and the stand-in parser. Keep both, with the typed table branch after each. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… cases The typed input reader took a slot-18 token's record by id, so a content token (X2W_D3D12_VIEW_CONTENT_TOKENS=1) was refused as not a typed buffer view. It now uses token_view, as the other buffer readers do. Tests for checks that no case reached: - word 1 bit 31, and word 3 INDEX_STRIDE and ADD_TID, are refused; - an all-zero input descriptor reads zeros (consumer mode dispatch-records32-input-null); - typed_buffer_srv wider than 16 bytes or not whole dwords gets no manifest; - an indirect Dispatch with an srv typed line is refused. The doc states that this binding is on the manifest route only, which a default run (X2W_NATIVE_SHADERS_ONLY=1 since R0Y00#3449) does not take. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t branch main added the packed_d16_x_uav output path (R0Y00#3389) in the manifest writer, the stand-in's output token and descriptor paths and the manifest reasons test. Both paths are kept: the typed table branch next to the packed_d16_x one, the token and descriptor checks for each kind, and each refusal message. The packed D16 typed UAV store check now uses typed_buffer_store_supported, the helper the typed and half outputs use; its result is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tokens were tested with one component only, so a token check that ignored the stored width would have passed. The 2- and 4-component stores now also write through a slot 19 R32G32_UINT or R32G32B32A32_UINT token 16 bytes into the output, and an R32_UINT token must be refused. The doc states that the outputs, like the inputs, bind on the manifest route only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main added cube SRV manifest reasons and dispatch-cube consumer modes next to this branch's typed rows and records32 modes. Keep both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main added the indexed atomic UAV (R0Y00#3454) parser line and manifest reasons next to this branch's typed output line and 20-byte reasons row. Keep both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@Leyukaka @JohnConnorNPC Thanks. Head is now Conflicts. I merged #3386's resolution of the
Leyukaka's review of
JohnConnorNPC:
Without mutations, these pass on A start-up run before and after (Leyukaka's suggestion) is not done. It would only show a difference with AI-assisted. |
Leyukaka
left a comment
There was a problem hiding this comment.
Reviewed 4932e061 against main 8a30428a. It contains #3386 at 4cd38c90; this covers what it adds on top. Diff reading only, nothing run.
Since 31417719:
- Gap 1, token width (
75ceff67): the 2- and 4-component stores go through anR32G32_UINT/R32G32B32A32_UINTslot 19 token 16 bytes into the output, and anR32_UINTtoken must be refused (tests/startup_compute_typed_buffer_uav_check.py:179-183). The refused view fits its buffer, so the refusal comes from the format check ofnative_buffer_store_view, not from its bounds check. Withslot.typed_bytes→4atsrc/startup_stubs/d3d12_compute_dispatch.inl:1083, both cases change result. - Gaps 2 to 4: the word 1 and word 3 checks are now in
typed_dword_descriptor(d3d12_compute_dispatch.inl:171), which inputs and outputs both call, and the indirect refusal is one expression for both. The cases are in #3386's checks (tests/startup_compute_typed_buffer_srv_check.py:141-143,tests/startup_slot67_indirect_dispatch_check.py:209). The output check itself still sets only word 1 bit 30. - Merges (
ef2b55db,4932e061): theuav typed tableparser branch sits betweenmain'satomicandbufhalf/packed_d16_xbranches (:389). The packed D16 token check and descriptor messages are kept. The inlineCheckFeatureSupportblocks of the half and packed D16 paths becometyped_buffer_store_supported(:190, used at:1201and:1215), which is the same predicate negated.git merge-tree origin/main 4932e061exits 0. - Doc: manifest route only (
docs/experiments/compute-typed-buffer-inputs.md:100); control counts 7, 8, 8 and 9 (:125) match the script.
JohnConnorNPC's points 1 to 3 are addressed by the above.
NIT: docs/experiments/compute-typed-buffer-inputs.md:125 is 153 characters; the file wraps at about 115.
Not covered:
- The
prtest preset includes none ofstartup_compute_typed_buffer_(srv|uav)_*,native_compute_manifest_reasonsorstartup_slot67_indirect_dispatch_*, so the green CI builds these checks without running them. The pass and mutation results are the author's. - No start-up run before and after. As the author notes, it would differ only with
X2W_NATIVE_SHADERS_ONLY=0.
#3386 should merge first; this branch already contains its head, so either order merges cleanly on 8a30428a.
Approve 4932e061.
|
Re-review at Status. The conflict is gone. Delta checked against the code:
MUST: none. SHOULD: none. NIT
AI-assisted. |
* compute: publish comparison_texture_srv and smpc manifests Refs #3224, #2935. In the refreshed #3224 census after #3386 and #3397 landed, SRV kind comparison_texture_srv 2d was the largest remaining unclaimed compiled, no runtime manifest item (33 shaders / 52,008 dispatches). The dispatch reader and the graphics manifest already supported comparison textures and smpc lines; only format_compute_runtime_manifest refused both. - src/direct_compute_cache.cpp: accept comparison_texture_srv alongside texture_srv for a single view of dimension 1D, 2D, 3D or 2D array, emitting the same srv tex line; a cube comparison stays a different kind (cube_comparison_srv) and stays refused by name. A comparison sampler is published as smpc, never smpl: the comparison wins over the LOD limits, as in format_graphics_runtime_manifest and the dispatch reader. The obsolete comparison sampler refusal is gone. - tests/native_compute_manifest_reasons.cpp: publish comparison_texture_srv for all four dimensions, keep the cube-comparison and array refusals, add comparison_texture_srv cube/array refusals, and publish a mixed smp 0, smpl 1, smpc 2 order plus a lone smpc 0. - tests/startup_compute_comparison_srv_check.py: end-to-end coverage for the sampled program (plain + comparison samples of one 2D texture). No-argument controls run on Linux; compile mode publishes through compile_dxil --requests and checks the manifest lines; warp/hardware modes dispatch the published program without X2W_NATIVE_SHADERS and match every volume word against the CPU model, with a wrong-view control (tex3d rewrite refused) and a cube control (DXIL published, no manifest, no translation). Registered in tests/cmake/startup_compute_comparison_srv.cmake and tests/checks/python-linux/comparison-texture-manifest.txt. - Docs: new docs/experiments/compute-comparison-texture-manifest.md, and the stale comparison-sampler refusal notes in docs/experiments.md, docs/experiments/native-compile-dxil-refusals.md and docs/experiments/startup-compute-comparison-sampler.md updated. Linux verification (origin/main 77d63db): form_coverage_check.py, docs_links_check.py and bidi_controls_check.py pass, py_compile passes, git diff --check is clean, the new check's pure-Python controls pass, and native_compute_manifest_reasons passes 0 of 45 manifest reasons wrong against a verbatim extract of the formatter (the full C++ build needs Windows). 5/5 spot-mutations killed on throwaway copies: revert the comparison_texture_srv branch, emit smp instead of smpc, admit dimension 3, let smpl win over smpc, drop the array_count guard. Windows verification (compile_dxil, native CTest, GPU readback) is pending. * test: expect cube comparison shader to compile in comparison SRV controls compile_dxil --requests compiles the cube comparison shader to .cs.cso (requests=1 compiled=1 refused=0) and emits no_manifest for it, so the controls check wrongly expected requests=1 compiled=0 refused=1. Refs #3224, #2935 * compute: publish comparison_texture_srv only for 2D and 2D array The direct translator refuses a compare op unless the dimension is 1, 3 or 5, and dimension 3 is the cube kind, so only tex2d and tex2da can reach the comparison branch of format_compute_runtime_manifest. Restrict it to those two and refuse 1D/3D comparisons by name, like the cube. Refs #3224, #2935 --------- Co-authored-by: Ammar Abdelfattah <241957358+Ammmae0x@users.noreply.github.com>
Refs #3224
Stacked on #3386 (typed buffer inputs). It uses #3386's
typed_bytesslot field and its gfx10 FORMAT helper, and turns #3386's descriptor checks into one function shared by inputs and outputs. Until #3386 merges, this diff also shows #3386's commits. This PR's own commits are4598d597,3d93cffa(docs),31417719and75ceff67(review cases) andd518ea38(measurements).3b5679f7,ef2b55db,91beb2eband4932e061merge #3386 and, through it,mainup to8a30428a. I'll rebase once #3386 lands.Behavior
In @Leyukaka's measurement of #3386, 32 programs (2,001,657 dispatches) move from
SRV kind typed_buffer_srvtoUAV kind typed_buffer_uav, which makes it the largest remaining "compiles, but no runtime manifest" reason. These programs store withbuffer_store_format_xto_xyzw(MUBUF, element index only), which the direct compiler writes as anRWBuffer<uint4>.src/direct_compute_cache.cpp): writesuav <register> typed table <parameter> <byte> bytes <n>, wherenis 4 bytes per stored component. The compiler already refuses mixed store widths on one slot.src/startup_stubs/d3d12_compute_dispatch.inl): binds a UINT typed UAV of the title's 32-bit components whose channel count equals the stored components. It reuses existing paths instead of adding a parallel one:native_buffer_store_view, the in-process native route's typed-store contract, so both routes accept the same views.D3D12_FORMAT_SUPPORT2_UAV_TYPED_STOREis checked by one helper for these outputs, runtime: bind published D16 buffer stores to typed UAVs #3302's half-float ones and compute: publish packed_d16_x_uav runtime manifest (Part of #3224) #3389's packed D16 ones (moved from inline code; behavior unchanged). R32G32B32 has no typed UAV, so 3-component stores are refused by name.docs/experiments/compute-typed-buffer-inputs.md. 8- and 16-bit formats, UNORM, SNORM and 16-bit FLOAT stay refused, because a UINT view does not convert.tests/native_compute_manifest_reasons.cpp: theUAV kind typed_buffer_uavcase now uses a 20-byte width that the line cannot carry. It used to rely on a zero width.mainkeep compute: publish packed_d16_x_uav runtime manifest (Part of #3224) #3389'spacked_d16_xoutput path and compute: indexed atomic UAV dispatch (takeover of #3417) #3454's indexed atomic UAV next to this one: their manifest branches, parser lines, token checks and messages are unchanged.Manifest route only. As on #3386: a default run (
X2W_NATIVE_SHADERS_ONLY=1, since #3449) does not read theuav typedline, and the in-process route still refusestyped_buffer_uavwithview kind 8 is not bound for a natively translated program. The binding applies to runs withX2W_NATIVE_SHADERS_ONLY=0andcompile_dxilmanifests. Binding the kind on the in-process route is a separate change.Not in this PR: whether the 32 programs dispatch translated. A published manifest can still stop at a runtime input check, such as the placed-buffer check of #2860 / #2862.
Tests
tests/startup_compute_typed_buffer_uav_check.py(tests/cmake/startup_compute_typed_buffer_uav.cmake) uses the published route:compile_dxil --requests→<key>.txt→ slot 14 Dispatch on the stand-in._controls(no GPU): source-built stores of 1 to 4 components publishuav 0 typed table 1 32 bytes 4n._warp/_hardware: each of the 384 lanes stores words computed from its element index through a 32-bit FLOAT descriptor of 50 elements, so only those elements change.R32_UINTtoken (312 elements from element 4), and a structured token must be refused.R32G32_UINTorR32G32B32A32_UINTtoken 16 bytes into the output (the consumer's view replaced throughX2W_TEST_DISPATCH_UAV), and anR32_UINTtoken must be refused.dispatch-records32-output-offset). 1 and 2 components store shifted by that much; 3 and 4 components are refused as not element-aligned.no translation.Verification
Branch head
4932e061, onmain8a30428a. Measured atd518ea38(maine3f9a64f) and again at4932e061. Windows 11 build 26300, MSVC x64 Debug, Windows SDK 10.0.26100 DXC, D3D12 debug layer enabled.At
4932e061, 11 passed and 1 skipped (startup_compute_indexed_atomic_uav_warp, 77), on NVIDIA GeForce RTX 4090, driver 32.0.16.1088, with no debug layer errors:startup_compute_typed_buffer_uav_hardware: 1, 2 and 4 components stored their 50 elements, the UINT and SINT FORMATs stored the same words, an 8-byte base shifted the 1- and 2-component stores, theR32_UINTtoken stored 312, the 2- and 4-component tokens stored 50, and 7, 8, 8 and 9 refusal controls passed. The 3-component store was refused withan output typed buffer format does not support typed UAV stores.startup_compute_typed_buffer_srv_hardware: 8, 11, 11 and 12 refusal controls, the token and the null descriptor (runtime: bind published typed buffer inputs with 32-bit components #3386's cases on the shared checks)._controls,native_compute_manifest_reasons(38 cases),startup_slot67_indirect_dispatch_hardware, and the merged pathsstartup_compute_packed_d16_x_uav_controls/_hardware,startup_compute_indexed_atomic_uav_controls/_hardwareandstartup_compute_half_buffer_uav_hardware.Mutations, each applied alone with the shim rebuilt, then reverted. Each fails its check:
slot.typed_bytes→4(Leyukaka's gap 1): fails_hardwareat the 2-component token (word 4 expected 3f800000, read c5c5c5c5).0xfff80000→0xff000000,(words[1] >> 30)→((words[1] >> 30) & 1), and dropping|| slot.typed_bytesfrom the indirect refusal each fail runtime: bind published typed buffer inputs with 32-bit components #3386's checks (details there).31417719): the outputFirstElement→ 0, the dropped element-alignment check, FORMAT rows 1, 2 and 4, and the dropped word 1 bits each fail_hardware. Row 3 is caught only by runtime: bind published typed buffer inputs with 32-bit components #3386's check, because no 3-component typed UAV store runs on this adapter._warp(Microsoft Basic Render Driver 10.0.26100.9818): capability skip (77). WARP reports 4-lane waves and the direct module needs 32. Negative control (at3d93cffa): with the stand-in's parse of theuav typedline disabled,_hardwarefails at word 0 (expected 3f800000, read c5c5c5c5).AI-assisted.
🤖 Generated with Claude Code