Repository navigation
startup: read smpc comparison samplers in published compute manifests (#3075) - #3083
Conversation
The reader of a published <key>.txt for a slot 67 compute request refused every smpc line with "a comparison sampler". It now takes the line under the same index and whole-line checks as smp and smpl, through TranslatedSamplers::read_manifest_line, which already decodes it to a comparison static sampler for the draw path. smpheap stays refused. startup_compute_dispatch_texture_check.py gains a compared case: case A with image_sample_c_lz under a constant point, clamp, LESS sampler reads a 2x1 R32_FLOAT texture (new consumer mode dispatch-sampled-depth) and all 320 words are compared with a CPU model of the comparison. The control changes the manifest's function to GREATER. The old control that expected an smpc line to be refused is replaced by this case. Refs R0Y00#3075 AI-assisted. Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
Command, result and environment for the compared case of
startup_compute_dispatch_texture_{warp,hardware}, the reverted-reader
negative control, and what the change does not cover (the C++ compiler's
publisher and the in-process route).
Refs R0Y00#3075
AI-assisted.
Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
|
Read through this and checked what can be checked off Windows.
One thing to fix: Two smaller notes, no change needed for this PR:
The PR CI's This comment was AI-assisted. |
The "Static samplers with a LOD clamp" section still said that an smpc line is refused and that the texture check controls it. Both sentences now name smpheap only and keep the pointer to the new note. Refs R0Y00#3075 AI-assisted. Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
|
Fixed in 73f3cad: both sentences in that section now name On the two notes:
AI-assisted. |
tedin7
left a comment
There was a problem hiding this comment.
Review of 0517c12 (the change from cef30be, updated with main; the PR's own diff is unchanged). Comment only.
The reader now parses smpc <i> <w0> <w1> <w2> <w3> with the same whole-line and index checks as smp and smpl and hands it to TranslatedSamplers::read_manifest_line; smpheap stays refused. The texture check draws with a comparison sampler on WARP and compares against a CPU reference. The change does not touch the native compiler (compile_dxil, direct_compute_cache.cpp) or translate_compute_natively, as the description says. As noted there, #3049 edits a neighbouring line of the texture check; whichever lands second needs a small rebase.
Windows results are in the comment below.
Commands: git diff origin/main...pull/3083/head (read), plus the Windows commands listed in the comment.
AI-assisted; commands listed were executed locally.
|
Windows Server 2025 verification of
AI-assisted; commands listed were executed locally. |
|
Windows Server 2025 re-verification of
AI-assisted; commands listed were executed locally. |
Change
The stand-in reads the published translation of a slot 67 compute request from
<key>.txt(load_compute_translationinsrc/startup_stubs/d3d12_compute_dispatch.inl). It refused everysmpcline there witha comparison sampler. It now readssmpc <i> <w0> <w1> <w2> <w3>under the same index and whole-line checks assmpandsmpl, throughTranslatedSamplers::read_manifest_line.decode_staticsalready decodes the line to a comparison static sampler for the draw path.smpheapstays refused witha sampler from the sampler heap.Fixes #3075. Part of #2935.
Scope. #3075 first described this as the in-process route (
X2W_NATIVE_SHADERS). The refusal is in the reader of a published manifest, and that is what this changes:tools/startup/gfx2hlsl.pywritessmpcfor a compute program today. Before this change the runtime refused that translation when it loaded the manifest, so a compute request with a comparison sampler could not be dispatched.format_compute_runtime_manifest(src/direct_compute_cache.cpp) still returns no manifest for a comparison sampler, socompile_dxilpublishes no computesmpcline.translate_compute_nativelyis not changed. It reads no manifest lines and refuses every sampler.Overlap. #3049, #3006 and #2981 also touch
d3d12_compute_dispatch.inl. None of them changes the sampler lines of the reader. #3049 also editstests/startup_compute_dispatch_texture_check.pyandtests/startup_stream_consumer.cpp. Its hunks share no line with this change, but its edit ofmain()in the texture check is next to the one-line call added here, so whichever lands second may need a small rebase.Verification
Commit
cef30bebonmainate1ea515d.mainhas since moved to2a4bbff5(#3059), which touches none of these files.Environment: Windows 11 build 26300.9974, Windows SDK 10.0.26100, DXC 1.9.2602.17, Debug build, D3D12 debug layer enabled.
startup_compute_dispatch_texture_hardwarestartup_compute_dispatch_texture_warpThere was no capability skip. The new line, the same on both adapters:
Negative control. With
src/startup_stubs/d3d12_compute_dispatch.inlput back toe1ea515dand the same target rebuilt, the samectestcommand fails both tests in the new case, after the cases before it pass:Also run:
python -B tests/docs_links_check.py(77 Markdown files and 588 links checked, no error).Not run: the rest of the
ctestsuite and the Linux Python checks.Evidence and follow-up
Fixture.
tests/startup_compute_dispatch_texture_check.pygains a compared case. It is source-built: case A ofstartup_gfx2hlsl_compute_check.pywithimage_sample_c_lzunder a constant point, clamp, LESS sampler spliced in before the store.SampleCmpLevelZeroand ends withsmpc 0 0x8001012 0x0 0x0 0x0.dispatch-sampled-depthbinds a 2x1R32_FLOATtexture with depths 1.0 and 2.5. The reference is the thread's z id (0.0 to 3.0) and u its x id, so the written words hold both outcomes.reference < texel.reference > texel. The two models differ at 252 words.smplline assmpcand expected the refusal. This case replaces it. Thesmpheaprefusal check stays.Not measured. A bilinear comparison filter, a border address mode, a 2D array and the other six functions. The comparison is the desktop sampler's; console behaviour is not measured.
Docs. The note is
docs/experiments/startup-compute-comparison-sampler.md. The older paragraph indocs/experiments.mdthat sayssmpcis refused now points to it.Follow-up.
translate_compute_natively). This comes after runtime: bind native compute table buffers and texture views #3049, which adds its texture inputs and keeps its sampler refusal.smpcfromformat_compute_runtime_manifest, so the C++ compiler's published compute translations can carry a comparison sampler.smpheap) for compute.Checklist
AI-assisted.
🤖 Generated with Claude Code