compute: publish packed_d16_x_uav runtime manifest (Part of #3224) #3389
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3389"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-28T18:51:13Z.
Part of #3224 (claim: https://github.com/R0Y00/Xbox2Windows/issues/3224#issuecomment-7243078501).
In a 900 s start-up on the Windows test PC, runtime from main
aec2e08, 23 shaders and 86,436 untranslated dispatches (5.7% of that run's untranslated compute dispatches) were refused withunsupported startup runtime manifest bindings: UAV kind unknownfor this binding. The shader compiled, and the published route had no manifest line for it.Change
The manifest token is
uav <register> packed_d16_x table <parameter> <byte>.buffer_store_format, including the MTBUF form, stayspacked_d16_x_uav. The store staysvalue & 65535thenbufferStore.i32. Two- and four-component D16 stores stayhalf_buffer_uavand still publishbufhalf.format_compute_runtime_manifestwritesuav N packed_d16_x table R Bfor one register and a two-byte payload.view_kind_namenamespacked_d16_x_uavandindexed_raw_srv, with the static assert that keeps the last name aligned with the enum. That names change is not on main.load_compute_translationreads the line. The placed view usesnative_buffer_store_view:R16_FLOATandR16_UINTbind asR16_UINT, andR32_UINTstaysR32_UINTwith a 4-byte element. A descriptor that matches none of those refuses witha half buffer store requires matching format, stride and structured bounds.tests/startup_compute_half_buffer_uav_check.pyexpectsuav 0 packed_d16_x table 1 32for the one-channel stride-2 case, including both MTBUF forms. Wider D16 stores still expectbufhalf.tests/startup_compute_packed_d16_x_uav_check.pyexpects the same line. TheR16_FLOATview checks the halfwords. TheR32_UINTview checks the zero-extended dwords. A wrong stride and a swizzle flag still refuse and leave the buffer untouched.Tests
Linux: the python-linux check step (
tools/run_checks_parallel.py --from-dir tests/checks/python-linuxplus the workflow's script list) passes all 260 checks.docs_links_check.pyandstartup_compute_store_d16_x_check.pyalso pass.tests/native_compute_manifest_reasons.cppcompiles withg++andclang++ -std=c++17 -Wall -Wextra -Werror -Werror=narrowing.Windows test PC (RTX 4070 Ti) at head
32406a35, preset dev: build exit 0, then35/35 passed, ctest exit 0 (
startup_compute_half_buffer_uav_warpandstartup_compute_packed_d16_x_uav_warpskipped, as on WARP elsewhere).startup_compute_half_buffer_uav_controlsandstartup_compute_half_buffer_uav_hardwarepass at this head.AI-assisted (Cursor)
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T19:22:04Z.
Review: COMMENTED
APPROVED -- passes AGENTS.md rules.
Checked against hard rules:
Code review:
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T20:32:22Z.
Review: APPROVED
LGTM — clean, well-tested.
Adds
packed_d16_x_uavandindexed_raw_srvto the view_kind_name table, publishesbufd16xmanifest for one-component D16 stores, and addspacked_d16_x_view_refusalwith proper format/stride/swizzle validation. Dispatch stubs handle the new manifest line; native runtime validates format support. Test fixture covers positive path, three negative controls, and reference-only checks.Ready to land.
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T21:57:01Z.
Review: APPROVED
LGTM — clean, well-tested.
Adds
packed_d16_x_uavandindexed_raw_srvto the view_kind_name table, publishesbufd16xmanifest for one-component D16 stores, and addspacked_d16_x_view_refusalwith proper format/stride/swizzle validation. Dispatch stubs handle the new manifest line; native runtime validates format support. Test fixture covers positive path, three negative controls, and reference-only checks.Ready to land.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T00:10:44Z.
Head
82984b07.By its diff (not built here), this makes
startup_compute_half_buffer_uav_controlspass by undoing the #3091 store classification. On main0614f68cthat test fails in CI (run 46194701708) withno_manifest ... unsupported startup runtime manifest bindings: UAV kind unknownfor the 1-channel store.src/gfx1013_direct_compute.inl:750-752dropspacked_x. A one-component D16 store ishalf_buffer_uavagain and publishesuav 0 bufhalf table 1 32 bytes 2through the existing branch (direct_compute_cache.cpp:979-982). That is the line the test asserts.The only producer of
packed_d16_x_uavon main isgfx1013_direct_compute.inl:743-745, and this PR removes it. Nothing else produces that kind, so the following are unreachable and no test publishes or reads abufd16xline:bufd16xemit (direct_compute_cache.cpp:983-986);d3d12_compute_dispatch.inl:271-275);:873-879);packed_d16_x_view_refusal(:100-138);:923,:951,:975-986).The three negative descriptors in the new fixture are refused by the existing half-buffer check.
Compared with main, the store goes back from
and 65535+bufferStore.i32tolegacyF16ToF32+bufferStore.f32. On the native-module route, main accepts an R16_FLOAT, R16_UINT or R32_UINT view for it (native_buffer_store_view.h:64-69). The half-buffer check accepts R16_FLOAT only (:70-73).The Windows CI job on this PR (run 46178085395) ran the
prpreset, 73 tests. Neither the half-buffer tests nor the newpacked_d16_x_uavtests were in it.The
view_kind_namechange (direct_compute_cache.cpp:897) is the same line as #3395.Measurements, local:
0614f68c,startup_compute_half_buffer_uav_controlsandstartup_compute_half_buffer_uav_hardwarefail.native_compute_manifest_reasons|startup_compute_half_buffer_uav.*|native_compile_dxil.*. The change:uav N packed_d16_x table R Bfromformat_compute_runtime_manifest;load_compute_translation;compile_dxil gfx1013-direct-cs@0 --requests.3f780716(before #3091) and getunsupported startup runtime manifest bindings: UAV kind unknownon0614f68c.incompatible formatted store widths on one slotto the same reason.At
82984b07this fixes the CI failure as a revert of the #3091 classification. Either describe it as that and drop the unreachablebufd16xcode, or keep the packed classification and publish its line, updating the half-buffer test's 1-channel expectation (including the MTBUF cases added by #3353).Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-29T00:41:35Z.
@Leyukaka Took option 2, and rebased onto current main (head
32406a35).packed_d16_x_uavwith the integer store (and 65535, thenbufferStore.i32). The manifest line isuav N packed_d16_x table R B, with no bytes field, andbufd16xis gone.load_compute_translationreads it. The placed view acceptsR16_FLOAT,R16_UINTandR32_UINTthe same waynative_buffer_store_viewdoes: the two R16 formats bind asR16_UINT, andR32_UINTstaysR32_UINT. A descriptor that matches none of those still refuses with the half-buffer shape reason, so the existing one-channel negatives stay.view_kind_namestill namespacked_d16_x_uavandindexed_raw_srvwith the same static assert, since that names change isn't on main.src/gfx1013_direct_compute.inlmatches main again.Linux: python-linux passed 260/260.
Windows test PC: build exit 0, and
native_compute_manifest_reasons|startup_compute_half_buffer_uav.*|native_compile_dxil.*|.*packed_d16.*|.*store_d16_x.*passed 35/35 at32406a35(two WARP runs skipped), ctest exit 0. That includesstartup_compute_half_buffer_uav_controlsand_hardware.AI-Assisted
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T01:07:54Z.
Review: APPROVED
Verdict: APPROVE (diff-only, head
32406a35)Head
32406a35. Re-read by its diff (not built here).The packed route is now consistent end to end:
gfx1013_direct_compute.inlis unchanged from main, so a one-component D16 store (MUBUF, and MTBUF via the #3353 rewrite tobuffer_store_format0x84) stayspacked_d16_x_uav.direct_compute_cache.cpp:985emitsuav N packed_d16_x table R B,d3d12_compute_dispatch.inlparses the same token, and the placed view goes throughpacked_d16_x_view_refusal(:99) andnative_buffer_store_view.startup_compute_half_buffer_uav_check.pyexpects that line for stride 2, and requires that nobufhalf ... bytes 2line is present, in all three forms (MUBUF, MTBUF indexed, MTBUF first element). The dispatch half of that fixture sends its one-channel negatives (stride, swizzle, format, dst_sel, OOB_SELECT) throughpacked_d16_x_view_refusal; the range negative is still refused earlier by the placed-range check.startup_compute_packed_d16_x_uav_{warp,hardware}adds the R32_UINT view.native_compute_manifest_reasonschecks both the published line and the refusal forrequired_bytes4.Coverage: CI run 46207060926 ran the
prpreset (73 tests). It does not includenative_compute_manifest_reasons,startup_compute_half_buffer_uav_*orstartup_compute_packed_d16_x_uav_{controls,warp,hardware}. Only the Linuxreferencehalf ran. The Windows result rests on the author's 35/35 run, and the dispatch checks run on hardware only (the author reports the two WARP runs skipped, so the dispatch checks ran on hardware only).Not covered by any test in the diff:
:875-880, andpacked_d16_xat:910). No fixture uses a token output with the packed line;word3_flags(:121). Only bit 28 and the stride-field swizzle bit are exercised, soword3_flags = 0would pass;unified &&(:110-117). No descriptor clears bit 24;b.array_count == 1in the emit (direct_compute_cache.cpp:985). There is no array case for this kind.Merge:
git merge-treeagainst main212d4b5fis clean, and so is a merge with #3395 at1eca8d54, whoseview_kind_namehunk is identical.Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T12:55:21Z.
Review of head
866e48efagainstmain77d1ba4d. The merge was clean (git merge-tree --write-tree origin/main 866e48efexits 0). Merged asaf1cab5c.The source and test changes are the same as at the approved
32406a35. For every file exceptCMakePresets.json,git diff 51472392 32406a35 -- <f>andgit diff 77d1ba4d 866e48ef -- <f>have the same+/-lines: docs and tests have equalgit patch-id --stable, anddirect_compute_cache.cppandd3d12_compute_dispatch.inldiffer in context lines only.866e48efaddsstartup_compute_packed_d16_x_uav_referenceto theprfilter, and CI run 46262842646 ran it:47/82 Test #2888: startup_compute_packed_d16_x_uav_reference ... Passed,100% tests passed out of 82.Checked, in addition to the earlier reviews:
packed_d16_x_view_refusaluses the gfx10 buffer FORMAT codes (11 = 16_UINT, 13 = 16_FLOAT, 20 = 32_UINT), bit 24 as RESOURCE_LEVEL and DST_SEL_X = 4.0xcef80000covers TYPE, bits 25-27, ADD_TID_ENABLE, INDEX_STRIDE and bits 19-20.translate_compute_nativelysetshalf_typed_bytes = view.required_bytes(2) forpacked_d16_x_uav, and each new dispatch branch requiresslot.packed_d16_x && !slot.half_typed_bytes. So only slots read from a manifest take the new branches.NIT
run.shandrun.ps1setX2W_NATIVE_SHADERS_ONLY=1, andload_compute_translationreturns atif (native_shaders_only()) {before it reads<key>.txt. The new line is parsed only in-TranslateorX2W_NATIVE_SHADERS_ONLY=0runs. The in-process route already binds this kind throughnative_buffer_store_view, so nothing is lost. But the 86,436 dispatches in the body and inpacked-d16-x-uav-manifest.mdare a published-route count fromaec2e08, and a default run will not show that drop.static_assert(std::size(names) == static_cast<size_t>(ComputeViewKind::indexed_raw_srv) + 1)is anchored on a kind that is no longer the last one. Onmain,heap_typed_srvfollows it (c24ea568, #3042), soheap_typed_srvstill printsunknownand the assert does not catch that, contrary to its comment. No reason text changes today, becauseheap_typed_srvis always atcompute_resource_heapand is refused earlier asresource heap view. The comment also starts with a strayponytail:. #3333 extends this list withheap_typed_srvandroot_buffer_uavand now conflicts with it. I've noted the resolution there.AI-assisted.