startup: move the shader cache revision to x2w-startup-shader-9 #2291
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2299"
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 NiiRoZz on 2026-11-25T10:46:05Z.
Change
#2279 changed the HLSL gfx2hlsl emits for programs with loops and joins, but the cache key did not change. A cache
filled before it keeps shaders whose loop counter is a folded constant (
s14 = 0x00000000u + 0x00000001u;), so thedispatcher loop runs to its 65,536-iteration guard for every pixel. Local observation (one run, counts only): one such
cached pixel shader cost about 128 ms of GPU time per frame at 1280x720. After retranslating the same request with
current main, the counter reads
s14 = s14 + 0x00000001u;.This moves the revision so those caches are not reused:
x2w-startup-shader-8->x2w-startup-shader-9(src/startup_stubs/d3d12_draw.inl,tools/startup/gfx2hlsl.py,tests/startup_indirect_draw_indexed.cpp,docs/startup-runtime.md);x2w-startup-shader-8cs->x2w-startup-shader-9cs(d3d12_draw.inl,gfx2hlsl.py,tests/startup_compute_request_offline_check.py, whose pinned literal key changes toc034b1a1c9e1d289).Nothing else changes. Other merged translator PRs since revision 8 may also change output for programs that already
translated; only #2279 was checked.
Verification
On origin/main
25317c63plus this change, Windows 11 build 26300:tests/startup_compute_request_offline_check.pytests/startup_gfx2hlsl_export_mask_check.pytests/startup_image_sample_a16_check.pytests/startup_image_load_mip_check.pytests/startup_translator_check.pytests/docs_links_check.pyEvidence and follow-up
now read the counter at run time.
submitted list): measured GPU time per 5 s window in the same phase fell from 880-2850 ms to 16-137 ms, and the
128 ms draw no longer appears among the slowest commands. The presentation rate in that phase did not recover
(2-19 presents per window in both runs), so it has other, non-GPU causes that this change does not address.
startup_indirect_draw_indexedcarries its own copy of the revision string; it needs abuild (
ctest --preset dev -R startup_indirect_draw_indexed). No GPU run.Checklist
docs/startup-runtime.md).startup_indirect_draw_indexedbuilt and run.AI-assisted (Claude Code); the commands above were run locally.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T10:48:46Z.
Review: COMMENTED
Review of head
3b8883e4bc41cf05880f6c270774cdb26d745e54.Result: no P1, no P2.
What I checked
x2w-startup-shader-8->-9and compute-8cs->-9cschange together insrc/startup_stubs/d3d12_draw.inl:235,355,tools/startup/gfx2hlsl.py:4038,4047,tests/startup_indirect_draw_indexed.cpp:235,tests/startup_compute_request_offline_check.py:33anddocs/startup-runtime.md.shader-8or8csoutside the diff.0xc034b1a1c9e1d289matches the key the checker computes for the new revision.Commands run locally on the PR head
python3 tests/startup_compute_request_offline_check.py-> passpython3 tests/docs_links_check.py-> pass (18 files, 436 links)python3 tests/bidi_controls_check.py-> passgit diff --check origin/main...HEAD-> cleangfx2hlsl.pycompute revision back to-8cs. The checker failed with29c6e5148934abc8 != c034b1a1c9e1d289, so the pinned key catches a drift between the translator and the pin. I then reverted it withgit checkout -- ..Nit (non-blocking)
gfx2hlsl.pyandd3d12_draw.inldrifted on the graphics string only, no Linux check would catch it. The compute side already has this guard, so a graphics twin could be a follow-up.Windows runtime was not run: the change only edits cache revision strings, so no WARP run seems needed.
AI-assisted; commands listed were executed locally.