compute: publish comparison_texture_srv and smpc manifests #3498
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3498"
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 Ammmae0x on 2026-11-29T18:11:33Z.
Refs #3224, #2935.
In the refreshed #3224 census after #3386 and #3397 landed,
SRV kind comparison_texture_srv 2dwas the largest remaining unclaimedcompiled, no runtime manifestitem (33 shaders / 52,008 dispatches). The dispatch reader (src/startup_stubs/d3d12_compute_dispatch.inl) andformat_graphics_runtime_manifestalready supported comparison textures andsmpclines; onlyformat_compute_runtime_manifestrefused both.What it does
src/direct_compute_cache.cpp: acceptscomparison_texture_srvalongsidetexture_srvfor a single view of dimension 1D, 2D, 3D or 2D array, emitting the samesrv N tex*line; a cube comparison stays a different kind (cube_comparison_srv) and stays refused by name. A comparison sampler is published assmpc, neversmpl: the comparison wins over the LOD limits, as informat_graphics_runtime_manifestand the dispatch reader. The obsoletecomparison samplerrefusal is gone.tests/native_compute_manifest_reasons.cpp: publishescomparison_texture_srvfor all four dimensions, keeps the cube-comparison and array refusals, addscomparison_texture_srvcube/array refusals, and publishes a mixedsmp 0, smpl 1, smpc 2order plus a lonesmpc 0.tests/startup_compute_comparison_srv_check.py: end-to-end coverage for the sampled program ofstartup_compute_dispatch_native_check.py(plain + comparison samples of one 2D texture). No-argument controls run on Linux;compilemode publishes throughcompile_dxil --requestsand checks the manifest lines; warp/hardware modes dispatch the published program withoutX2W_NATIVE_SHADERSand match every volume word against the CPU model, with a wrong-view control (the comparison binding rewritten astex3dis refused asan input texture view is not 3D) and a cube control (DXIL published, no manifest, no translation). Registered intests/cmake/startup_compute_comparison_srv.cmakeandtests/checks/python-linux/comparison-texture-manifest.txt.docs/experiments/compute-comparison-texture-manifest.md, and the stale comparison-sampler refusal notes indocs/experiments.md,docs/experiments/native-compile-dxil-refusals.mdanddocs/experiments/startup-compute-comparison-sampler.mdupdated.tools/startup/triage_run.pyis untouched: itscomparison samplerarm still classifies historical logs.Design note
The direct translator binds one descriptor used by both plain and comparison samples twice (a
texture_srvbinding and acomparison_texture_srvbinding, one register each), so the sampled program's published manifest carries twosrv N tex2dlines for the same descriptor. The expected sampler lines in the new check (smpl 0/1/2,smpc 3) are derived from code reading: every sample in that program passes an explicit LOD tosampler_index(src/gfx1013_direct_compute.inl), and the comparison sampler's tag wins over its LOD limits. Windows verification is the arbiter for those lines.Linux verification (origin/main
77d63db8)form_coverage_check.py,docs_links_check.py,bidi_controls_check.py: passpy_compile,git diff --check: cleannative_compute_manifest_reasons:0 of 45 manifest reasons wrongagainst a verbatim extract of the formatter (the full C++ build needs Windows)comparison_texture_srvbranch (4 publish cases fail), emitsmpinstead ofsmpc(both sampler blocks fail), admit dimension 3 (both cube refusals fail), letsmplwin oversmpc(mixed-order block fails), drop thearray_count == 1guard (both array refusals fail)Windows verification (dev, NVIDIA GeForce RTX 4050 Laptop GPU,
XBOX2WINDOWS_ADAPTER=NVIDIA) onc9213503:native_compute_manifest_reasons,native_compute_manifest_reasons_requests,native_graphics_comparison_pso_warp,startup_compute_comparison_srv_hardware(2.95s — sampled: all 6144 volume words match the CPU model; the tex3d view control refuses and the restore dispatches again; cube: translated to DXIL but refused a manifest) andstartup_compute_dispatch_native_hardware(8.19s) passed;native_comparison_pso_warp,startup_compute_comparison_srv_warpandstartup_compute_dispatch_native_warpexited 77 (Win11 WARPrange=4..4, no wave32).startup_compute_comparison_srv_controlsfailed 1/7 attests/startup_compute_comparison_srv_check.py:178:compile_dxil --requestscompiles the cube comparison shader to.cs.cso(requests=1 compiled=1 refused=0) and emitsno_manifest ..., so the check wrongly expectedrequests=1 compiled=0 refused=1.Fix (
d473b572): the cube branch now expectsrequests=1 compiled=1 refused=0alongside theno_manifestline and the DXBC.cs.cso; Linux checks re-run clean (new check controls,form_coverage_check.py,docs_links_check.py,bidi_controls_check.py,py_compile,git diff --check). Windows re-verification pending on the new head.Windows Verification
Follow-up (
d99425fb, review ond473b572): the published comparison view is now restricted to 2D and 2D array — the translator refuses a compare op unless the dimension is 1, 3 or 5, and 3 is the cube kind, so 1D/3D comparisons can never reach this branch.format_compute_runtime_manifestrefuses them by name (SRV kind comparison_texture_srv 1d/3d, pinned intests/native_compute_manifest_reasons.cpp, still 45 checks); docs updated to match. Linux checks re-run clean (manifest reasons0 of 45against a verbatim formatter extract, 5/5 new spot-mutations killed, comparison SRV controls,form_coverage_check.py,docs_links_check.py,bidi_controls_check.py,py_compile,git diff --check). Windows re-verification pending on the new head.AI-assisted.
Merge with
upstream/main(ff9dcef0, #3427): the only conflict wastests/native_compute_manifest_reasons.cpp, resolved by keeping both sides —upstream/main'sd16_sample_srvrefusal cases (cube, 2d array) and published rows (tex1d/tex2d/tex3d/tex2da) and this branch'scomparison_texture_srvrefusals (cube, 1d, 3d, 2d array) and published rows (tex2d,tex2da). The obsoletecomparison samplerrefusal is dropped (comparison samplers publish assmpc); bothsmpcblocks are kept and a combinedd16_sample_srv+smpccheck is added, for 52 checks total. The docs note records thed99425fbWindowsdev/releasepass instead of the stale pending wording. Linux verification on the merge commit:native_compute_manifest_reasons0 of 52 manifest reasons wrongagainst a verbatim formatter extract, 8/8 spot-mutations killed (d16 branch, comparison branch,smpctag), all 268 python-linux checks pass,form_coverage_check.py,docs_links_check.py(179 files, 720 links),bidi_controls_check.py(2684 files),py_compile,git diff --checkclean,git merge-tree --write-tree upstream/main HEADexits 0. No PR #3504 changes folded in.Windows Verification (
17ce5a89)AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T18:38:28Z.
Review: COMMENTED
Diff-only review of
d473b572(not built, not run). Nothing blocking found; two points.Should. The manifest now publishes
comparison_texture_srvfor image dimension 0 (tex1d) and 2 (tex3d), and the unit test locks both lines (tests/native_compute_manifest_reasons.cpp:152,:154). The translator refuses a compare op unless the dimension is 1, 3 or 5 (src/gfx1013_direct_compute.inl:1127on main, unchanged here), and 3 is the cube kind, so onlytex2dandtex2dacan reach this branch. Either restrict the comparison case to dimensions 1 and 5, or say why the 1D/3D lines are kept.Should.
docs/experiments/compute-comparison-texture-manifest.md:65-83still reports the controls failure onc9213503and ends with "awaits a rerun", while the PR body reports the rerun passing ond473b572. Update the doc to the current head.Conflicts with #3500 in
tests/native_compute_manifest_reasons.cpp(the removedcomparison samplercase and the final count); whichever lands second rebases.Imported from R0Y00/Xbox2Windows. Originally posted by Ammmae0x on 2026-11-29T18:56:25Z.
Addressed
@Leyukaka's review ond473b572ind99425fband re-verified on Windows:comparison_texture_srvpublication insrc/direct_compute_cache.cppto dimensions 2D and 2D array (1 and 5), matching the translator's compare op domain (src/gfx1013_direct_compute.inl), and added1d/3drefusal cases totests/native_compute_manifest_reasons.cpp(0 of 45 manifest reasons wrong).docs/experiments/compute-comparison-texture-manifest.mdanddocs/experiments/native-compile-dxil-refusals.mdto match.d99425fb, NVIDIA GeForce RTX 4050 Laptop GPU, driver32.0.15.9186):dev5 passed / 2 skipped (11.33s),release5 passed / 2 skipped (4.83s; Win11 WARP skips 77 without 32-lane waves), andstartup_compute_comparison_srv_check.py,form_coverage_check.py,docs_links_check.py,bidi_controls_check.pyall pass.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T19:06:29Z.
Review: APPROVED
Diff-only re-review of the delta
d473b572..d99425fb(not built, not run).Point 1 is fixed:
comparison_texture_srvhas its own branch limited to dimensions 1 and 5 (src/direct_compute_cache.cpp:983-993), which matches the translator's compare domain (src/gfx1013_direct_compute.inl:1127, with 3 being the cube kind). The new1dand3drefusal cases (tests/native_compute_manifest_reasons.cpp:86-96) fail if the restriction is reverted, and the twotex1d/tex3dcomparison publish rows are gone.Nit: the last paragraph of
docs/experiments/compute-comparison-texture-manifest.mdstill says "Windows re-verification is pending" for this change, while your comment reports it done ond99425fb.Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T22:08:07Z.
Review: APPROVED
Re-approving at
17ce5a89, diff only. It is a merge of main (ff9dcef0) intod99425fb: the three PR commits are unchanged (range-diff=on all three) and the netsrc/diff againstff9dcef0is line-for-line the one approved ond99425fb(src/direct_compute_cache.cpponly).Resolution in
tests/native_compute_manifest_reasons.cpp: main'sd16_sample_srvrefusals (cube, 2D array) and published rows are kept next to the PR'scomparison_texture_srvones; main's"comparison sampler"refusal case is dropped, which is right because the formatter no longer refuses it and tags itsmpc(s.comparison ? "smpc" : ...). The addedd16_sample_srv+ comparison sampler block expectssrv 0 tex2d table 1 64plussmpc 0 ..., matching the sharedtexture_srv || d16_sample_srvbranch, and the count+ 6matches the six checks outside the two tables.CI is green on
17ce5a89(fixtures, Linux Python, Windows build and test). Not covered: the merge commit itself has no Windows hardware run, as the doc states.Imported from R0Y00/Xbox2Windows. Originally posted by Not-Saii on 2026-11-29T23:13:28Z.
Review: APPROVED
Review of
17ce5a89(built and run in an isolated Windows Sandbox, networking off). Approving: the formatter change is right, the new tests catch a revert of it, and nothing blocks. Two SHOULDs and four NITs below, none repeating the earlier review.Findings
SHOULD 1. More than
comparison_texture_srvnow publishes, and two of the new shapes have no dispatch test. Dropping thecomparison samplerrefusal (src/direct_compute_cache.cpp:1062-1064) also lets two other translator outputs through:d16_samplebeforecompare(src/gfx1013_direct_compute.inl:1194,:1204-1205), and the compare check (:1180) ignores the D16 bit. So a D16 compare on 2D or 2D array becomesd16_sample_srvplus a comparison sampler, which now publishessrv N tex2dplussmpc. The merge-added block attests/native_compute_manifest_reasons.cpp:270-285pins exactly that.image_gather4_c_lz(:1150) on 2D givescomparison_texture_srvand now publishes.The
tex2dacomparison row (tests/native_compute_manifest_reasons.cpp:176) is also covered by the unit test only. Please add a dispatch case for at least one of these. Otherwise, list them under "not covered" indocs/experiments/compute-comparison-texture-manifest.mdso the unit rows are not read as runtime evidence.SHOULD 2. Evidence fields. The
17ce5a89Windows block gives the commit, adapter, driver and commands, but not the Windows build or the debug-layer status. AGENTS.md asks for both in GPU reports.NIT 1. The new doc is behind the PR body.
docs/experiments/compute-comparison-texture-manifest.md:95-99ends with "The merge commit itself has not been Windows-verified yet". The body now reports a dev and a release pass on17ce5a89(0 of 52). The earlier nit was about thed99425fbparagraph; this is the same thing one commit later.NIT 2. Two stale lines next to the bullets this PR rewrites.
docs/experiments/startup-compute-comparison-sampler.md:19-20(unchanged) says the in-process route "refuses every sampler". The PR also keeps "A comparison sampler on the in-process route" in the not-covered list (:89). In fact the in-process route records comparison samplers (src/startup_stubs/d3d12_compute_dispatch.inl:571-574), andstartup_compute_dispatch_native_check.pyalready dispatches this same sampled program, comparison sampler included, underX2W_NATIVE_SHADERS. While you are rewriting those bullets, please correct them.NIT 3.
expected_sampler_lines()hard-codes the tags.tests/startup_compute_comparison_srv_check.py:121-126pickssmpcfor index 3 andsmplfor the rest. So the pure-Python control checks only the sampler words againstN.SAMPLERS, not the tag rule its docstring describes. The tag rule is tested by the compiled manifest check; the docstring could say so.NIT 4. Overlap with #3504 (same author).
git merge-treeon the two heads conflicts indocs/experiments/native-compile-dxil-refusals.mdandtests/native_compute_manifest_reasons.cpp. #3504 still lists "a comparison sampler" as a refusal and keeps both"comparison sampler"cases this PR deletes. Its count term is+ 5, against+ 6here.cube_program(),two_srv_root()andCUBE_REASONtotests/native_compute_manifest_reasons_check.pythat this PR adds totests/startup_compute_comparison_srv_check.py. Whichever lands second should import them, not keep a second copy of the patch logic.No downloads, network calls or new build commands; no agent config files touched.
17ce5a89merges cleanly with current main2ff74a6a.What each test proves
native_compute_manifest_reasons(formatter unit test):comparison_texture_srvpublishestex2d/tex2da, and is refused by name for 1D, 3D, cube and arrays.smp/smpl/smpc, and a comparison sampler stayssmpceven with LOD limits.smpc.native_compute_manifest_reasons_requests: unchanged by this PR. It is a regression check on the reason path through--requests,--watchand triage.startup_compute_comparison_srv_controls:compile_dxil --requestspublishes the sampled program's twosrv tex2dlines and the four sampler lines, in order.no_manifestreason.startup_compute_comparison_srv_hardware: end to end, withoutX2W_NATIVE_SHADERS, so only the published manifest can translate the Dispatch.tex3drewrite of the comparison view is refused, and restoring the line makes the Dispatch work again.startup_compute_dispatch_native_*andstartup_compute_d16_sample_srv_*: unchanged regression tests. They share the sampled program or the merged unit test file.Mutation
I deleted the
comparison_texture_srvbranch (src/direct_compute_cache.cpp:984-994) in a scratch copy, never the PR branch. It rebuilt: bothdirect_compute_cache.cpp.objandnative_compute_manifest_reasons.exegot new timestamps. Four tests failed:native_compute_manifest_reasons2 of 52 manifest reasons wrong: thetex2dandtex2dacomparison publish rows now reportSRV kind comparison_texture_srv 2dand2d-arraystartup_compute_comparison_srv_controlsno_manifest ... SRV kind comparison_texture_srv 2dstartup_compute_comparison_srv_hardwarestartup_compute_comparison_srv_warp_warpfailed instead of skipping because it stops before the capability check. The other six tests were unaffected. Restoring the file rebuilt the object and exe again, and the run matched head exactly.Run (AGENTS.md fields)
17ce5a8913, exported withgit archiveand built in a Windows Sandbox with networking off.cmake --preset dev -DX2W_WITH_OPUS=OFF(Debug), thencmake --build --preset dev -j 8 --target compile_dxil native_compute_manifest_reasons startup_stream_consumer offscreen_check. MSVC 14.44.35207, CMake 3.31.6, DXC from Windows SDK 10.0.26100, Python 3.14.8.ctest --preset dev --no-tests=error --output-on-failure -V -R '^(native_compute_manifest_reasons(_requests)?|startup_compute_comparison_srv_(controls|warp|hardware)|startup_compute_dispatch_native_(warp|hardware)|startup_compute_d16_sample_srv_(controls|warp|hardware))$'(ctest -Nlists 10).native_compute_manifest_reasons(0 of 52 manifest reasons wrong),native_compute_manifest_reasons_requests,startup_compute_comparison_srv_controls,startup_compute_comparison_srv_hardware(10.9 s),startup_compute_d16_sample_srv_controls,startup_compute_d16_sample_srv_hardware(57.0 s),startup_compute_dispatch_native_hardware(28.3 s).startup_compute_comparison_srv_warp,startup_compute_d16_sample_srv_warp,startup_compute_dispatch_native_warp. The inbox WARP has no 32-lane waves. The comparison warp leg first checked the native DXIL and the manifest before skipping.d3d12SDKLayers.dllin the sandbox), so these runs had no debug layer.CI at
17ce5a89(run 46310532198, green)tests/startup_compute_comparison_srv_check.pywith no arguments, which runs only the pure-Python controls.prpreset, which compilessrc/direct_compute_cache.cpp, and ran its 82 smoke tests. None of this PR's ctest tests is in that preset, andnative_compute_manifest_reasonswas neither built nor run. The run above is the first independent run of the merge-resolved unit test.