runtime: bind cube texture SRVs for published native compute #3351
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3351"
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 JB2WIN on 2026-11-28T11:29:38Z.
Refs #3224. Follows #3306 (1D, 2D-array and 3D texture SRVs).
The direct translator declares a cube sample or gather as a TextureCubeArray (DXIL resource kind 9, layer = face >> 3). The published compute manifest had no line for it, so these programs got no
<key>.txt.cube_sample_srvwith one descriptor and the cube dimension publishessrv N texcubearr table R B.texcubekeeps its draw meaning (TextureCube).texcubearrneeds a recorded TEXTURECUBE view that fits its texture (six slices). The view is rebuilt as a one-cube TEXTURECUBEARRAY with the same mips and format. Named refusals: no recorded view description, view not cube, view does not fit.Impact, local 2,689-request cohort, measured on the #3306 head with only the writer swapped back: 382 -> 413 manifests (+31), every new one has a
texcubearrline, the other 382 are byte-identical.Tests:
native_compute_manifest_reasons: the published line, and the cube kinds that stay refused.startup_compute_dispatch_cube_{controls,warp,hardware}: 2x2 R32_FLOAT cube, 24 distinct texels, lanes over all six faces at texel centres, readback checked against the D3D face mapping (not the translator's own table). Debug layer on, no message. Controls: TEXTURE2DARRAY view, no view description, 12-slice cube view, manifest rewritten totex2da,tex2dortexcube; each refuses by name and leaves the output untouched.[WaveSize(32)]pipelines, so the WARP run uses an equivalent HLSL program; the hardware run uses the translated DXIL.src/changes reverted,native_compute_manifest_reasonsand the three cube tests fail.startup_compute|native_compile_dxil|direct_compute|compute_manifestpass on the rebased branch.Limits:
X2W_NATIVE_SHADERS_ONLY=1, andload_compute_translationreturns before it reads<key>.txt, so thetexcubearrreader is not reached. The in-process route still refusescube_sample_srv("view kind ... is not bound for a natively translated program"). The binding applies with-TranslateorX2W_NATIVE_SHADERS_ONLY=0.image_loadon a cube never reaches publication: the translator refuses it first (unsupported cube or multisample operation).Ran on RTX 3080 (32.0.16.2124) and WARP, DXC 1.8.2502.11, Windows 26200.
AI-assisted.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-28T12:39:46Z.
Independent verification at
12568d8acb5a4c7a90a04e5b2e28adae022f93a2. Debug and Release each passed 5/5 for^(startup_compute_dispatch_cube_.*|native_compute_manifest_reasons(_requests)?)$on RTX 4070 (driver 32.0.16.2124) and app-local WARP 1.0.22 (Windows 26300.10075, DXC 1.9.2602.17). The stock WARP fixture in that count uses the HLSL replacement.I also ran the original native blob on app-local WARP, which passed the separate forced-wave32 probe. In a scratch runner I left the published
<key>.cs.csoin place instead of callinghlsl_program. The stand-in logged one translatedDispatch(3, 2, 2), but all 288 output slots kept their sentinels in both builds. The first expected word was0x42c80000, actual0xc5c5c5c5.With one fixture-only change, prepend
s_mov_b32 exec_lo, 0x00ffffffbefore the original guest words. That mask covers exactly the 24 guest threads. Still using the native blob, all 288 samples across the six faces matched in both builds. The six view and manifest refusal controls preserved the output and the debug layer reported no errors. This is consistent with the partial-wave entry EXEC behavior tracked in #3160. It verifies the cube-binding path on this WARP build when guest EXEC is explicit and leaves the original fixture failure visible.I used Codex for the scratch runner and ran the verification locally.
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-28T19:10:45Z.
Thanks for running it on both. The WARP fixture uses the HLSL replacement on purpose, since stock WARP builds do not all create the
[WaveSize(32)]pipeline from the native blob. Your result fits that: with an explicitexec_lofor the 24 threads the native blob matches, and without it the outputs keep their sentinels, which is the partial-wave entry EXEC behavior from #3160. The hardware run uses the native blob. I left the fixture unchanged so that failure stays visible until #3160 is settled.Rebased onto main to resolve the
startup_stream_consumer.cppconflict (main'sdispatch-scalar-windowblock kept, cube condition unchanged); the cube tests andnative_compute_manifest_reasonspass on the new head. Four compute tests (startup_compute_dispatch_output_{warp,hardware},startup_compute_half_buffer_uav_{controls,hardware}) fail there too, but they fail the same way on mainf5a6f6bawithout this commit, so I'll look at that separately.AI-assisted
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T20:59:04Z.
Review: APPROVED
LGTM — clean cube texture support for the published native compute route.
Patches
format_compute_runtime_manifestto emitsrv N texcubearr table R Bfor cube_sample_srv, addstexcubearrto the manifest reader (mapping to D3D12_SRV_DIMENSION_TEXTURECUBE), and rewrites the title's TEXTURECUBE view as a one-cube TEXTURECUBEARRAY at dispatch time. The fixture verifies correct D3D face mapping for 24 distinct texels, and refuses -array, -undescribed, -twelve, and manifest mutants.Ready to land.
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T21:57:37Z.
Review: APPROVED
LGTM — clean cube texture support for the published native compute route.
Patches
format_compute_runtime_manifestto emitsrv N texcubearr table R Bfor cube_sample_srv, addstexcubearrto the manifest reader (mapping to D3D12_SRV_DIMENSION_TEXTURECUBE), and rewrites the title's TEXTURECUBE view as a one-cube TEXTURECUBEARRAY at dispatch time. The fixture verifies correct D3D face mapping for 24 distinct texels, and refuses -array, -undescribed, -twelve, and manifest mutants.Ready to land.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T06:04:05Z.
Review: APPROVED
Reviewed the diff at
932b6e8aby reading only (not built or run).git merge-treeagainst main212d4b5fis clean.Checked:
src/direct_compute_cache.cpp:969-973):texcubearris published exactly for what the translator on main declares as kind 9:cube_sample = dim == 3 && (sample || gather)(src/gfx1013_direct_compute.inl:1081), handle kind9u(:1105), layerface >> 3(:1201).src/startup_stubs/d3d12_compute_dispatch.inl:195):texcubearrrequires a recorded TEXTURECUBE view.address_view_fitson main limits it to a 2D resource of exactly 6 slices with MinLODClamp 0 (src/startup_stubs/address_texture.h:104-106).d3d12_compute_dispatch.inl:702-715): works on a local copy of the recorded description, reads the mips before writing the union, and the field order matches both structs.tests/startup_compute_root_srv_dispatch_check.py:175-179, which the PR updates.project()matches the D3D sc/tc table for all six faces, anddirection()is its inverse.Points:
docs/experiments/startup-compute-native-dispatch.md:97describesimage_loadon a cube as "a plaintexture_srvof the cube dimension", refused at publication. The translator refuses it earlier (gfx1013_direct_compute.inl:1075-1077, "unsupported cube or multisample operation"), so it never reaches the writer. Atexture_srvof dimension 3 comes from the size query (dimensions, op 14,:1029), declared as kind 5.docs/startup-runtime.md:1015anddocs/experiments/native-compile-dxil-refusals.md:29listimage_loadon a cube among the unpublished view shapes for the same reason.MipLevels = levels->1, andMostDetailedMip = most_detailed->0. The fixture view is{0, 1, 0.0f}on a one-mip texture. The stand-in enables the debug layer without GPU-based validation (src/startup_stubs/d3d12_xs_device.cpp:8025-8031), so a view/declaration dimension mismatch is not reported.manifest tex2daandmanifest tex2dcontrols end in reader branches that already exist on main. The controls that depend on this change are-array,-undescribed,-twelve,manifest texcubeand the three newnative_compute_manifest_reasonscases.--preset pr. Its targets include neithercompile_dxilnorstartup_stream_consumer, and its filter matches none ofnative_compute_manifest_reasons,startup_compute_dispatch_cube_*orstartup_compute_root_srv_*, so none of the changed tests ran. After merge, the push run excludes_hardware$, so the translated-DXIL cube path is covered only by local hardware runs.Verdict at
932b6e8a: approve. The code is correct as far as reading shows. Point 1 is a wording fix that can follow; points 2-4 are coverage notes, not blockers.Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T12:06:53Z.
This branch conflicts with
main1990feadintests/startup_stream_consumer.cpponly (one region): main added anif (mode == "dispatch-input-committed-token") { ... }block at the place where this branch addsif (mode.rfind("dispatch-cube", 0) == 0) { ... }.Resolution: keep both blocks, each with its own closing brace (the conflict leaves a single shared
}after the markers).Nothing else is open from my review: the approval is on
932b6e8a, and the doc wording in point 1 can follow.Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T12:55:30Z.
Review of head
932b6e8aagainstmainaf1cab5c. Read only, nothing built or run.MUST
main.git merge-tree --write-tree --name-only origin/main 932b6e8aexits 1 withCONFLICT (content): Merge conflict in tests/startup_stream_consumer.cpp, in one region. All source files merge cleanly. The 12:06 resolution still applies onaf1cab5c: keep both blocks, each with its own closing brace. Please rebase.SHOULD
1990fead) landed after this branch's basef5a6f6ba. The launchers now setX2W_NATIVE_SHADERS_ONLY=1, andload_compute_translationreturns atif (native_shaders_only()) {before it reads<key>.txt. So nothing reads the newtexcubearrline (if (!std::strcmp(name, "texcubearr")) return D3D12_SRV_DIMENSION_TEXTURECUBE;is insideload_compute_translation) in a default run. The in-process route has no cube case. Itstexture_inputaccepts onlytexture_srvorcomparison_texture_srvatimage_dimension == 1, socube_sample_srv(enum value 14) is thrown asview kind 14 is not bound for a natively translated program. The cube binding therefore helps only-TranslateorX2W_NATIVE_SHADERS_ONLY=0runs. Please say so instartup-compute-native-dispatch.mdand the body when you rebase. The doc wording onimage_load(point 1 of the 06:04 review) can be fixed in the same push.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-29T13:07:07Z.
Merged current
main(af1cab5c) to clear the conflict:tests/startup_stream_consumer.cpphad the newdispatch-input-committed-tokenmode (#3431) next todispatch-cube; both modes are kept. Local run ond456d3f2:startup_compute_dispatch_cube_{controls,warp,hardware},startup_compute_dispatch_input_{warp,hardware},startup_compute_dispatch_output_{warp,hardware},native_compute_manifest_reasons{,_requests}: 9/9 passed.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T13:22:42Z.
Re-review of the delta
932b6e8a→d456d3f2, a merge of mainaf1cab5c(read-only, on Linux; no build or run here). MUST 1 (the conflict) is resolved. Two doc SHOULDs are still open, so I'm not merging yet.Resolved
git show --remerge-diff d456d3f2changes onlytests/startup_stream_consumer.cpp. Both blocks are kept, and the PR'sdispatch-cubeblock gets its own closing}ahead of main'sdispatch-input-committed-tokenblock, which is the resolution from 12:06. The PR's own changes are the same as before:git diff --stat af1cab5c d456d3f2andgit diff --stat f5a6f6ba 932b6e8aboth show11 files changed, 391 insertions(+), 19 deletions(-).git merge-tree --write-tree origin/main d456d3f2exits with rc 0 on current mainc04e0dd6. Your local 9/9 run ond456d3f2covers the cube controls, WARP and hardware tests, plus the input and output dispatch tests next to the resolved region.Still open (SHOULD)
docs/experiments/startup-compute-native-dispatch.mdtouches theimage_loadsentence. It still says thatimage_loadon a cube (a plaintexture_srvof the cube dimension) is refused at publication. In fact the translator refuses it first (unsupported cube or multisample operation), and a dim-3texture_srvcomes only from the size query.X2W_NATIVE_SHADERS_ONLY=1, andload_compute_translationreturns before it readstexcubearr. The in-process route still throwsview kind 14 is not bound for a natively translated programforcube_sample_srv. So this binding takes effect only in-Translateruns or withX2W_NATIVE_SHADERS_ONLY=0. Please state that in the doc and in the PR body.Both fixes are doc-only. Once they are pushed, this is ready to merge. The approvals are on
932b6e8a, and the code is unchanged since then.This comment was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T13:28:07Z.
Review: APPROVED
Re-checked the delta
932b6e8a->d456d3f2by reading only (not built or run).d456d3f2is a merge commit with parents932b6e8aand mainaf1cab5c.git diff -U0 f5a6f6ba 932b6e8aandgit diff -U0 af1cab5c d456d3f2are the same (11 files, +391/-19 in both).git show --remerge-diff d456d3f2touches onlytests/startup_stream_consumer.cpp. The resolution keeps both blocks:dispatch-cubegets its own closing}, followed by main'sdispatch-input-committed-tokenblock unchanged.git merge-tree --write-treeagainst main17b662a2is clean.Still open, doc-only, not blocking:
docs/experiments/startup-compute-native-dispatch.md:99still listsimage_loadon a cube as "a plaintexture_srvof the cube dimension" refused at publication. The translator refuses it first (src/gfx1013_direct_compute.inl:1135-1137, "unsupported cube or multisample operation"); a dimension-3texture_srvcomes only from the size query.docs/experiments/native-compile-dxil-refusals.md:29lists the same case among the kinds without a manifest line.load_compute_translationreturns atif (native_shaders_only())(src/startup_stubs/d3d12_compute_dispatch.inl:174) before it reads<key>.txt, so thetexcubearrreader (:240) is not reached; the launchers setX2W_NATIVE_SHADERS_ONLY=1unless-Translateis given (tools/startup/run.ps1:84-101,tools/startup/run.sh:176-178). The in-process route accepts onlytexture_srvandcomparison_texture_srvwithimage_dimension == 1as texture inputs and throws "view kind ... is not bound for a natively translated program" for the rest (d3d12_compute_dispatch.inl:400-409). The cube binding therefore applies only with-TranslateorX2W_NATIVE_SHADERS_ONLY=0.startup-compute-native-dispatch.md(around:92-100) and the PR body should state it.The coverage notes 2-4 of the earlier review are unchanged.
Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T13:36:52Z.
This was ready to merge at
d456d3f2(0 MUST, approved at head). #3398 landed just before, and now the branch conflicts withmain4b0586d4.git merge-tree --write-tree --name-only origin/main d456d3f2exits 1 with two conflicts. Source files merge cleanly.docs/startup-runtime.md: the native dispatch paragraph.mainnow lists the texture UAVs from #3398 (four-channel float and packed half4 UAVs in 1D, 2D, 2D-array and 3D; exact-width float UAVs in 2D, 2D-array and 3D), plus root buffer SRVs, and says "Cube texture SRVs are not published." Keepmain's wording. Replace that last sentence with this branch'stexcubearrsentence, and correct itsimage_loadclause the way the earlier doc SHOULD asked.tests/native_compute_manifest_reasons.cpp: thepublished[]table.mainkeys each row bybinding(0 = SRV, 1 = UAV) and adds fouruav 0 tex* float … channels 4rows. This branch keys rows bykindand adds{K::cube_sample_srv, 3, "srv 0 texcubearr table 1 64\n"}. One way to merge them is to keepmain'sbindingfield, add aK kindfield, listmain's eight rows plus the cube row, and setbinding.kind = c.kindin the loop.Please merge
mainagain and re-runnative_compute_manifest_reasons{,_requests}andstartup_compute_dispatch_cube_{controls,warp,hardware}. Since 0 MUST is open, it merges once the branch is clean.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-29T13:54:44Z.
Merged
main(e3f9a64f) again and addressed both doc points (bcaacadfmerge,d396c1e1docs):docs/startup-runtime.md: kept main's wording and replaced "Cube texture SRVs are not published." with thetexcubearrsentence;image_loadon a cube is now described as refused by the translator; added the default-route note.tests/native_compute_manifest_reasons.cpp: one table withbindingandkind, main's eight rows plus the cube row,binding.kind = c.kind.startup-compute-native-dispatch.mdandnative-compile-dxil-refusals.md: theimage_loadclause and the default-route note. PR body updated.Local on
d396c1e1:native_compute_manifest_reasons{,_requests}(the run printspublishes srv 0 texcubearrand the fouruav ... channels 4rows),startup_compute_dispatch_cube_{controls,warp,hardware},startup_compute_dispatch_{input,output}_{warp,hardware}: 9/9 passed.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T14:02:19Z.
Re-review of the delta
d456d3f2→d396c1e1(read-only, on Linux; no build or run here). Verdict: merge (0 MUST).bcaacadf, merge of maine3f9a64f).git show --remerge-diff bcaacadftouches only the two conflicting files. Indocs/startup-runtime.mdmain's paragraph is kept, and "Cube texture SRVs are not published" is replaced by thetexcubearrsentence. Intests/native_compute_manifest_reasons.cppmain'spublished[]table, keyed by binding, gains akindcolumn and the{0, K::cube_sample_srv, 3, "srv 0 texcubearr table 1 64\n"}row.binding.kind = c.kindgives the four UAV rowsK::texture_uav, the same as main'sc.binding == 0 ? K::texture_srv : K::texture_uav.src/andtools/match betweenaf1cab5c..d456d3f2ande3f9a64f..d396c1e1. The approved code is what merges.image_loadsentence now says the translator refuses it first (unsupported cube or multisample operation). The default-path note matches the code:run.ps1setsX2W_NATIVE_SHADERS_ONLY = "1"on the native branch and"0"otherwise, andload_compute_translationreturns undernative_shaders_only()before it reads<key>.txt.git merge-tree --write-tree origin/main d396c1e1rc 0. Windows, Linux and gfx1013 CI pass atd396c1e1.git diff --checkrc 0.The two NITs (rewrite unpinned, cube gather and faces ≥ 8 not run) are stated in Limits and do not block the merge.
AI-assisted review.