startup: read smpc comparison samplers in published compute manifests (#3075) #3083
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3083
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3083"
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?
@Not-Saii on GitHub · 2026-11-27 14:39 UTC · original
Not-Saii:claude/native-compute-smpc-f57377→main· +203 −23 · 5 files · 5 commits · merged 2026-11-27 20:09 UTCChange
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 #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
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 #3075 AI-assisted. Co-Authored-By: Claude Mythos 5.2 <[email protected]>@JohnConnorNPC on GitHub · 2026-11-27 17:17 UTC · original
Read through this and checked what can be checked off Windows.
main(63a30dc1) the merge is clean, and the related Linux checks pass:startup_gfx2hlsl_compute_check,startup_image_sample_c_check,startup_compute_translate_checkstartup_compute_request_offline_check, docs links, bidillvm-mc19 for gfx1013.format_compute_runtime_manifeststill returns no manifest for a comparison sampler,and
translate_compute_nativelystill refuses samplers.One thing to fix:
docs/experiments.mdstill says, in the "Static samplers with a LOD clamp" section, thatsmpcis "still refused, as "a comparison sampler"". The next paragraph says "The
smpcandsmpheaplines refuse withtheir reasons". This PR removes both the refusal and that control. Could those two sentences drop
smpcand keepthe pointer to the new note?
Two smaller notes, no change needed for this PR:
row, so both settings give the same 320 words. A u of 0.75 would separate point from linear, if you want the
printed "point, clamp" to be measured.
smpcline is now refused as "a sampler that is not a plain static one". A comparison-specific reasonmight read better in triage.
The PR CI's
prpreset doesn't runstartup_compute_dispatch_texture_*, so the Windows result here is from your run.This comment was AI-assisted.
@Not-Saii on GitHub · 2026-11-27 18:19 UTC · original
Fixed in
73f3cad5: both sentences in that section now namesmpheaponly, and the first keeps the pointer to the new note.On the two notes:
smpcline is left as it is here, to keep the diff to the one refusal.AI-assisted.
@tedin7 on GitHub · 2026-11-27 18:19 UTC · original · reviewed
Review of
0517c12334(the change fromcef30beb, 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 assmpandsmpland hands it toTranslatedSamplers::read_manifest_line;smpheapstays 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) ortranslate_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.
@tedin7 on GitHub · 2026-11-27 18:19 UTC · original
Windows Server 2025 verification of
0517c1233403a54e26796a5669deddc10af92ac1(D3D12 WARP, MSVC 14.44.35207):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_stream_consumer compile_dxil;ctest --preset dev -R '^startup_(compute_dispatch|stream)': 100% tests passed out of 38 (36 passed, 2 capability skips), includingstartup_compute_dispatch_texture_warpand_hardware--preset release;ctest --preset release -R '^startup_(compute_dispatch|stream)': 100% tests passed out of 38 (36 passed, 2 skipped)AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-27 20:08 UTC · original
Windows Server 2025 re-verification of
00682b60f32f2068754e123cb0fcbf9b18196023(the same change, updated with main again; D3D12 WARP, MSVC 14.44.35207):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_stream_consumer compile_dxil;ctest --preset dev -R '^startup_(compute_dispatch|stream)': 100% tests passed out of 38 (36 passed, 2 capability skips), includingstartup_compute_dispatch_texture_warpand_hardware--preset release;ctest --preset release -R '^startup_(compute_dispatch|stream)': 100% tests passed out of 38 (36 passed, 2 skipped)AI-assisted; commands listed were executed locally.