Repository navigation
runtime: bind cube texture SRVs for published native compute - #3351
Conversation
|
Independent verification at 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 With one fixture-only change, prepend cmake --build --preset <dev-or-release> --target compile_dxil startup_stream_consumer d3d12_xs_shim offscreen_check native_compute_manifest_reasons
ctest --preset <dev-or-release> --no-tests=error -j 1 -V -R '^(startup_compute_dispatch_cube_.*|native_compute_manifest_reasons(_requests)?)$'I used Codex for the scratch runner and ran the verification locally. |
12568d8 to
58694f5
Compare
The direct translator declares a cube sample or gather as a TextureCubeArray (DXIL resource kind 9), which
format_compute_runtime_manifest refused ("SRV kind cube_sample_srv cube"). A cube_sample_srv of one cube
is now published as `srv N texcubearr table R B` (`texcube` keeps its draw meaning). The compute reader
takes the name; the stand-in Dispatch binds the title's described TEXTURECUBE view of a six-slice texture
as a one-cube TEXTURECUBEARRAY (same mips and format, First2DArrayFace 0, NumCubes 1), or refuses with a
name: no recorded view description, view is not cube (a TEXTURE2DARRAY or TEXTURECUBEARRAY view), or view
does not fit its texture. Cube arrays, image_load on a cube, cube comparison and descriptor arrays stay
refused at publication; gfx2hlsl.py and the in-process route are unchanged. No native output revision bump
(the line was never published before). The reader catch-all refusal now reads
"... 1D/2D/2D-array/3D/cube texture". Gather on a cube is published the same way but not run by the fixture.
Tests: native_compute_manifest_reasons (published line plus three refusals), and the new
startup_compute_dispatch_cube_{controls,warp,hardware}: a synthetic 24-lane cube-sampling program is
published with compile_dxil --requests and dispatched through startup_stream_consumer (dispatch-cube*)
against a CPU reference from the D3D face mapping (6 faces x 2x2 texels); controls are a TEXTURE2DARRAY
view, no description, a twelve-slice texture, and the manifest line rewritten to tex2da, tex2d or texcube.
WARP cannot create the translator's [WaveSize(32)] shader, so on WARP the test swaps in an HLSL equivalent
and covers the manifest, reader and view only; hardware runs the translated DXIL.
Experiment (not kept): with the TEXTURECUBEARRAY rewrite removed (the title's TEXTURECUBE desc bound as is
against the kind 9 declaration), the positive case on WARP and on the hardware adapter with the D3D12 debug
layer enabled produced no debug-layer message of any severity, all 320 words equal to the reference, no
refusal and no crash. The rewrite is therefore not observable there; it follows the declared DXIL kind.
Impact (local 2,689-request cohort, same build, writer swapped back): 382 -> 413 manifests, each of
the 31 new ones with a texcubearr line, the other 382 byte-identical. 181/181 of the startup_compute,
native_compile_dxil, direct_compute and compute_manifest tests pass (RTX 3080 and WARP); with the src
changes reverted the four new tests fail.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
58694f5 to
932b6e8
Compare
|
Thanks for running it on both. The WARP fixture uses the HLSL replacement on purpose, since stock WARP builds do not all create the Rebased onto main to resolve the AI-assisted |
KelboLive
left a comment
There was a problem hiding this comment.
LGTM — clean cube texture support for the published native compute route.
Patches format_compute_runtime_manifest to emit srv N texcubearr table R B for cube_sample_srv, adds texcubearr to 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.
KelboLive
left a comment
There was a problem hiding this comment.
LGTM — clean cube texture support for the published native compute route.
Patches format_compute_runtime_manifest to emit srv N texcubearr table R B for cube_sample_srv, adds texcubearr to 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.
Leyukaka
left a comment
There was a problem hiding this comment.
Reviewed the diff at 932b6e8 by reading only (not built or run). git merge-tree against main 212d4b5 is clean.
Checked:
- Writer (
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). - Reader (
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). - Rewrite (
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. - The catch-all string has no user on main other than
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.- These mutations survive the tests: removing the rewrite (stated in the PR),
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. - The
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. - CI on this PR builds and runs only
--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 932b6e8: 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.
|
This branch conflicts with Resolution: keep both blocks, each with its own closing brace (the conflict leaves a single shared Nothing else is open from my review: the approval is on |
|
Review of head MUST
SHOULD
AI-assisted. |
…ive/compute-cube-srv # Conflicts: # tests/startup_stream_consumer.cpp
|
Merged current AI-assisted. |
|
Re-review of the delta 932b6e8 → d456d3f, a merge of main af1cab5 (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
Still open (SHOULD)
Both fixes are doc-only. Once they are pushed, this is ready to merge. The approvals are on 932b6e8, and the code is unchanged since then. This comment was AI-assisted. |
Leyukaka
left a comment
There was a problem hiding this comment.
Re-checked the delta 932b6e8 -> d456d3f by reading only (not built or run).
- d456d3f is a merge commit with parents 932b6e8 and main af1cab5.
- The PR's own changes are identical: the added and removed lines of
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 main 17b662a is 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.- The docs do not say that the binding is outside the default path. Since the merge of main,
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.
|
This was ready to merge at
Please merge AI-assisted. |
…ive/compute-cube-srv # Conflicts: # docs/startup-runtime.md # tests/native_compute_manifest_reasons.cpp
…is off the default route Review of R0Y00#3351 (JohnConnorNPC, Leyukaka). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged
Local on d396c1e: AI-assisted. |
|
Re-review of the delta
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. |
Merge origin/main 8a30428 (upstream in this clone is remote origin, R0Y00/Xbox2Windows), which includes R0Y00#3351 and R0Y00#3454. Conflicts resolved: tests/startup_stream_consumer.cpp keeps main's mode.rfind("dispatch-cube", 0) == 0 alongside the X2W_TEST_RECORDS32=1 output-at-byte-32 clause on the dispatch_slot67 condition; tests/native_compute_manifest_reasons.cpp keeps all of main's cube_* / indexed_atomic_uav cases and published[] rows (including the texcubearr row and the indexed atomic publish check) alongside the d16_sample_srv cases, with published[] in main's (binding, kind, dim, line) order: 27 cases + 13 published + 3 = 43 checks. The d16 test and docs note are unchanged in this merge.
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