Repository navigation
compute: publish comparison_texture_srv and smpc manifests - #3498
Conversation
Refs R0Y00#3224, R0Y00#2935. In the refreshed R0Y00#3224 census after R0Y00#3386 and R0Y00#3397 landed, SRV kind comparison_texture_srv 2d was the largest remaining unclaimed compiled, no runtime manifest item (33 shaders / 52,008 dispatches). The dispatch reader and the graphics manifest already supported comparison textures and smpc lines; only format_compute_runtime_manifest refused both. - src/direct_compute_cache.cpp: accept comparison_texture_srv alongside texture_srv for a single view of dimension 1D, 2D, 3D or 2D array, emitting the same srv tex line; a cube comparison stays a different kind (cube_comparison_srv) and stays refused by name. A comparison sampler is published as smpc, never smpl: the comparison wins over the LOD limits, as in format_graphics_runtime_manifest and the dispatch reader. The obsolete comparison sampler refusal is gone. - tests/native_compute_manifest_reasons.cpp: publish comparison_texture_srv for all four dimensions, keep the cube-comparison and array refusals, add comparison_texture_srv cube/array refusals, and publish a mixed smp 0, smpl 1, smpc 2 order plus a lone smpc 0. - tests/startup_compute_comparison_srv_check.py: end-to-end coverage for the sampled program (plain + comparison samples of one 2D texture). No-argument controls run on Linux; compile mode publishes through compile_dxil --requests and checks the manifest lines; warp/hardware modes dispatch the published program without X2W_NATIVE_SHADERS and match every volume word against the CPU model, with a wrong-view control (tex3d rewrite refused) and a cube control (DXIL published, no manifest, no translation). Registered in tests/cmake/startup_compute_comparison_srv.cmake and tests/checks/python-linux/comparison-texture-manifest.txt. - Docs: new docs/experiments/compute-comparison-texture-manifest.md, and the stale comparison-sampler refusal notes in docs/experiments.md, docs/experiments/native-compile-dxil-refusals.md and docs/experiments/startup-compute-comparison-sampler.md updated. Linux verification (origin/main 77d63db): form_coverage_check.py, docs_links_check.py and bidi_controls_check.py pass, py_compile passes, git diff --check is clean, the new check's pure-Python controls pass, and native_compute_manifest_reasons passes 0 of 45 manifest reasons wrong against a verbatim extract of the formatter (the full C++ build needs Windows). 5/5 spot-mutations killed on throwaway copies: revert the comparison_texture_srv branch, emit smp instead of smpc, admit dimension 3, let smpl win over smpc, drop the array_count guard. Windows verification (compile_dxil, native CTest, GPU readback) is pending.
…rols compile_dxil --requests compiles the cube comparison shader to .cs.cso (requests=1 compiled=1 refused=0) and emits no_manifest for it, so the controls check wrongly expected requests=1 compiled=0 refused=1. Refs R0Y00#3224, R0Y00#2935
Leyukaka
left a comment
There was a problem hiding this comment.
Diff-only review of d473b57 (not built, not run). Nothing blocking found; two points.
Should. The manifest now publishes comparison_texture_srv for 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:1127 on main, unchanged here), and 3 is the cube kind, so only tex2d and tex2da can 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-83 still reports the controls failure on c921350 and ends with "awaits a rerun", while the PR body reports the rerun passing on d473b57. Update the doc to the current head.
Conflicts with #3500 in tests/native_compute_manifest_reasons.cpp (the removed comparison sampler case and the final count); whichever lands second rebases.
The direct translator refuses a compare op unless the dimension is 1, 3 or 5, and dimension 3 is the cube kind, so only tex2d and tex2da can reach the comparison branch of format_compute_runtime_manifest. Restrict it to those two and refuse 1D/3D comparisons by name, like the cube. Refs R0Y00#3224, R0Y00#2935
|
Addressed
AI-assisted. |
Leyukaka
left a comment
There was a problem hiding this comment.
Diff-only re-review of the delta d473b572..d99425fb (not built, not run).
Point 1 is fixed: comparison_texture_srv has 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 new 1d and 3d refusal cases (tests/native_compute_manifest_reasons.cpp:86-96) fail if the restriction is reverted, and the two tex1d/tex3d comparison publish rows are gone.
Nit: the last paragraph of docs/experiments/compute-comparison-texture-manifest.md still says "Windows re-verification is pending" for this change, while your comment reports it done on d99425fb.
Resolve the tests/native_compute_manifest_reasons.cpp conflict by keeping both sides: upstream/main's d16_sample_srv refusal cases (cube, 2d array) and published rows (tex1d/tex2d/tex3d/tex2da), and this branch's comparison_texture_srv refusals (cube, 1d, 3d, 2d array) and published rows (tex2d, tex2da). Drop the obsolete comparison sampler refusal: comparison samplers publish as smpc. Keep both smpc blocks and add a combined d16_sample_srv + smpc check (52 checks). The docs note records the d99425f Windows dev/release pass instead of the stale pending wording.
Leyukaka
left a comment
There was a problem hiding this comment.
Re-approving at 17ce5a8, diff only. It is a merge of main (ff9dcef) into d99425f: the three PR commits are unchanged (range-diff = on all three) and the net src/ diff against ff9dcef is line-for-line the one approved on d99425f (src/direct_compute_cache.cpp only).
Resolution in tests/native_compute_manifest_reasons.cpp: main's d16_sample_srv refusals (cube, 2D array) and published rows are kept next to the PR's comparison_texture_srv ones; main's "comparison sampler" refusal case is dropped, which is right because the formatter no longer refuses it and tags it smpc (s.comparison ? "smpc" : ...). The added d16_sample_srv + comparison sampler block expects srv 0 tex2d table 1 64 plus smpc 0 ..., matching the shared texture_srv || d16_sample_srv branch, and the count + 6 matches the six checks outside the two tables.
CI is green on 17ce5a8 (fixtures, Linux Python, Windows build and test). Not covered: the merge commit itself has no Windows hardware run, as the doc states.
Not-Saii
left a comment
There was a problem hiding this comment.
Review of 17ce5a8 (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_srv now publishes, and two of the new shapes have no dispatch test. Dropping the comparison sampler refusal (src/direct_compute_cache.cpp:1062-1064) also lets two other translator outputs through:
- A D16 comparison sample. The translator picks the kind with
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 tex2da comparison 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" in docs/experiments/compute-comparison-texture-manifest.md so the unit rows are not read as runtime evidence.
SHOULD 2. Evidence fields. The 17ce5a8 Windows 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-99 ends with "The merge commit itself has not been Windows-verified yet". The body now reports a dev and a release pass on 17ce5a8 (0 of 52). The earlier nit was about the d99425f paragraph; 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), and startup_compute_dispatch_native_check.py already dispatches this same sampled program, comparison sampler included, under X2W_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-126 picks smpc for index 3 and smpl for the rest. So the pure-Python control checks only the sampler words against N.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.- #3504 adds the same
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. 17ce5a8 merges cleanly with current main 2ff74a6.
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.- Samplers publish in register order as
smp/smpl/smpc, and a comparison sampler stayssmpceven with LOD limits. - A D16 view publishes together with
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.- The cube variant compiles to DXIL and gets a named
no_manifestreason.
startup_compute_comparison_srv_hardware: end to end, withoutX2W_NATIVE_SHADERS, so only the published manifest can translate the Dispatch.- All 6144 volume words match the CPU model, including LESS results that differ between threads.
- A
tex3drewrite of the comparison view is refused, and restoring the line makes the Dispatch work again. - The cube variant stays untranslated.
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_srv branch (src/direct_compute_cache.cpp:984-994) in a scratch copy, never the PR branch. It rebuilt: both direct_compute_cache.cpp.obj and native_compute_manifest_reasons.exe got new timestamps. Four tests failed:
| Test | Failure |
|---|---|
native_compute_manifest_reasons |
2 of 52 manifest reasons wrong: the tex2d and tex2da comparison publish rows now report SRV kind comparison_texture_srv 2d and 2d-array |
startup_compute_comparison_srv_controls |
no_manifest ... SRV kind comparison_texture_srv 2d |
startup_compute_comparison_srv_hardware |
no published manifest file |
startup_compute_comparison_srv_warp |
no published manifest file |
_warp failed 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)
- Commit: 17ce5a8, exported with
git archiveand built in a Windows Sandbox with networking off. - Build:
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. - Command:
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). - Passed (7):
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). - Failed: none.
- Skipped, exit 77 (3):
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. - Adapter: NVIDIA GeForce RTX 4090 through the sandbox vGPU. The driver reports itself inside the sandbox as 10.0.26100.1150 (the paravirtual driver string, not the host's NVIDIA version).
- Windows: 11 Enterprise build 26100 in the sandbox (host build 26300).
- Debug layer: not available (no
d3d12SDKLayers.dllin the sandbox), so these runs had no debug layer.
CI at 17ce5a8 (run 46310532198, green)
- The Linux job ran
tests/startup_compute_comparison_srv_check.pywith no arguments, which runs only the pure-Python controls. - The Windows PR job built the
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.
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 77d63db)
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 (17ce5a8)
AI-assisted.