Repository navigation
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>
|
Measured Of the 112 programs that stopped at
No other program changed manifest state. Whether the 22 bind at Dispatch (the 32-bit FORMAT check) is not measured here; that needs a run. |
Leyukaka
left a comment
There was a problem hiding this comment.
Reviewed 4a2720e0.
Run on a release build of main f2972840 with this PR and 17 other open PRs merged locally, Windows Sandbox, network off, vGPU:
startup_compute_typed_buffer_srv_controlspasses.startup_compute_typed_buffer_srv_hardwarepasses on the hardware backend (the Sandbox's only GPU is the NVIDIA GeForce RTX 5080 vGPU). It covers 50 elements and then zeros for 1 to 4 components, the slot 18 token, and 4/6/6/7 refusals._warpskips (77): WARP has no 32-lane wave.
Test gaps. Each mutation below still passes _hardware:
- The input view always starts at element 0. In
dispatch-records32the descriptor addresses the first byte of the placed input buffer, and the slot 18 token view hasFirstElement0. Mutation:src/startup_stubs/d3d12_compute_dispatch.inl:160view.Buffer.FirstElement = range.offset / element->0. Add a dispatch whose descriptor base is4 * channelsbytes into the input buffer, and expect the words shifted by one element. - The whole-element check has no case. Mutation:
:155droprange.offset % element ||. Add, for 2 or more channels, a descriptor base 4 bytes into the input buffer. It should be refused witha typed input range does not start at a whole elementand leave the output untouched. - Only the FLOAT codes are dispatched (22, 64, 74, 77). Mutation:
:111case 20: case 21: case 22: return 1;->case 22: return 1;(the same holds for the 62/72/75 rows). Add dispatches with FORMAT 20 (UINT) and 21 (SINT), expecting the same raw words. - No case sets word 1 bit 30 or 31. Mutation:
:145drop(words[1] >> 30) ||. Add stride field0x4000 | 4 * channels, which sets bit 30 and keeps the 14-bit stride equal to the element size. It should be refused witha typed input descriptor is swizzled or not bounds-checked by record.
Request changes for the test gaps above.
…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>
|
@Leyukaka Thanks. All four gaps were real, and each now has a case that fails under its mutation. Fixed in
Each mutation was applied on its own, the shim rebuilt, and #3397 (typed outputs, stacked on this PR) had the same four gaps, so I added the matching cases there: UINT/SINT stores, a base 8 bytes into the output (shifted for 1 and 2 components, refused as not element-aligned for 3 and 4), and word 1 bit 30. Under the same procedure, the output AI-assisted. |
KelboLive
left a comment
There was a problem hiding this comment.
LGTM — clean input-side of typed buffer route.
Adds typed_dword_format_channels and typed_dword_input_view for published srv typed inputs. Manifest formatter emits srv <reg> 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. Follows the same patterns as #3397 (typed outputs). Test fixture covers 1–4 components with comprehensive refusal controls.
Ready to land.
KelboLive
left a comment
There was a problem hiding this comment.
LGTM — clean input-side of typed buffer route.
Adds typed_dword_format_channels and typed_dword_input_view for published srv typed inputs. Manifest formatter emits srv <reg> 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. Follows the same patterns as #3397 (typed outputs). Test fixture covers 1–4 components with comprehensive refusal controls.
Ready to land.
Refs #3224
Behavior
In the #3224 census,
SRV kind typed_buffer_srvis the largest gap between compiling a compute program and publishing its manifest. These are programs that read withbuffer_load_format_xto_xyzw(MUBUF, element index only), which the direct compiler reads as aBuffer<uint4>.src/direct_compute_cache.cpp):format_compute_runtime_manifestwritessrv <register> typed table <parameter> <byte> bytes <n>.nis 4 bytes per component of the widest load on that binding;required_bytesis already the maximum over the binding's loads.src/startup_stubs/d3d12_compute_dispatch.inl): the dispatch path resolves the table entry with the existingindirect_table_bufferrange rules and binds a UINT buffer view (R32_UINTtoR32G32B32A32_UINT) over it. A UINT view returns the same bits as the guest format unit only for 32-bit UINT, SINT and FLOAT components, so only those are bound:typed_dword_channels/typed_dword_uint_formatfrom the heap contract (native: read one-channel typed loads through a GPU-selected heap descriptor #3042).docs/experiments/compute-typed-buffer-inputs.md). A typed input on an indirect Dispatch is refused, and the in-processX2W_NATIVE_SHADERSroute is unchanged.Not in this PR:
packed_d16_x_uav. runtime: publish narrow half-float texture UAV stores #3305 appends a field to the sameSlotstruct, so mine goes at the end.Tests
tests/startup_compute_typed_buffer_srv_check.py(tests/cmake/startup_compute_typed_buffer_srv.cmake) uses the published route:compile_dxil --requests→<key>.txt→ slot 14 Dispatch on the stand-in._controls(no GPU): source-built programs for 1 to 4 components publishsrv 0 typed table 1 0 bytes 4n._warp/_hardware: for each width, a 32-bit FLOAT descriptor of 50 elements.R32G32B32A32_FLOATview token (new consumer modedispatch-srv-token-typed).dispatch-records32-input-at-<bytes>); the words read shift by one element.no translation.Verification
Commits
89fd41b0,9a414d17,4a2720e0andda4fe59c(review cases) onmaind418f70e. Windows 11 build 26300, MSVC x64 Debug, Windows SDK 10.0.26100 DXC, D3D12 debug layer enabled._controls: passed._hardware, NVIDIA GeForce RTX 4090, driver 32.0.16.1088: passed atda4fe59c. 1, 2, 3 and 4 components read 50 elements and then zeros, the UINT and SINT FORMATs read the same words, a base one element in shifts them, the token reads the same elements, and 5, 8, 8 and 9 refusal controls passed. No debug layer errors._hardware.FirstElement→ 0 fails at the shifted base, the dropped whole-element check at the 4-byte base, each FORMAT row at its UINT case, and the dropped word 1 bits at the bit 30 stride._warp, Microsoft Basic Render Driver 10.0.26100.9818: capability skip (77). WARP reports 4-lane waves and the direct module needs 32.typedline disabled, the manifest is published but not bound, and_hardwarefails at word 0 (expected 8b02a7f1, read c5c5c5c5). With the change restored, it passes.Regressions on the same build, run with
-R "^startup_compute_(dispatch|dispatch_input|dispatch_texture|dispatch_native|half_buffer_uav|root_srv_dispatch)_(warp|hardware)$":startup_compute_dispatch,_dispatch_input,_dispatch_textureand_root_srv_dispatchon WARP and hardware, and_dispatch_native_hardware._dispatch_native_warpand_half_buffer_uav_warp.startup_compute_half_buffer_uav_hardwarefails, and not because of this change. Its 1-channel D16 store now compiles topacked_d16_x_uav(since94d2803f), whichformat_compute_runtime_manifestdoes not write (no_manifest ... UAV kind unknown). That kind is SimSalabimse's claim on direct compute: untranslated compute shaders of a start-up run ranked by dispatches, with first refusals on main #3224, and this PR changes only the SRV branch. I read this from the code; I did not run that test atmainwithout this change.AI-assisted.
🤖 Generated with Claude Code