runtime: publish narrow half-float texture UAV stores #3307
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!3307
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3305"
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?
@RonLogic on GitHub · 2026-11-28 06:55 UTC · original
RonLogic:runtime/narrow-half-image-uav→main· +272 −21 · 7 files · 4 commits · openChange
Refs #3226 and #2935. Direct Compute already emits D16 image stores for one and two channels. The five source-built programs here emitted DXIL but stopped at
half_scalar_uavorhalf2_texture_uavmanifest publication on the preceding compiler.Publish the existing one- and two-channel bindings as typed half-float texture UAVs. The slot 14 binder checks the view and resource formats with the existing
native_half_store_formatcontract and queries typed-store support on the view format. It uses the recorded mip and slice range for 1D, 2D, 2D-array and 3D textures. This is the published texture path. #3304 covers hardware buffer descriptors, and #3049 covers the separate in-process binding work.Verification
58f3fc4fonbbf4687b, with clean merges checked against current main and #3304. Windows 11 26300.10075, MSVC 19.52.37029, Windows SDK 10.0.26100 DXC 1.9.2602.17, Agility 1.620.2, RTX 4070 driver 32.0.16.2124, and app-local WARP 1.0.22.Evidence and follow-up
The texture data and guest code are generated by the test. The tested view coordinates follow the D3D12 UAV contract. The observed compatibility result is the five source-built programs through the published runtime, including a second view representation for the scalar 2D program. I used Codex to prepare the change and ran verification locally.
@JohnConnorNPC on GitHub · 2026-11-28 07:57 UTC · original
Thanks for this. I reviewed head
58f3fc4fby reading it and running pure-Python checks on the merged tree (no build, no Wine, no GPU). I found nothing blocking, only one suggestion and a few nits.git merge-tree --write-treeof this head intomainc3204a9cis clean (rc=0). #3304 changed the same three files (direct_compute_cache.cpp,d3d12_compute_dispatch.inl,startup_stream_consumer.cpp), but in separate branches of the same chains. The merged runtime keeps both thebufhalfand the newhalf tableforms.git grep -Foversrc toolsfinds"textureStore.f32", 67×1,"textureLoad.f32", 66×2,"legacyF16ToF32", 131×14 and"legacyF32ToF16", 130×2.docs_links_check.pyreportsChecked 148 Markdown files and 671 links.(rc=0).ctest --preset pr(100% tests passed out of 73), andgrep -c half_image_uavon its log gives 0. So your local 15/15 run is the only run of the new tests.Suggestion:
direct_compute_cache.cpp, the half branch's guardb.array_count == 1 && (b.image_dimension < 3 || b.image_dimension == 5)is the only thing that stops a 1D-array D16 store from being published astex2da, because the name ternary falls through to"tex2da". The direct compiler does emit dim-4 stores:dx_kind[]{1, 2, 4, 5, 6, 7, 3, 8}maps dim 4 to Texture1DArray, and onlydimensionsqueries refusedim == 4. No test pins the guard.CASEScovers dims 0, 1, 2 and 5, andnative_compute_manifest_reasons.cpphas no half kind (git grep -c half_exits 1). A dim-4 (and perhaps dim-3) row incontrols()that expects theview_shape("UAV", …)refusal would pin it.Nits:
2. The header comment of
d3d12_compute_dispatch.inllists thefloat tableandbufhalfforms but not the newhalf table … channels <1|2>form.3. Only two normal values, 1.0 and −2.0 (
0x3c00,0xc000), are pinned. No f16 denormal or NaN value checks the f16→f32→f16 path (legacyF16ToF32then a typed R16 store) against the console's raw-bits D16 write.4. The PR body has no mutation table. One would show which new checks turn red when each guard is removed.
Once you've considered the suggestion, it looks ready from our side.
This comment was AI-assisted.
@JohnConnorNPC on GitHub · 2026-11-28 08:30 UTC · original
Thanks for the work here. This branch no longer merges with current
main(c6f23813):git merge-tree --write-tree origin/main 58f3fc4fexits 1 with a conflict insrc/startup_stubs/d3d12_compute_dispatch.inl.Could you merge or rebase current
maininto the branch, resolve that conflict, and re-run the tests this PR adds, so reviewers can look at the refreshed head?This comment was AI-assisted.
@RonLogic on GitHub · 2026-11-28 12:09 UTC · original
Thanks for flagging the 1D-array case. I refreshed the branch onto
052abe6fand ran the new controls on905db2e44fb8c1d52d2889706eb22fc341b84084. Git's merge-tree check against that main revision was clean.UAV kind half2_texture_uav 1d-arraywithout a manifest. Deliberately mapping that dimension totex2damakes the new control fail.0x5100, read0x3c00.0x7c55was stored as quiet0x7e55on both. Guest hardware parity for signaling NaN remains unverified.Windows 26300.10075, MSVC 19.52.37029, DXC 1.9.2602.17, Agility 1.620.2. RTX 4070
10de:2786, driver32.0.16.2124, wave32. WARP 1.0.221414:008c, forced wave32 verified. The debug layer was enabled on both and reported no errors in the fixture. Inbox WARP separately reported four lanes and skipped the wave32 probe.An independent run of the 1D-array refusal and shifted-W control on the refreshed head would be useful. I used Codex to prepare the change and ran the reported checks locally.
@Leyukaka on GitHub · 2026-11-29 12:06 UTC · original
This branch conflicts with
main1990feadintests/startup_stream_consumer.cpponly (one region: the mode flags at the top oftexture_slot67). The other files merge cleanly.Resolution: keep this branch's side (
half*,shifted_w,volume,line,first_mip,width,height), add main'sconst bool sampled = mode == "texture-volume-native-sampled";with its comment, and start thevolumecondition withsampled ||.No review is recorded on this PR yet, and the new tests need a re-run on the merged head.
@pigalot on GitHub · 2026-11-29 12:44 UTC · original · requested changes
Reviewed
905db2e4at the head itself, not integrated: it conflicts withmainf4e2e5c6, so I am requesting changes for that alone. Everything else below passed here and is non-blocking.Blocking: conflict with
main.git merge-tree --write-tree origin/main 905db2e4exits 1 with one conflict, intests/startup_stream_consumer.cpp, at the mode flags at the top oftexture_slot67.mainaddedtexture-volume-native-sampledthere (af6045df, merged with #3156); this branch added thetexture-exact-half-*flags in the same lines. The other six files merge cleanly. Please mergemainand re-run the new tests; both sides' flags need to stay (sampled ||at the start ofvolume, plus this branch'shalf*,shifted_w,widthandheight).What I traced. The publisher branch in
format_compute_runtime_manifesttakeshalf_scalar_uavandhalf2_texture_uavbefore the float branches, maps ISA dimensions 0, 1, 2 and 5 explicitly and refuses the rest throughview_shape. The binder parses thehalf tableline intonarrow_half_texture, checks the view and resource formats withnative_half_store_format(...).accepts, queries typed-store support on the typed format and binds the view with that format. For the existing float pathstore_formatis stillresource.Format, so that path is unchanged. The two merge commits on the branch are the author's.Tests at
905db2e4(targetscompile_dxil d3d12_xs_shim startup_stream_consumer offscreen_check native_compute_manifest_reasons,devandrelease):startup_compute_half_image_uav_warpandstartup_compute_half_buffer_uav_warp: the inbox WARP here reports a 4-lane wave, so the wave32 probe returns 77. I did not run the new fixture on WARP.startup_compute_half_image_uav_hardwarematched 32 + 1,280 + 512 + 256 + 3,072 + 1,536 = 6,688 halfwords across the six views, the same total you reported. The shifted-W control printed16 differences, first component 256 expected 5100, read 3c00. The 1D-array control printed1D-array D16 store compiled and was refused at manifest publication.git diff --checkagainst the merge base052abe6fis clean.Mutants (dev build,
startup_compute_half_image_uav_controlsand_hardware):Killed (12):
tex2dainstead of refused:_controlsfails on the refusal reason;tex2d; dimension 2 astex2d: both tests fail on the expected line;store_format = half.typedremoved; kind chosen by swapped channel count;narrow_half_texturenot set by the parser; typed-store query onresource.Format: all fail on a halfword mismatch;acceptswithout the typeless resource; scalar typeless set toR16G16_TYPELESS: the typeless case fails.Survive (3), none blocking:
acceptswith the view-format comparison removed (resource == typed || resource == typelessonly). The R32 controls change the view and the resource together, so nothing separates the two halves of the check. With this mutant a non-float 16-bit view of anR16_TYPELESSresource would be rebound asR16_FLOAT. AnR16_UNORM(orR16_UINT) view of the typeless texture that expects the D16 refusal and untouched sentinels would pin it.b.array_count == 1relaxed to>= 1in the publisher: no case has a descriptor array of a half kind.channels 3on ahalf tableline: the publisher never writes it, and no test feeds the runtime a hand-written line.Equivalent in practice (1):
acceptswith the resource-format comparison removed. A createdR16_FLOATview implies anR16family resource, and an uncreated view is refused earlier.Not run: a mutant that disables the typed-store support check. My pattern for it matched twice, and on this adapter the format supports typed stores, so it could not have been killed here.
Title run: the run of this head gave no verdict (job 32 ended in
errorwithout a run result), so this review does not include one.Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; Python 3.12.10; NVIDIA GeForce RTX 5090 driver 32.0.16.1088, debug layer enabled; inbox WARP 10.0.26100.9818 (4 lanes, wave32 cases skipped).
CI:
Build and test on Windowspassed on905db2e4; as noted earlier in the thread, that job does not run thehalf_image_uavtests.This reply was AI-assisted.
@JohnConnorNPC on GitHub · 2026-11-29 13:11 UTC · original
Thanks for the 1D-array control and the special-value probes. I re-checked
905db2e4against currentmain(c04e0dd6). Our two earlier points are answered:tests/startup_compute_half_image_uav_check.pynow expectsunsupported startup runtime manifest bindings: UAV kind half2_texture_uav 1d-arrayfor a source-built D16 1D-array store. pigalot's mutant that maps dimension 4 totex2dafails on that reason.d3d12_compute_dispatch.inlnow listsuav <i> <dimension> <float|half> table <param> <byte> channels <n>, next to thebufhalfform.The only thing left is the conflict in
tests/startup_stream_consumer.cppthat pigalot and Leyukaka described. It is still the only conflict onc04e0dd6(git merge-tree --write-tree c04e0dd6 905db2e4exits 1, one file). This publisher runs on the native compute path, which #3451 made the launcher default. So oncemainis merged in, the new tests need a re-run on the merged head. After that, nothing from us blocks it.Environment: Linux only: git objects and
git merge-tree. I did no build, WARP or GPU run.This comment was AI-assisted.
@Leyukaka on GitHub · 2026-11-29 20:36 UTC · original
Update to our 11-29 12:06 comment, which named only the mode flags: on
mainff9dcef0,git merge-tree --write-tree origin/main 905db2e4now reports conflicts in two files.tests/startup_stream_consumer.cpp: the mode flags at the top oftexture_slot67(main now also haszero_wandnative_inputsnext tosampled), and the Texture3D view line, where main'sif (zero_w) view.Texture3D.WSize = 0;and this branch'sshifted_w ? 0u : 1uare both needed.src/startup_stubs/d3d12_compute_dispatch.inl: the header comment and the slot struct, where bothatomic(from #3456) andnarrow_half_textureshould be kept.We will review again after the rebase.
@Leyukaka on GitHub · 2026-12-01 16:14 UTC · original
Taking this over since there has been no activity for 48 h; will hand back if you resume. Your commits stay as they are and keep your authorship; I will rebase onto current
main, address the open review points and report the test results here.@Leyukaka on GitHub · 2026-12-01 17:42 UTC · original
Continued in #3768 (rebased onto
main, review points addressed, local test results in the description). Your commits are kept with your authorship; if you resume, say so there and I will hand it back.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.