shader: compile native mesh interfaces and prewarm compute requests #3091
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3091"
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 R0Y00 on 2026-11-27T14:53:36Z.
Integrate native compilation of the supported fixed mesh/pixel interfaces, descriptor waterfalls and reviewed resource layouts. The C++ frontend also accepts tagged compute state and scalar buffer windows, and can publish and validate a versioned compute frontend pack. Cache identity includes the new lowering sources. The compiler watcher invalidates entries when the slot-57 pixel input sidecar changes.
This is the compiler prerequisite for a separate runtime integration. Refs #2907 and #2981. All new fixture inputs are source-built.
Verified at
a48d39dc1ein a clean x64 Windows Release worktree, MSVC 19.51, Windows SDK 10.0.26100.0.8 passed, 0 failed, 0 skipped. These controls check desktop bytecode generation, mesh input rejection, WQM IR, immutable request identity and cache publication. Runtime bindings and submitted GPU results are covered by the dependent runtime change.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T14:55:58Z.
The trial merge of
94d2803fintomainca659396has one conflict insrc/gfx1013_compute_native.cpp. In symbolic transfer, please retain both main's_i64high-word invalidation from #3067 and this PR's wave64QuadComparehigh-word invalidation. GitHub currently reports the PR as conflicted and has no check results for this head.For GPU review, please cover the new RTV specialization against main, including the cache key change and RTV mismatch or missing-sidecar refusals; check that old and revised cache identities cannot reuse incompatible DXIL; and exercise the offline C++ request path through
compile_dxil, including the sidecar-change invalidation and frozen request/pack controls. The dependent runtime PR still needs its own draw and GPU verification.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T15:06:52Z.
Review: COMMENTED
The current integration with
mainca659396(tree3e49c5cfe4eef1784fcce70ef00ccf5a7d46ab10) retains both_i64and wave64QuadComparepair invalidation. Debug and Release/O2each passed nine compiler-only tests, includingnative_rtv_variant_controlsandnative_salu_shift64_controls. The RTV suite produced byte-identical cold and warm outputs for the base and four variants, and its 13 refusals preserved the expected failure markers.One watcher behavior still needs a control. I used the source-built stream request in
native_startup_request_cache_check.py, published it withcompile_dxil --watch ... --once, then added a contradictory.ps57inwith an older preserved timestamp. A second--watch --oncekept the old.txtbyte-identical and did not refuse the conflict. Giving the identical.ps57ina newer timestamp caused the watcher to withdraw the manifest and reportconflicting stream and slot-57 pixel entry records. The cached-manifest fast path currently checks only the latest sidecar mtime. Please check the sidecar shape or identity before it accepts a cached graphics result, and cover the preserved-timestamp case.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T15:16:37Z.
An updated trial merge of
a48d39dcintomaina9fd1488found one new overlap insrc/gfx1013_direct_compute.inl, where #3068 added explicit LOD gather. The earlier_i64/QuadCompareconflict is resolved. Please preserve the explicit-gather helper and its validation alongside the indexed pixel-heap path. Keep the explicit gather scoped to the fixed table-bound SRV from #3068 unless a separate indexed-gather case proves that extension. After the merge, rerunnative_gather_lod_controlstogether with the slot-57 and RTV compiler checks.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T16:09:35Z.
Updated conflict diagnosis for
a48d39dc. My local trial overmain55669240(treeaf03ca4c6a2b8cdcea1e1094da54fe4a5fc45c96) resolves two files and preserves all three overlapping behaviors. Ingfx1013_compute_native.cpp, keep wave64QuadCompareand main's_i64/_u64high-word rules, including #3073's_i32_destination exception. Ingfx1013_direct_compute.inl, keep the #3068 explicit LOD gather helper with fixed table-bound SRV validation, the merged #3007 unfused MAD/MAC path, and both SCC overwrite classifications (s_andn2_wrexec_b64and the #3073 bit counts).Built
compile_dxil native_compute_pack_check native_frozen_request_check native_pixel_ir_dumpindevandrelease.ctest --test-dir <build> --no-tests=error -j 1 -V -R '^(native_(direct_(container|mesh)|frozen_request|compute_pack|graphics_(interface_library|wqm_ir)|startup_request_cache_controls|salu_shift64_controls|rtv_variant_controls|gather_lod_controls|mad32_controls))$'passed 11/11 in each configuration with no skips. This is a local conflict trial. The published PR still needs an updated head and the preserved-timestamp.ps57inwatcher case remains open.Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-27T17:02:36Z.
Opened #3138 targeting
codex/native-shader-modulesfor the #3133 preserved/older-mtime.ps57in/.psinwatcher invalidation case (verifiednative_compile_dxil_watchand^native_.*_(controls|ir)$26/26). AI-assisted.Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T17:04:11Z.
Cross-reference: an independent Windows receipt of the stacked compiler+runtime branch at
b80513fd(compiler ata48d39dc) is posted in #3094. A 300 s diagnostic run reaches neitherExecuteIndirectnor a translated compute dispatch, so the runtime effect of the stack is not yet visible in the title path. The compiler-side fixture suite is unaffected by that caveat.Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T18:07:15Z.
Independent compiler-side receipt for this branch at its head
a48d39dc, run inside the stacked runtime worktree atb80513fd(Release, Windows 11 build 26300, MSVC 19.44.35228, Windows SDK/DXC 10.0.26100.0, AMD Radeon RX 9060 XT driver 32.0.32029.2010, debug layer unavailable).native_direct_container,native_direct_mesh,native_frozen_request,native_compute_pack,native_graphics_interface_library,native_graphics_wqm_ir,native_salu_shift64_controlsandnative_startup_request_cache_controlsall pass. The full fixed-mesh suite (20/20, WARP and hardware) is reported in #3094.Imported from R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-27T23:46:03Z.
I independently tested the masked resource-selection path for #3210 on
a48d39dc. A source-built raw gfx1013 PS selected between two 2D textures with distinct colors at each mip. The mixed and empty-arm draws each matched all 64 pixels (256 channels), in both guest wave32 and wave64, on RTX 4070 (32.0.16.2124) and in-box WARP (10.0.26100.10068). D3D12 reported zero errors and warnings. DXC 1.9.2602.17 emitted one nonuniform heap handle and oneSampleGradwith coarse derivatives. The no-progress backedge refused. Changing only the horizontal helper's U in a desktop control changed (6,0) from green (mip 1) to red (mip 0) on both adapters.I found one acceptance boundary in the implicit sample proof. When
image_samplewrites a VGPR that is also an input to the gradient, an earlier arm can replace that VGPR in the neighboring lanes before a later arm samples. The desktop projection computes the gradients from the entry values. In the fixture, changing the sample destination fromv[8:11]tov[2:5](UV isv[2:3]) and updating the export produces byte-identical desktop DXIL. This is a compiler observation and an unproven guest dependency. The original hardware behavior of the overlap case was outside my verification.Source-built repro
Write these little-endian dwords to
waterfall.bin. Usewaterfall.pslayoutwithmeshps1 256 256 64 guest_rootand awaterfall.rootcompiled withrootsig_1_1fromRootFlags(CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED).Change
00240802to00240202and0b0a0908to05040302for the overlap case. Compile both withcompile_dxil <dxc-dir> <cache> gfx1013-raw-mesh-ps waterfall.bin waterfall.cso.I tested a small follow-up in the image-coordinate decoder. For a projected implicit sample, refuse when a decoded spatial coordinate VGPR overlaps
[VDATA, VDATA + popcount(DMASK)). This also checks NSA and packed coordinates at the point where their registers are decoded. With the guard, the overlap fixture refuses, the same eight GPU draws still match, andctest --preset release --no-tests=error -R '^native_direct_container$' --output-on-failurepasses with the new control. I used Codex to prepare the guard and ran verification locally.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-28T00:29:56Z.
Integrated current compiler and graphics changes at
247530b0e0. Debug and Release /O2 each passed all 12 selected source-built tests on Windows 11 26200.9974, including WARP 10.0.26100.9818 and RTX 4060 Laptop driver 32.0.16.1656 for the graphics sampler case. The new watcher control copies a conflicting slot-57 record with an older timestamp and verifies that the published manifest is withdrawn. The integration also preserves main's compute sampler fixture as a separate test.Repeat with the release preset. Please recheck the current head, in particular the merged compute operand and sampler paths.
Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T01:06:36Z.
Independent check on the exact head
247530b0in a clean worktree. No source changes were made for the verification.Repeated with
--preset release.native_graphics_sampler_heap_warpand_hardware,native_direct_container,native_direct_mesh,native_compute_pack,native_graphics_interface_library,native_graphics_wqm_ir,native_compile_dxil_watch,native_startup_request_cache_controls,native_salu_shift64_controlsandnative_rtv_variant_controls.Environment: Windows 11 build 26300, MSVC 19.44.35228.0, Windows SDK/DXC 10.0.26100.0, WARP 10.0.26100.10068, AMD Radeon RX 9060 XT driver 32.0.32029.2010. The D3D12 debug layer was unavailable (
0x887a002d). The head still needs a merge of newermain; this covers the compiler/compute/sampler paths requested on the current head. AI was used.Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T01:22:20Z.
Opened #3241 to refresh this branch onto current
main57e94668. It is a merge-only PR targetingcodex/native-shader-modules; your branch was not modified directly.The merge keeps both sides in the five overlapping areas (compute request shape + wave32, sampler_heap + stride_srvs cache fields, wave-size selection + packed-state virtual waves, descriptor stride preparation once, sidecar retry + native compute manifest revision check). Validation at
cead019e: 12/12 selected compiler/compute/sampler tests in Debug and 12/12 in Release, zero skips.AI was used.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-28T03:16:35Z.
I refreshed the #3241 trial locally against main
9872074aafter #2981, #3245 and #3244. The resolved compiler treeb4508b8apassed 12/12 Release /O2 checks, including direct containers and mesh, the compute pack, WQM IR, both RTX image cache-flag readbacks, and the wave64 EXEC scalar regression. The cache-mask resolution retains the indexed-pixel modifier checks and keeps the newly admitted hints on the existing fixed-descriptor read path.Windows 11 26200.9974, RTX 4060 Laptop driver 32.0.16.1656 and SDK/DXC 10.0.26100.0.
Main subsequently advanced to
0fe4cebc(#3255). The trial now has three conflicts ingfx1013_direct_compute.inl. Two are adjacent state and lane initialization edits. The output conflict combines #3255's flat, consecutive compute-derivative quads with the branch's virtual-wave dispatch shape. Please refresh #3241's source branch and keep a control for both shapes before rerunning current-head CI and review. The dependent #3094 still needs reconciliation with #2981, including the first-draw fixture and PSO fallback tracked in #3139.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-28T06:23:20Z.
Review: COMMENTED
Independent Release retest on the published
0b505c1cafter #3138 landed. I builtcompile_dxil native_compute_pack_check native_frozen_request_check native_pixel_ir_dumpand ranctest --preset release --no-tests=error --output-on-failure -j 1 -R '^(native_compile_dxil_watch|native_direct_(container|mesh)|native_compute_pack|native_frozen_request|native_graphics_(interface_library|wqm_ir)|native_startup_request_cache_controls|native_rtv_variant_controls)$'. All nine passed with no skips on Windows 11 build 26200 and SDK/DXC 10.0.26100. That includes changed older-mtime sidecar invalidation and the unchanged sidecar cache control.Against
mainat6a1968a1, the merge still has conflicts in CMake, the direct compiler/cache and shader request/CLI files. A read-only three-way merge with the current #3094 head did not show textual conflicts for the #3138 delta. The next compiler head still needs to incorporate newer main changes and rerun hosted Windows CI. #3014 now targets main and overlaps the request helpers andcompile_dxil.cpp; please preserve the watcher content comparison when integrating it.Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-28T07:33:49Z.
Thanks for this. I reviewed head
0b505c1cagainst currentmain(c3204a9c). The opcodes all match the DXIL table, and the older-mtime watcher control from #3138 is on the head. Two things need fixing before this can land:main, and no CI has run on this head.git merge-tree --write-tree --name-only origin/main 0b505c1cexits 1 with conflicts in 7 files (22 hunks): CMakeLists.txt, direct_compute_cache.cpp, compute_native.cpp/.h, direct_compute.inl, shader_compute_request.cpp and compile_dxil.cpp.gh pr checks 3091reports no checks. The #3241 refresh doesn't contain this head (git merge-base --is-ancestor 0b505c1c <#3241 head>→ 1, so #3138 is missing there). A refresh that contains0b505c1c, then CI on that sha, would settle it.gfx1013_direct_mesh.inldecodes each index withir.binary("and", ..., "1023"). The repo's format is "each a 9-bit index with the edge flag in bit 9" (docs/experiments.md), and gfx2hlsl uses& 511u. A Python model of both decodes givespacked=0x20280600 direct=culled gfx2hlsl=(0, 1, 2)for the startup_mesh57_skeleton triangle with its edge flags (bits 9, 19, 29) set. Hardware fills that triangle. Masking with 511 (keeping the bit-31 null check), plus an edge-flag case in native_direct_mesh, would fix it.Also still open from the earlier reviews: the #3255 virtual-wave/derivative control from the 03:16 comment, and RonLogic's guard for a VDATA range that overlaps the coordinates (
v[2:5]over UVv[2:3]gave byte-identical DXIL).Non-blocking:
prpreset or named in windows.yml (grep -c→ 0), and the PR doesn't list a mutation for any of them. A red-on-mutant result per new check, or the CPU-only ones added topr, would help. They also have no docs/experiments.md row.if (compute && n == "s_bcnt1_i32_b64")can't be reached after #3073's block, and thes_ff1_i32_b32special case gives the same output as the general scan.Environment: Linux, static review only (merge-tree, greps, Python decode model). I did no build, WARP or GPU run.
This comment was AI-assisted.