shader: clear gfx2hlsl scalar min/max SCC on ties #3883
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!3883
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3881"
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?
@Leyukaka on GitHub · 2026-12-02 18:39 UTC · original
Leyukaka:take-3435→main· +183 −97 · 33 files · 4 commits · openCarries #3437 by @nanyoudegege with their commits. Refs #3436.
#3437 has two open requests for a cache revision bump and no update since 11-29. The author's commit is kept unchanged (
d1ac43d4a, a clean cherry-pick of710fb44d); one commit on top adds the bump. @nanyoudegege, if you would rather continue in #3437, say so and I will close this PR.Change
From #3437 (see its description for the ISA reference and the Linux validation):
tools/startup/gfx2hlsl.py:s_min_{i,u}32ands_max_{i,u}32set SCC with a strict compare, so equal operands clear it, as the direct compute path already does.s-min-inclusivecontrol follow the strict rule.Added here, in
3117f8ba8:x2w-startup-shader-29/29csto31/31csintools/startup/gfx2hlsl.py,src/startup_stubs/d3d12_draw.inl,src/shader_compute_request.cppandtools/patch_manifest.py, with the tests and docs that carry the string. Without it, translations cached under revision 29 keep setting SCC on ties.tests/shader_compute_request_check.cpp,tests/startup_shader_cache_key_check.pyandtests/startup_compute_request_offline_check.pyare recomputed at 31/31cs. The revision-28 values are kept.docs/startup-runtime.mdgains a "Revision 31" paragraph.Validation
Windows, MSVC, dev preset, full build, head
3117f8ba8.Result: all selected tests passed.
This filter includes
startup_gfx2hlsl_compute_warpandstartup_gfx2hlsl_compute_s-min-inclusive_warp, which theprpreset filter does not select.Known limits
X2W_NATIVE_SHADERS_ONLY=1, gfx2hlsl compute manifests are not loaded, so the fix changes translated runs only (JohnConnorNPC's note on #3437).pending_keys.@R0Y00 on GitHub · 2026-12-02 19:06 UTC · original · reviewed
I checked
3117f8ba. The strict SCC compares and the revision-31 graphics and compute keys agree across the runtime, translator and offline manifest tooling. The exact head passed the independent Windows Python checksstartup_gfx2hlsl_compute_check.py,startup_gfx2hlsl_scalar_null_check.py,startup_shader_cache_key_check.pyandstartup_compute_request_offline_check.py(4/4), including refusal of stale or mismatched keys. Please keep the revision ordering with #3384 in the landing branch and coordinate with @nanyoudegege on whether to continue in #3437 or here.@R0Y00 on GitHub · 2026-12-02 19:53 UTC · original · reviewed
I also ran
ctest --preset dev --no-tests=error -j 1 -V -R '^startup_gfx2hlsl_compute_(s-min-inclusive_)?(warp|hardware)$'on3117f8ba. All four cases passed on Windows 11 build 26300, WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656 with debug layers enabled. The equal-operand control catches the inclusive SCC predicate on both adapters. The original-PR coordination is still pending.@Makto94 on GitHub · 2026-12-03 05:57 UTC · original
Slot 57 translations use the same SCC lowering, but this PR leaves their cache key at
x2w-startup-mesh-57-4. Since #3533 a runtime path can load those translations. Code reading and a Python probe at3117f8ba; no hardware run.MeshPipelineextendsPipeline, sotranslate_mesh57lowers.m57and.ps57through the sameStagecode,add_sub_min_max_sccincluded.pending_keystreats a slot 57 request as done once<key>.ms57.txtand complete.ms57.cso/.ps57.csoexist. Between publishing and loading, the only revision checks are the key prefix (-57-4) and the runtime's manifest version check (x2w-manifest 4);pending_keyschecks neither beyond the file names, and this PR leaves both unchanged, so a pair translated before this change is not translated again. nanyoudegege saw this skip on a warm cache in #3437 (2026-11-29).src/loaded these outputs. #3533 (merged 2026-12-01) added that load insrc/startup_stubs/native_mesh57.inl(read_cso(L".ms57.cso", ...), line 719 at3117f8ba). It runs only after amesh57_group_indexrefusal withX2W_ALLOW_PUBLISHED_MESH57_PAIR=1, which is off by default.-57-3to-57-4after a review there asked to tie the published CSOs to the translator.Probe (local script, not proposed for the branch): the source-built
MESHandPIXELoftests/startup_mesh57_skeleton_check.py, withs_min_u32 s20, 1, 1ands_cselect_b32 s21, 1, 0spliced after the prefetch, throughG.MeshPipeline(ms, ps, root).hlsl_ms()andG.mesh57_key(ms, ps, root).b68e954c3117f8bascc = ((0x00000001u) <= (0x00000001u));scc = ((0x00000001u) < (0x00000001u));mesh57_key8043e4c1c9f133058043e4c1c9f13305No wrong output observed, and I did not compile the probe to DXIL. Only pairs published after #3533 are affected.
Could you either bump the mesh key with the other two, or add to Known limits that slot 57 pairs published between #3533 and this change stay in use under
X2W_ALLOW_PUBLISHED_MESH57_PAIR? A bump also changes the.s57and.mesh57-statenames derived from the key, as discussed in #3437 (and.mesh57-statein #3533).@R0Y00 on GitHub · 2026-12-03 06:13 UTC · original · requested changes
I independently confirmed the Mesh57 stale-cache case raised above, including pixel readback. On
3117f8batrial-merged onto8a2f84d1, I used the source-builtstartup_mesh57_skeleton_check.pyfixture. Insert83a88181 852980f2immediately after the initialbfa00003(s_min_u32 s40, 1, 1; s_cselect_b32 s41, 1.0, 0), and usevertex_red("7e0e0229")to make the selected float reach the red output.The old and new translators both produce Mesh57 key
84361cba95c62e55, but compile different.ms57.csobytes. With the old full pair in the cache, the newpending_keyssays there is nothing to translate. Directly drawing the published binaries with the existing offscreen fixture on WARP and RTX 4060 Laptop showed the visible difference: the old output matches the red=1 reference, the fresh output matches red=0, and drawing the old binary against the fresh reference differs in 259 of 1,024 pixels on each adapter. Windows build 26300, SDK DXC, WARP 10.0.26100.9818, RTX driver 32.0.16.1656, D3D12 debug layer enabled, no skips. This measures published bytecode and cache scheduling with source-built inputs.Please cover the opt-in published Mesh57 path in the revision change. Bump its shared request revision and keep a regression showing that a previously completed pair does not suppress work on the new key. Coordinate the graphics/compute revision with #3384 separately.
3117f8ba8ctof723cbb091@Leyukaka on GitHub · 2026-12-03 08:18 UTC · original
Thank you both. The slot 57 key is bumped in
95f532506, with a doc note inf723cbb09. The branch is rebased on main at29bb2aed7; the two earlier commits are unchanged in content.Slot 57 revision.
x2w-startup-mesh-57-4becomesx2w-startup-mesh-57-5everywhere it is spelled:mesh57_keyintools/startup/gfx2hlsl.py,mesh57_request_keyinsrc/shader_compute_request.cpp,shader_cache::mesh57_revisioninsrc/startup_stubs/d3d12_draw.inl(sorevision.txtnames it too), the key inprepare_native_mesh57(src/startup_stubs/native_mesh57.inl), the C++ fixtures (tests/startup_mesh57_runtime.inl,tests/startup_indirect_draw_indexed.cpp), the string checks (native_compile_dxil_rekey_check.py,shader_compute_request_meta_check.py,patch_manifest_check.py) and the docs. The two pinned mesh keys inshader_compute_request_check.cppare recomputed at revision 5 (0x07e6b2fe8d1fb5a5,0x73813dabf7162a79).Regression for the stale pair.
startup_gfx2hlsl_watch_check.py(mesh57_revision_controls) publishes a revision 5 request, then a complete.ms57.txt,.ms57.csoand.ps57.csoset under the revision 4 key of the same parts.pending_keysmust still return the revision 5 key, both cold and with a warmcompletedmap, and the map must record neither key. As a control, the same set under the revision 5 key makes the request done.SCC tie fixture. @R0Y00, your reproduction is in
startup_mesh57_skeleton_check.pyasSCC_TIE_CASES:83a88181 852980f2right after the initialbfa00003, withvertex_red("7e0e0229"). The offline check requires it to translate, and thedrawmode compares it with a red 0 reference (a translation that sets SCC on the tie draws 255).Known limitation: fixed-state archives and profiles. @Makto94, as you noted, the bump also renames every
req_<variant>.s57archive and<variant>.mesh57-stateprofile.compile_dxil --rekeyandshader_cache_rekey.pycopy only.m57/.ps57/.root, and an archive also stores the request key in its header, so neither is carried over.f723cbb09documents the manual step indocs/experiments/native-fixed-mesh57.md: run once more withX2W_MESH57_CAPTURE_STATE=1, then runmesh57_profile.pyon each new archive with its existing reviewed JSON. Until then those pipelines take the absent-profile path. Teaching the rekey tools to carry archives and profiles can be a follow-up if you prefer.#3382. The graphics/compute revision ordering with #3384 is unchanged by these commits (still 31/31cs here) and remains to be settled there.
Tests. Windows, MSVC, WARP and a hardware adapter: 46/46 passed. This covers
startup_gfx2hlsl_watch,startup_mesh57_skeleton,startup_mesh57_skeleton_draw_{warp,hardware},startup_mesh57_skeleton_exchange_{warp,hardware},shader_compute_request_fnv_and_keysandshader_compute_request_all(which confirm the recomputed keys),native_compile_dxil_rekey,patch_manifest_controls,startup_mesh57_runtime_{warp,hardware}and thenative_fixed_mesh57_*checks.@R0Y00 on GitHub · 2026-12-03 08:28 UTC · original · approved these changes
Re-reviewed
f723cbb09. The Mesh57 revision-5 bump and its stale-pair regression address my previous change request. Independent Windows checks passed: the watch and Mesh57 skeleton controls, shader-cache-key and offline request checks, the MSVC C++ request fixture (10/10), and both Mesh57 skeleton draws on WARP and RTX 4060 Laptop, including the SCC tie. The revision-4 fixed-state profiles still require recapture as documented. The technical review is clear on this head. The required CI and coordination with the original PR #3437 remain before landing; whichever of this and #3384 lands second must use a fresh graphics/compute revision.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.