startup: translated compute Dispatch with 2D texture views, static samplers and a per-key census #2490
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!2490
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2490"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@NiiRoZz on GitHub · 2026-11-25 18:30 UTC · original
NiiRoZz:startup/compute-dispatch-textures→main· +1008 −10 · 9 files · 47 commits · openDepends on #2470 (stacked on its branch, which itself carries #1803, #1974 and #1975); the new code is the last seven commits.
Why
A run of a console package with the first slice recorded no translated Dispatch. Its log and shader cache, counted
offline (counts only):
40 a raw buffer input, 9 a static sampler, 6 the
strideanddescword3entry values, 48 declare no entryvalue, 8 have no view at all, and none has a raw buffer output;
raw buffer, 6 declare no entry value, none uses a sampler;
keys by Dispatch count.
What changes
8e14a74b). Each key keeps its Dispatch count, the calls recorded, and the reason and tabledescriptor of its first refusal. The periodic totals line gains
not modelled <n>(a manifest exists but holdsa line the runtime does not bind, counted apart from an absent manifest) and is followed by the refused calls
per reason and every dispatched key by call count.
f2f7bfcc).uav <i> tex2d float table <param> <byte> channels 4is bound from thetoken of the unordered access view the caller created (device slot 19). Refused, each 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 packed view format, a format a
float4store cannot target (integer, typeless), a texture that is also an input of the same call. Programs
without entry values, inputs or outputs now load: the translated root no longer emits an empty range, and keeps
its table when only outputs exist.
15e8b7ab).srv <i> tex2d table <param> <byte>is bound from thetoken of a shader resource view (device slot 18) through the texture the draw path samples for that resource,
uploaded first when the caller filled it in memory.
smplines become static samplers. Refused: no such token,no desktop texture, a view that is not 2D, a packed view format, a failed upload.
No view is bound null. A refused call records no Dispatch and binds nothing; the upload of an input texture the
caller filled in memory may already be recorded, which only syncs content.
With these line forms, 55 of the 61 manifests load, including all 7 the run dispatched (offline count against the
manifest text; the 6 others need
strideanddescword3).Not in this change
strideanddescword3entry values (6 manifests, none among the 7 dispatched).says a dispatched program needs it; the census of the next run will.
output of the same call (a mip chain pass), packed view formats.
Evidence
Commit under test:
d0b9e774for the four tests below;d3c396ccfor the neighbouring run (the commits between them throttle a device check, drop a liveness test, narrow the same-texture refusal to input against output, refuse packed output formats by name and print every census key). Windows 11 build 26300.startup_compute_dispatch_warpstartup_compute_dispatch_texture_warpstartup_compute_dispatch_hardwarestartup_compute_dispatch_texture_hardwareback through CopyTextureRegion on the stand-in's list. Expected: mip 0 of the fixture's CPU reference (64 halves
changed). Negative controls, same run: before the offline translation, without a Dispatch, and with a texture
that has no unordered access, every half keeps its sentinel and the refusal is logged once.
word. Expected: the case's 288 written words XOR the bits of 1.0f, the 32 others untouched. Negative control: no
view at the table entry, the dispatch is refused and every word keeps its sentinel.
ud 0.Neighbouring tests,
ctest --preset dev --no-tests=error -R '^startup_|sampler|list_copy|compute' -j 6: 864 selected, 860 passed, 0 failed. Capability skips, reported apart (4):startup_view_heap_warp,startup_small_texture_4k_addrlib,startup_logical_view_warp,startup_run_sh.Limits and open points
mode the static sampler has.
(one register field changed); the check asserts that the translation reads it as written, llvm-mc did not
assemble it here.
ud 0case uses an edited manifest on a program compiled with three unused entry values.something measured for compute; the census prints the first refused descriptor per key to settle it.
can show that this is right.
of about 1,500 Dispatch calls per frame and a few views each, the ring wraps after tens of frames; that a
recorded list never outlives a wrap is the draw path's assumption, not re-measured for compute.
measured run: its log names 8 dispatching keys (7 that waited for the runtime, 1 whose translation failed) and
no per-key count. The census answers it on the next run.
🤖 Generated with Claude Code
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 <[email protected]>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 <[email protected]>8a4df523) d17d2629b89828b5d8); pin the entry-value and refusal controls a20521715af5b03039) into startup/compute-dispatch-textures 190e00a1695e185ab7df' into pr2490-fu 1991fd08a1@RonLogic on GitHub · 2026-11-25 19:10 UTC · original
I’ll take the uncovered two-UAV case mentioned in the PR description: one translated Dispatch, two output views of the same texture at distinct mips, with different expected values and a view-swap control. I’ll use the source-built fixture on RTX 4070 and WARP and keep it as a follow-up to this PR so the runtime work can land independently.
@ChazY11 on GitHub · 2026-11-25 19:13 UTC · original
Built and ran it here: 8 C++ cases and both Python checks pass on WARP and on a physical GPU — with two manifest guards that no test constrains
I could build individual targets on this host even though the full build stops in DXC, so this is a run result,
not a reading.
What passed
Targets
startup_stream_consumer,startup_compute_root,startup_list_dispatch_check,startup_root_constant_storeallbuilt (
cmake --build --preset dev --target …, exit 0).Five negative controls around the list dispatch, and four conditions inside each dispatch assertion (before
translation, without a Dispatch, refused output, refused view) — that is the shape that makes the pass mean
something.
Three in-place mutations
Each one edited
src/startup_stubs/d3d12_compute_dispatch.inl, rebuiltstartup_stream_consumer, ran both suites,then restored the file and rebuilt.
startup_compute_dispatch_check.pyif (tr->state != 1)→if (true)(refuse every dispatch)return "manifest version";→return nullptr;return "not a compute manifest";→return nullptr;The first is the one that matters: making the not-ready path unconditional breaks the translated case immediately,
so the Python check really does assert that a ready manifest dispatches. It also shows the C++ cases and the Python
check cover different halves — the C++ ones never see a translated dispatch.
The two survivors are manifest-rejection texts, and I would not call them defects
load_compute_translationreturns a reason string when a manifest line does not match. Disabling the version checkand the stage check changes only the string recorded for a manifest that failed to load; the dispatch still
refuses, only with
nullptrinstead of"manifest version". No test feeds a malformed manifest, so nothingdistinguishes the two.
That is a coverage statement, not a bug: the refusal still happens. If you want the reasons pinned, one fixture that
writes
x2w-manifest 1and one that writesstage psand asserts the two strings would do it — cheap, and it wouldalso catch a future reordering of the manifest checks.
Build environment
Windows 11 build 26300.9974; DXC 10.0.26100; adapters: Microsoft Basic Render Driver (WARP) and the installed
physical GPU; debug layer enabled with no message in every run above. Individual targets build here — the earlier
"cannot build" boundary applied to the full target set, not to these.
AI-assisted.
@RonLogic on GitHub · 2026-11-25 19:14 UTC · original · edited 2026-11-26 16:20 UTC
The two-mip follow-up is verified on the current head
f67f80a4. The test-only commit adds separate WARP and hardware CTests and uses the existing slot 67 / slot 14 fixture. I'll open the follow-up againstmainafter the runtime dependency lands.One translated Dispatch binds two UAVs of the same RGBA16_FLOAT texture at table bytes 64 and 128. Both mip readbacks match across all 1,280 half values, including the untouched texels. Before translation both mips retain their sentinels. Exchanging the UAVs moves the two patterns to the opposite mips and changes exactly 64 halves against the ordered result.
6/6 passed, no skips. Windows 11 build 26300.10075, RTX 4070 driver 32.0.16.2124, in-box WARP 10.0.26100.10068 and the SDK 10.0.26100 DXC. The debug layer was enabled on both adapters and reported no errors.
Update: #2532 brought the textured runtime onto
main. I ported the test onto2215c26d(efd69f8e) and both mip tests passed. A separate local integration (8dd586ef) with the current #2710 UAV fix passed all 12 compute, live-retry and pixel UAV tests on WARP and RTX 4070. #2710 modifies the same fixture, so I’ll open the follow-up after that change lands.Latest integration check: I combined
a766f287with #2710 at2aa18479and the isolated two-mip fixture in local head8f198d16. The 12-test compute Dispatch/live-retry/pixel-UAV group passed in both MSVC Debug and Release, zero skips. In each configuration WARP and RTX 4070 both matched all 1,280 half words for each view order. Swapping the views changed the expected 64 words, with the D3D12 debug layer enabled and no error message. I’ll submit the fixture as its own PR after #2710 lands.#2710 is now on main. The standalone two-mip fixture is open as #2882. On
b505c32bplus the fixture, all 24 Release cases passed, including the current array UAV/slot-67 regressions and both mip permutations on WARP and RTX 4070.@MasterDomino on GitHub · 2026-11-25 20:39 UTC · original · review (dismissed)
Review of
f67f80a4(stacked on #2470; it inherits my #2470 notes). One P1, plus unpinned guards.P1: texture input on a COMPUTE command list breaks the list
dispatch_translatedaccepts COMPUTE lists (d3d12_compute_dispatch.inl:139,type != DIRECT && type != COMPUTErefuses only other types). A texture input is then transitioned tosampled_state(self, view.resource) | D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE(:279).sampled_state(d3d12_xs_device.cpp:2397-2402) always returnsPIXEL_SHADER_RESOURCE, and alsoDEPTH_READfor depth.PIXEL_SHADER_RESOURCE(0x80) isn't a valid barrier state on a compute command list.dispatch-sampledwith the consumer's queue, allocator and list switched to COMPUTE. On WARP and the RX 9070 XT the debug layer reportsID3D12CommandList::ResourceBarrier: D3D12_RESOURCE_STATES has invalid flags (0x80) for compute command list(id 537), followed bylist Close failed 0x80070057. With the debug layer off, Close still fails, and on hardware the process then exited0xC0000409.NON_PIXEL_SHADER_RESOURCE(and dropDEPTH_READthere too), and add a COMPUTE-list variant ofdispatch-sampled.Runs (Windows 11 build 26300; RX 9070 XT, driver 32.0.32029.2010; WARP 10.0.26100.9818; debug layer enabled)
--repeat until-fail:10.Mutants (one line each, rebuilt, restored)
:280)word=0 … 288 words differ)return "manifest version";→return nullptr;(:65, @ChazY11's guard)return "not a compute manifest";→return nullptr;(:69)if (false)at:65):222):218)float4storeOne fixture each with
x2w-manifest 1,stage ps, an integer-format UAV, and one texture as both input and output would pin these. The manifest version and stage are the translator–runtime contract, so they're worth pinning.Minor
RENDER_TARGETbefore the following draws.smpparser at:88passes&xtwice.Merge readiness
The branch merges cleanly against
mainand on top of #2470, but it can only land after #2470, per @R0Y00's 19:30 note there. The manifest format is unchanged, so no cache-key bump is needed. The new DLL exportx2w_d3d12_compute_censusis an interface addition for the maintainer to accept.AI-assisted; commands listed were executed locally.
@NiiRoZz on GitHub · 2026-11-25 21:00 UTC · original
Thanks for the review. Head
76ce41bc, with the reworked #2470 (1f5fb5e4) merged in.P1, compute list barrier. Fixed at the call site by list type: on a
COMPUTElist a sampled texture input is transitioned toNON_PIXEL_SHADER_RESOURCEonly; a direct list keepssampled_state(...) | NON_PIXEL_SHADER_RESOURCE.sampled_statehas one other caller, the draw path, which only runs on direct lists. New modedispatch-sampled-computerecords the sampling fixture on a compute list and a compute queue and must give the same 320 words with no debug-layer error.Refusals that were not pinned. Four fixtures in
startup_compute_dispatch_texture_check.py, each requiring the one logged reason and an untouched texture: an RGBA16_UINT view (texture-store-uint), manifest version, stage, and the output texture also named as an input (texture-store-self, with a shader resource view of the same texture and a manifest line added by the check).Minor. The
smpmanifest line no longer scans two fields into one variable.Mutants (each applied alone, stand-in rebuilt,
startup_compute_dispatch_texture_warprerun; not committed)dispatch-sampled-compute: consumer exit 75(the list's Close fails)texture-store-uint(no refusal logged)texture-store-selfmanifest versionnot a compute manifestMeasured
4/4 passed, no skip:
startup_compute_dispatch_{warp,hardware}andstartup_compute_dispatch_texture_{warp,hardware}. WARP: Microsoft Basic Render Driver 10.0.26100.10068. Hardware: NVIDIA GeForce RTX 5090, driver 32.0.16.2135. Windows build 26300.10075, debug layer enabled, no error or corruption message. Before the pins were added, the wider filter (...|startup_root_constant_store|startup_list_dispatch|startup_compute_root|startup_stream) passed 30/30 on this branch except the then-newtexture-store-selffixture on WARP, which used a table offset that is not a descriptor boundary there; it now uses byte 0. That wider filter was not rerun after this last fixture change.Not done
🤖 Generated with Claude Code
@R0Y00 on GitHub · 2026-11-25 21:21 UTC · original
@MasterDomino I independently ran
76ce41bcin Windows Release. Both the direct raw-buffer CTests and the texture Dispatch CTests passed on WARP and RTX 4060 Laptop (4/4). The latter exercise the updated COMPUTE-list shader-resource transition. Please recheck your previous request at this head when you can. This remains stacked on #2470, whose earlier recorded-state slice must land first.@MasterDomino on GitHub · 2026-11-25 21:33 UTC · original · reviewed
Re-review of
76ce41bc(stacked on #24701f5fb5e4). The P1 is fixed and the guards I listed are pinned.P1: texture input on a COMPUTE list (resolved)
NON_PIXEL_SHADER_RESOURCEonly (d3d12_compute_dispatch.inl:292).dispatch-sampled-computerecords the sampling fixture on a compute list and queue, and gives all 320 words with no debug-layer error on WARP and the RX 9070 XT.ResourceBarrier: D3D12_RESOURCE_STATES has invalid flags (0x80) for compute command list(id 537), thenlist Close failed 0x80070057, consumer exit 75. So the fixture guards the fix.DEPTH_READcan't arise on that path: a compute list never tracks it, andsampled_stateis no longer called there.Runs (Windows 11 build 26300; RX 9070 XT, driver 32.0.32029.2010; WARP 10.0.26100.9818; debug layer enabled)
startup_logical_view_*).Mutants (one line each, rebuilt, restored;
startup_compute_dispatch_texture_warp)return "manifest version";→return nullptr;return "not a compute manifest";→return nullptr;texture-store-self)texture-store-uint)Thanks for pinning @ChazY11's two guards as well.
Still open (acknowledged in your note; not blocking for this slice)
RENDER_TARGETafter a translated Dispatch.d0b9e774and doesn't mention the compute-list transition; worth refreshing.Merge readiness
mainand lands after #2470, in the order @R0Y00 set there.x2w_d3d12_compute_censusexport is an interface addition for the maintainer to accept.AI-assisted; commands listed were executed locally.
@NiiRoZz on GitHub · 2026-11-25 21:46 UTC · original
Merged the current #2470 head (
f5b03039) into this branch. Head190e00a1.Changed
Measured (Windows 11 build 26300.10075, debug layer on, no error or corruption message)
startup_compute_dispatch_{warp,hardware}andstartup_compute_dispatch_texture_{warp,hardware}.startup_compute_dispatch_hardwarewas run 10 times in a row: 10/10 passed, so all 100 consumer processes exited 0.Not rerun
Still open (not in this slice)
RENDER_TARGETafter a translated Dispatch.d0b9e774and does not mention the COMPUTE-list transition. It will be refreshed with the #2470 trim.x2w_d3d12_compute_censusexport is a new interface; accepting it is up to the maintainer.@NiiRoZz on GitHub · 2026-11-25 21:56 UTC · original
On the two remaining notes:
🤖 Generated with Claude Code
@MasterDomino on GitHub · 2026-11-25 22:09 UTC · original
Thanks, @NiiRoZz. Both answers work for me, so neither note blocks this PR:
Still waiting on: the order #1803 → #1974 → #1975 → trimmed #2470, an executable run on the final candidate, and @R0Y00 accepting the
x2w_d3d12_compute_censusexport.AI-assisted.
@tedin7 on GitHub · 2026-11-26 03:41 UTC · original
@NiiRoZz @MasterDomino #2532 was squash-merged into
mainasde75613fb, and it was stacked on this branch: its history includes "Merge pr2470 (origin/main) into pr2490". Comparing this head with currentmain(git merge-tree --write-tree origin/main <head>, thengit diff origin/main <tree> --stat), the texture-view Dispatch path is already onmain. Of about 930 added lines, about 19 are not onmain, and those are small form changes (for example the 32-byte texture/entry fields ofSlot).Is anything here still needed beyond what landed? If not, this PR could be closed as superseded by #2532. Any leftover tweak could go as a small follow-up against
main. If you would rather keep this one open for that, just say so here.Thanks for the work on this stack.
AI-assisted; commands listed were executed locally.
@MasterDomino on GitHub · 2026-11-26 03:44 UTC · original
Thanks, @tedin7. Confirmed on
main(8016c393): the texture-view Dispatch path, the COMPUTE-list transition fix,dispatch-sampled-computeand the census export came in with #2532. Closing this as superseded is fine with me once @NiiRoZz confirms the remaining small differences aren't needed. I've followed up on the open gates (slot 35 controls, the matched title run, the census export) in #2470: #2470AI-assisted.
@tedin7 on GitHub · 2026-11-27 09:36 UTC · original
This PR now conflicts with
main. Conflicting files:CMakeLists.txtdocs/experiments.mdsrc/startup_stubs/d3d12_compute_dispatch.inlsrc/startup_stubs/d3d12_xs_device.cpptests/startup_compute_dispatch_check.pytests/startup_compute_dispatch_texture_check.pytests/startup_stream_consumer.cppCould you merge
maininto your branch (a merge commit, no force push needed) and resolve these? Thank you.AI-assisted; commands listed were executed locally. (
git merge-tree origin/main <head>)@JohnConnorNPC on GitHub · 2026-11-28 07:35 UTC · original
I suggest closing this as superseded by #2532. I rechecked this head (
d3fe0303) againstmainatc3204a9c:mainthrough #2532:git merge-base --is-ancestor de75613f origin/main→ true.maintoo. All 8 non-blank lines this PR adds toCMakeLists.txtappear verbatim there (grep -vxcF -f <main CMakeLists.txt>over the added lines →0), so merging would add no new check.git merge-tree --write-tree --name-only origin/main d3fe0303 | grep -c ^CONFLICT→8.main, andmainhas a replacement for each:dispatch_translated→record_translated_dispatch,retry_manifest_at→x2w_startup::ManifestRetry, andfloat_output_format→ the "an output texture format is not a float or normalized one" refusal.reviewThreads→ 0 unresolved).If something from this branch is still missing on
main, please open a small PR against currentmainwith just that change. Thanks for the work here.This comment was AI-assisted.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.