Repository navigation
startup: compute input named by a resource heap record a root constant indexes - #2532
Conversation
…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.
…root or heap change
Compute root constants are kept per list next to the graphics ones, in a shared 16 x 8 word store that refuses parameter >= 16 and offset >= 8. A new compute root signature clears them.
Part of R0Y00#870. Forward Dispatch only with a desktop compute pipeline and root bound and group counts within 65535 per axis; refuse otherwise.
…nts, document slot 14
…t against the bound root Slot 43 clears a parameter's binding when a replacement is rejected, slot 33 clears all bindings, and the compute pipeline records its root so a mismatched pair is refused.
Compute root constants are kept per list next to the graphics ones, in a shared 16 x 8 word store that refuses parameter >= 16 and offset >= 8. A new compute root signature clears them.
Part of R0Y00#870. Forward Dispatch only with a desktop compute pipeline and root bound and group counts within 65535 per axis; refuse otherwise.
…nts, document slot 14
…t against the bound root Slot 43 clears a parameter's binding when a replacement is rejected, slot 33 clears all bindings, and the compute pipeline records its root so a mismatched pair is refused.
Conflicts in d3d12_xs_device.cpp and docs/experiments.md resolved by keeping both sides: the pipeline root out-parameter of the stream builder next to the cached-mesh root, the bound root SRV mask next to the recorded upload SRV addresses, and both table entries and document sections. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Conflicts in d3d12_draw.inl and d3d12_xs_device.cpp resolved by keeping both sides: graphics root constants go through the shared store and still mark the words a slot 40 call set. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A device slot 67 placeholder keeps the key of its published request. At
list slot 14 the stand-in loads the stage cs manifest and compiled
program for that key and records the dispatch: raw buffer inputs and
outputs from hardware descriptors in the recorded compute tables, entry
values from the recorded compute root constants. Other manifest lines
leave the pipeline untranslated; a dispatch that cannot be bound
completely is refused with one logged reason and records nothing.
startup_compute_dispatch_{warp,hardware} drives a source-built program
through the stand-in list and reads the output back, with controls
before translation, without a Dispatch and for a refused output.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Dispatches that arrive before the offline translation no longer use up the lines kept for refusals at bind time. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The per-call refusal lines share one small budget, so a run cannot rank
keys by dispatch count. Each key now keeps its Dispatch count, the calls
recorded and the reason and table descriptor of its first refusal; the
periodic totals are followed by the refused dispatches per reason and the
40 keys with the most dispatches. A manifest that exists but cannot be
bound is counted apart from an absent one ("not modelled").
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A `uav <i> tex2d float table <param> <byte> channels 4` manifest line is bound from the token of the unordered access view the title created in its descriptor memory. Everything else is refused with its own reason: an entry that is no such token, a view the desktop did not create, a view that is not 2D, a format a float4 store cannot target, and a texture bound to two slots of one dispatch. Programs without entry values, inputs or outputs load too: the translated root no longer emits an empty range or drops the table when only outputs exist. The fixture stores through the stand-in's own list into a 32x8 RGBA16_FLOAT texture and reads it back with CopyTextureRegion. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A `srv <i> tex2d table <param> <byte>` manifest line is bound from the token of the shader resource view the title created, through the texture the draw path samples for that resource, uploaded first when the title filled it in memory. `smp` lines become static samplers of the translated root. A dispatch is refused, never bound to a null view, when the entry is no such token, the resource has no desktop texture, the view is not 2D or names a packed format, or the upload fails. Sampler heaps, comparison samplers and other texture kinds keep the translation unavailable. The fixture samples a 1x1 texture into the stored words of the raw buffer case; without a view the dispatch is refused and the output is untouched. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…s test The device check drains the debug layer; a draw runs it on every 64th call and the queue's execute drains the rest. A view token whose resource the caller released is the caller's misuse, as on the draw path. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…puts, print every census key A texture is refused only when the same call reads and writes it; two outputs of one texture share the unordered access state. A packed output view format gets its own refusal reason. The census prints every dispatched key instead of the first 40, and the wording on refused calls says what may already be recorded (an input texture upload). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hardware run at head Environment: NVIDIA GeForce RTX 3070 Ti, driver 32.0.16.2101 (NVIDIA 621.01) and Windows 11 Pro build 26300.9974 as reported by the system,
Result: 15/15 passed, 0 failed: 3
Command: Result: each of the 3 tests passed 20/20 consecutive runs (60 This run covers NVIDIA and WARP only. Not covered: any test outside the filters above. |
Upstream now records the compute root and tables (slots 33 and 35) and has its own DllMain with x2w_startup::d3d12_process_terminating, so this branch's flag and DllMain go. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…compute-dispatch-heap-rootconst
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…tch-translated # Conflicts: # docs/experiments.md
…te-dispatch-textures
… into startup/compute-dispatch-heap-rootconst
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
@NiiRoZz #2532 is now in conflict with Could you merge (or rebase onto) current AI-assisted; commands listed were executed locally. |
|
@NiiRoZz I merged current Verification:
AI-assisted; commands listed were executed locally. |
Depends on #2490 (compute dispatch with textures and census; this branch is stacked on it). Refs #2274
What changes
One behaviour: a compute program may take a buffer input from the directly indexed resource heap (root flag 0x400) when the record index is a root constant.
Translator (
tools/startup/gfx2hlsl.py) lowers exactly this form:with no write of
Rand no branch target between the two.Dbecomes a buffer descriptor and the manifest names itEverything else through the heap pointer keeps a refusal that names the form:
s_buffer_load_*then<< 5)s_load of a resource heap record whose index is read from a bufferm0... whose offset is not a root constant shifted left by 5 since the last branch target... of 8 dwordsoffset:modifier... with offset:0x..... through a pointer whose high word is not a constant zeros_load with a register offset through ('resheap',))Dispatch (
src/startup_stubs)Pass::title_view_heap, aViewTablebuilt withresolve_view_table, set and replaced wheretitle_samplersis).srv <i> buf heap rootconst <p> <w>is parsed into the existing slot list. At Dispatch the record address istitle_view_heap.record(uint32(word(p, w)) << 5, 16); from there the descriptor is read and bound by the code atable <p> <byte>record uses. No second binding path.a heap record is outside the list's view heap, before anything is bound, like the other refusals in that loop.Tests
Commit under test:
b6bc3c30(two commits onf67f80a4, the head of #2490; the second only drops one fixture case and adds a sentence to the docs, and the runtime sources are those off5c3c857, which the dispatch runs below were built from). Windows 10.0.26300, MSVC 14.44, LLVM 15llvm-mc.Result:
heap record fixture: 45 instructions reassembled to the recorded words, thenPASS (manifest and HLSL exact; 19 refused controls; graphics, manifest and translator-mutation checks). Expected: the same.mainare compared whole.Result: 7 of 7 passed, no capability skip.
startup_gfx2hlsl_heap_recordstartup_compute_dispatch_warpstartup_compute_dispatch_texture_warpstartup_compute_dispatch_heap_warp(new)startup_compute_dispatch_hardwarestartup_compute_dispatch_texture_hardwarestartup_compute_dispatch_heap_hardware(new)The new dispatch test runs a source-built gfx1013 program (case A of
startup_gfx2hlsl_compute_check.pywith its input loaded from the heap) through the stand-in's list. The input descriptor is only in heap record 2; records 0 and 1 hold the output's descriptor. All 320 output words are read back from the aliased memory and compared.Negative controls of the dispatch test:
refused: no translation, every word keeps its sentinel;0x07ffffff(a record past the heap): onerefused: a heap record is outside the list's view heap, the census names that reason, every word keeps its sentinel and the input is unchanged;word=0 got=c5c5c5c5 expected=ea74e376 (288 words differ)andrefused: an output buffer is also an input.Wider groups, same build:
ctest --preset dev --no-tests=error -R "^startup_compute_|^startup_stream_|^startup_gfx2hlsl_heap_record$": 63 of 63 passed (61 in one run; the twostartup_stream_depth_*tests passed once their executable was built), no capability skip.Pure-Python checks: every check listed in
AGENTS.mdplus everytests/startup_gfx2hlsl_*_check.pyandtests/startup_translator_check.py, each run with no argument: 152 exit 0, 1 exit 77 (startup_run_sh_check.py, a POSIX launcher check that skips on Windows; not a pass).git diff --checkis clean.Measured and not measured
Measured:
s_pack_ll_b32_b16in 3 of them, thenv_fma_mix_f32, an SDWAv_cndmask_b32,buffer_store_format_xyzwand others).Not measured, or a hypothesis:
.failfor such a request keeps it until the request is translated again.🤖 Generated with Claude Code