runtime: bind 3D and 1D texture UAVs and write them in the C++ compute manifest #2975
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!2975
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2975"
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?
@Leyukaka on GitHub · 2026-11-27 01:01 UTC · original
Leyukaka:tex3d-runtime→main· +97 −19 · 5 files · 4 commits · closed without mergingPart 1 of #2974 (steps 1 and 2). Part of #2935. Target branch
main. Step 3, binding these views on the in-process native route, will be a separate pull request.Change:
src/startup_stubs/d3d12_compute_dispatch.inl,src/startup_stubs/d3d12_xs_device.cpp,tests/startup_stream_consumer.cpp): the runtime half of #2902, which is open onmain, taken unchanged, so a later merge ofmainshould merge cleanly there.uav N tex3d|tex1d float table P OFF channels C.TEXTURE3D/TEXTURE1Dfrom the title's view record.texture-volume,texture-line,texture-volume-bad-wandtexture-line-bad-mipmodes.cpp-migration, say so and I will drop these hunks.src/direct_compute_cache.cpp):format_compute_runtime_manifestwritestex3dandtex1dfor atexture_uav/half4_texture_uavwith image dimension 2 or 0, next to the existingtex2d/tex2da. Other dimensions and kinds stay refused, socompile_dxil --requestspublishes a manifest the runtime accepts for 3D and 1D stores.tests/startup_compute_dispatch_texture_check.py,CMakeLists.txt): the 3D, 3D NSA and 1D store cases from #2902 now run throughcompile_dxilinstead ofgfx2hlsl.py, since the Python half of #2902 is not on this branch. CMake passescompile_dxiland the DXC directory to the existing WARP and hardware entries when they exist.Tests. The setup was Windows 11 with an NVIDIA GeForce RTX 5080 and DXC from the Windows SDK 10.0.26100, on
cpp-migration2b678fd3plus this commit.startup_compute_dispatch_texture_hardwarepassed.no translation.compile_dxilthen writes<key>.txtwithuav 0 tex3dortex1d float table 1 64 channels 4, and<key>.cs.cso.startup_compute_dispatch_texture_warppassed. WARP refused the PSO, so for the 3D/1D cases only the manifest was checked there.Mutation checks, run by hand; each fails the hardware test:
tex2din the formatter fails the manifest assertion;texture-volume-bad-wcontrol.Measured on a local capture (counts and instruction shape only) with
compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests.2b678fd3to 177; the number compiled is unchanged at 388.srv 0/1 buf,srv 2 tex2d,uav 0 tex3d float ... channels 4).cpp-migrationb260984f, that pipeline was dispatched 17,408 times and never translated. In a later run with this change andcompile_dxil, it was translated and dispatched about 17,400 times. (An earlier version of this line also linked the title staying on its first screen to this pipeline; that was not shown, see #2974.)AI-assisted.
@Jess-Doit on GitHub · 2026-11-27 01:25 UTC · original
The view checks are scoped clearly. Please distinguish unsupported native wave-size capability from unexpected PSO failure, so a passing WARP job tells us whether the new cases actually ran. A portable shader fixture could cover the binding path independently. Ready for more review
@Leyukaka on GitHub · 2026-11-27 01:42 UTC · original
Thanks. Both done in the new commit.
Wave size versus PSO failure.
OPTIONS1test the native route uses. It logspipeline creation failed: the adapter has no 32-lane waveswhen they rule out aWaveSize(32)module.Portable fixture. The 3D and 1D cases now also run with a
cs_6_0store compiled bydxc(noWaveSize) and a hand-written manifest. It uses the sameuav 0 tex3d|tex1d float table 1 64 channels 4line and the same request key. So the binding path, the mip-one readback and the mismatched-view, bad-W and bad-mip refusals run on WARP independently of the C++ compiler.Results on an RTX 5080 and on WARP (Windows 11, DXC from the Windows SDK 10.0.26100):
A manual mutant that never names the wave reason makes the WARP check fail.
AI-assisted.
@Jess-Doit on GitHub · 2026-11-27 02:04 UTC · original
The two portable shader and manifest checks passed locally. The new portable fixture covers the binding path independently of native wave size. One diagnostic issue remains. A published shader with no wave-size requirement can still get a missing-32-lane-waves label if its PSO fails on that adapter, and a failed capability query gets the same label. Please keep the generic PSO failure as the primary reason and report the observed capability separately, or limit the specific reason to shaders known to require that wave size. Ready for more review
@Leyukaka on GitHub · 2026-11-27 02:13 UTC · original
Thanks, done in the new commit. I took the first option; the wave-size-specific reading now lives only in the test, which knows its modules declare
WaveSize(32).pipeline creation failedas the reason. The stand-in only adds the adapter's 32-lane wave capability next to it, as observed:pipeline creation failed (adapter has no 32-lane waves), orpipeline creation failed (adapter wave capability query failed)whenCheckFeatureSupportfails. The manifest records no wave size, so the runtime no longer suggests that the shader needed one.WaveSize(32), so it alone treats the no-waves observation as the explanation: it skips the native 3D, 3D NSA and 1D cases on WARP only for that line. A bare PSO failure or the query-failed form fails it.On the RTX 5080 and on WARP, the results are the same as in my last comment. With a mutant that drops the observation, the WARP check fails on the bare
pipeline creation failed. I could not makeCheckFeatureSupportfail on either adapter, so the query-failed form is not exercised by a test.AI-assisted.
@Jess-Doit on GitHub · 2026-11-27 03:15 UTC · original
The diagnostic finding is resolved. Five scripted checks passed, including the separate capability-query failure note. The Release dispatch checks passed on both adapters, and both portable UAV cases passed on the GTX 1060. The WARP texture failure reproduced on clean main, and the native GTX 1060 pipeline failure reproduced on the prior PR head. The isolated WARP run stalled, so it adds no coverage. Ready to merge from our side
@R0Y00 on GitHub · 2026-11-27 04:01 UTC · original · approved these changes
Reviewed
e18549cafe7f9412b896fd43cf261fdc6750498a. The published PSO failure remains the primary diagnostic; the independent adapter-capability result no longer claims a wave requirement on the shader. I rebuiltstartup_stream_consumer d3d12_xs_shim compile_dxilwith the Release preset and ranctest --preset release --no-tests=error --output-on-failure -R '^startup_compute_dispatch_texture_(warp|hardware)$'on Windows 11 build 26200.9974. Both CTest entries passed. WARP (10.0.26100.9818) and RTX 4060 Laptop (32.0.16.1656) each matched 6,144 portable volume words and 128 portable line words; the incompatible views left sentinels intact. RTX also matched 6,144 words each for native volume and volume NSA and 128 for native line. WARP capability-skipped those three native subcases. The texture-input check reports the D3D12 debug layer enabled with no errors on both adapters. The merge trial withcpp-migrationate0d83759was clean, and #2993 contains this head as an ancestor.@KelboLive on GitHub · 2026-11-27 04:26 UTC · original · reviewed
PR #2975 adds 3D and 1D texture UAV support to the C++ compute manifest. Good incremental work.
What works
Issues
Recommendations
Overall: clean, correct change. The dimension switch is easier to maintain than the previous binary condition.
@KelboLive on GitHub · 2026-11-27 04:26 UTC · original · reviewed
PR #2975 adds 3D and 1D texture UAV support to the C++ compute manifest.
What works
Issues
Recommendations
Overall: clean, correct change. The dimension switch is easier to maintain.
@Leyukaka on GitHub · 2026-11-27 04:29 UTC · original
Thanks. Answers to the three points:
UINTisunsigned intin the Windows headers, so both arguments of(std::min)(view.MipSlice, 15u)have the same type.adapter_32_lane_waves()is not queried per Dispatch. It runs only after a published translation's PSO creation fails, and at most once per key on the in-process route, which tries each key once.uav_dimensionstaysUNKNOWNonly for raw buffer UAVs. Both the manifest reader and the in-process route (#2993) set a known dimension for every texture UAV slot, and the dispatch path picks the view from that field.AI-assisted.
@MasterDomino on GitHub · 2026-11-27 05:00 UTC · original
Title-run results for
e18549ca, before merging. This is not a code review; R0Y00's approval and my test results above stand. I am holding the merge on one start-up result that needs your eyes.Setup: Windows 11 26300.9974, RX 9070 XT (driver 32.0.32029.2010), release. Each run lasts 300 s with the same scripted inputs. The shader cache is the same local rev-28 cache, copied fresh for each run.
cpp-migratione0d83759+ this PR + #2986, #2996, #2998 and #3003 (all four have since merged).compile_dxil gfx1013-direct-cs@0 --requestsover a copy of the request files into a separate directory. Then, for each compute key the cache has no<key>.txtfor, they copy that key's<key>.txtand<key>.cs.csointo the run's cache.Start-up progress is measured as file opens by the title over time. The
.txtcount includes requests published during the run.tex3d/tex1d)e0d83759e0d83759tex3d/tex1doutput. In both, the title stops opening files at about 110 s. One run never recovers within 300 s, and the other resumes at about 250 s. Frames keep being presented at about 28 fps in every run.What the stand-in does in the stalled runs: three pipelines now load as translated. They are the per-frame compute pipeline you described on #2974 (
srv 0/1 buf,srv 2 tex2d,uav 0 tex3d float table 1 32 channels 4) and two pipelines dispatched next to it (srv 0/1 buf,uav 0 tex1d float table 1 32 channels 4). On this branchgfx2hlsl.pyrefuses all three withimage_store on SQ_RSRC_IMG_3D/1D: only 2D images are lowered. Every one of their Dispatches is then refused:an input is in a placed buffer that does not alias title memory. So the native program never runs. One0d83759the same three keys are refused earlier withno translation. Both paths leave the outputs untouched as far as I can see, yet only the first one coincides with the stall.I have not found the cause. It could be:
Why I'm holding it: without this PR,
compile_dxilcannot publish these manifests, so the stall cannot happen. With it,compile_dxil --requests/--watchpublishing into the runtime cache reaches it. That is the workflow this PR and #2993 build on. Could you check whether the refused-after-translation path for a 3D UAV binding has a side effect theno translationpath does not? With your capture, the same injection should reproduce it.AI-assisted; the runs above were done locally, counts only.
@Leyukaka on GitHub · 2026-11-27 05:14 UTC · original
Thanks for the runs. I compared the two paths in the stand-in at
e18549ca: a key whose manifest loads and whose every Dispatch is then refused, against a key with no manifest. I found no side effect of the refusal that the title could wait on, so I cannot explain the stall yet.The refusal path.
record_translated_dispatch, the binding loop stops at the first reason. For this layout that is input 0 or 1:srv 0/1 buf table, refused byindirect_table_bufferwith "an input is in a placed buffer that does not alias title memory".list_upload_range,placed_buffer_rangeandlist_copied_gpu_range.upload_texture,require_state, the descriptor heap writes and the Dispatch are never reached. The function returns the reason with nothing recorded on the list.first_refusal, a counter, one "first refused input" log line per key and up to 16 shared "refused" lines.list_dispatchdiscards the reason. The ExecuteIndirect caller only counts and logs it, as it does forno translation.src/startup_stubsreads a compute key's translation state.draw_lock.One difference: manifest polling.
retry_manifest_atset, so it reopens<key>.txton a Dispatch at most once per second.files.txtfromrun.ps1records the stand-in's own opens as well. In one of my runs, 199,667 of its 208,352 lines areNtCreateFileopens of<key>.txtin the shader cache, spread over 1,650 keys (draw and compute).If your count includes those paths, this could account for the missing ~1 open per second between 120 and 240 s, at most. It does not explain the missing step of about 730 opens after 240 s, nor the 3 keys dispatched at the end of
inject. Could you check whether your count excludes the shader cache directory? Either way, the stall needs a closer look at what the title waits for after 110 s in those runs. I will try to reproduce it with my capture.AI-assisted.
@sydney-0o on GitHub · 2026-11-27 11:11 UTC · original
I opened draft #3049 on
mainto combine this work with #2993, preserving your commit authorship. #2902 is already in the base, so the draft adds the C++tex1d/tex3dmanifest support and reuses the existing runtime view checks. Offline readback passed on a GTX 1080 Ti with app-local Agility SDK 1.620.2, including the bad mip, W range and mismatched-view controls. The startup stall reported here still needs a separate before/after run.@R0Y00 on GitHub · 2026-11-27 11:18 UTC · original
Retargeted to main. My local integration on
e04217f4preserves #2902, compute root SRVs and the Python-published 1D/3D fixtures while adding separate compile_dxil publication coverage. I also saw #3049, which integrates both original PRs and preserves Leyukaka's commits. I am checking it as the combined integration candidate. The original-program startup observation with injected manifests is still open. For a comparable run on current main, please report title file opens separately from shader-cache paths, and record translated/refused dispatch counts for the three keys.@Jess-Doit on GitHub · 2026-11-27 15:59 UTC · original
I checked the copied-buffer refusal on the current head with source-built 1D and 3D output manifests. On the GTX 1060 and in-box WARP, both manifests refused the first input, recorded zero translated dispatches, and left all 320 fixture readback words identical to the no-manifest control. This verifies early refusal and write suppression in the fixture. The startup stall and the effect of manifest polling remain open on current main. Ready for more review
@R0Y00 on GitHub · 2026-11-27 16:06 UTC · original
Thanks for checking the copied-buffer refusal on both adapters. The GTX 1060 and inbox WARP results cover the early-refusal control: both 1D and 3D manifests forward zero translated dispatches and preserve all 320 words. I’m keeping that fixture result separate from the open startup and manifest-polling comparison. #3049 is still the combined integration candidate on
main; keep this PR linked for the original contribution and review.@JohnConnorNPC on GitHub · 2026-11-28 07:33 UTC · original
Thanks for this. I reviewed head
e18549caagainst currentmain(c3204a9c). The runtime half is already onmainthrough #2902, so what's new here is the 4-channeltex3d/tex1dmanifest lines and the wave note on PSO failure. Three things need fixing before this can land:main.git merge-tree --write-tree --name-only origin/main e18549caexits 1 in 3 files: dispatch.inl, stream_consumer.cpp and texture_check.py. The first two can take main's side (root SRVs, bufhalf, uint atomics, channels 1–4). texture_check.py needs a redesign: both sides definestore_3d1dwith different signatures, and main expectslen(sys.argv) not in (4, 5)withtwo-mipswhile this PR expects(4, 6)with compile_dxil + sdk.default: return std::nullopt;, where main hasreturn refuse(view_shape("UAV", b));. On the merged tree, main'stests/native_compute_manifest_reasons.cppcase "UAV kind texture_uav cube" (image_dimension = 3) would get an empty reason and exit 1. I traced this from source and didn't build it.default: return refuse(view_shape("UAV", b));would fix it.main.Non-blocking:
uav 0 tex1d … channels 4and dim 2 →tex3d, each with a mutant, would cover them. CI'sctest --preset prlog has 0startup_compute_dispatch_texturelines.cpp-migration". It has been onmainsince #2902.127d8823(git merge-base --is-ancestor e18549ca <#3049 head>→ 1), so only one of the two should merge.Environment: Linux, static review and merge-tree only. I did no build, WARP or GPU run.
This comment was AI-assisted.
a99e05f4) into tex3d-runtime 8364ecd146@Leyukaka on GitHub · 2026-11-29 09:17 UTC · original
Merged
main(a99e05f4) into the branch; new head8364ecd1. A merge rather than a rebase, so the approved commits stay as they are and only the resolution is new (git show --remerge-diff 8364ecd1). The approval is one18549ca, so the new head needs a re-review.Conflicts (
mainalready has the 3D/1D dispatch path and its fixtures from #2902):src/direct_compute_cache.cpp: kept our tex1d/tex2d/tex3d/tex2da switch fortexture_uavandhalf4_texture_uav; itsdefault:now returns main'srefuse(view_shape("UAV", b)).src/startup_stubs/d3d12_compute_dispatch.inl,tests/startup_stream_consumer.cpp: took main's side in every hunk, ours was a subset. The 32-lane wave note on PSO failures merged without conflict.tests/startup_compute_dispatch_texture_check.py: dropped our hand-written portablecs_6_0fixture for main'sgfx2hlsl.pytranslation (store_3d1d,V.FORMS); kept the nativecompile_dxilcases, now run through main'sstore_3d1d. The docs paragraph follows.Tests on
8364ecd1:startup_compute_dispatch_texture_{warp,hardware},startup_compute_dispatch_two_mips_{warp,hardware}andnative_compute_manifest_reasonspass (5/5). On a hardware adapter the translated and native volume, volume-nsa (6144 words) and line (128 words) readbacks match; on WARP the native 3D/1D cases skip (no 32-lane waves) and the translated ones match.Mutation:
case 0: tex = "tex1d"->"tex2d"indirect_compute_cache.cppfailsstartup_compute_dispatch_texture_hardwareatassert f'uav 0 tex{dim} float table 1 64 channels 4' in manifest(the manifest hasuav 0 tex2d float table 1 64 channels 4).git merge-tree --write-treeof8364ecd1with currentmain(1a0120ba) is clean; the tests above ran witha99e05f4merged, not1a0120ba.@Leyukaka on GitHub · 2026-11-29 12:24 UTC · original
Closing in favour of #3400, which carries this PR's changes: the
tex1d/tex2d/tex3d/tex2daswitch in the C++ manifest formatter, the adapter wave capability reported next to a PSO creation failure, and the native 3D/1D store fixture.Two differences: in #3400 the native 3D/1D cases run as a separate
startup_compute_dispatch_texture_native_<adapter>test instead of insidestartup_compute_dispatch_texture_<adapter>, and the hardware result paragraph this PR adds todocs/startup-runtime.mdis not carried over.Pull request closed