tooling: add --watch mode to compile_dxil for live startup shader requests #2992
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2992"
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 stan495 on 2026-11-27T03:30:16Z.
Target branch
cpp-migration. Fixes #2988. Refs #2935.Behavior
Add continuous and one-shot
--watchmode totools/startup/compile_dxil.cpp(building on #2984):compile_dxil --watch SDK_DIRECTORY CACHE_DIRECTORY REQUEST_DIRECTORY [--jobs N] [--interval MS] [--once]. Loads and fingerprints the DXC SDK once, then pollsREQUEST_DIRECTORYfor ready startup graphics (req_<16-hex>.a) and slot-67 compute (req_<16-hex>.c67) requests acrossNworkers.tools/startup/gfx2hlsl.py::pending_keys):<key>.txtand complete DXBC stage.csocontainers (checking the DXBC magic, total size, and part count)..csobytecode.req_<key>.psinis newer than<key>.txtor removed while<key>.psdepexists.<key>.failentries once on the first watcher pass, skips unchanged.failentries on later passes unless the marker or.psinis rewritten, and removes stale<key>.failupon compilation success.<key>.fail) so later passes do not spin on them.tests/native_compile_dxil_watch_check.py,tests/cmake/native_compile_dxil_watch.cmake, anddocs/experiments/native-compile-dxil-watch.md.Verification
ad1e9dad(based onorigin/cpp-migration4ff5e36d)10.0.26100.0.csoresumed, updated/removed.psinrechecked and stale.txtwithdrawn, live watcher retries pre-existing.failonce and skips unchanged.failon subsequent passes until fixed, and invalid--watchCLI invocations fail with diagnostics.Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-27T03:47:27Z.
Review: APPROVED
Review of head
ad1e9dad. CI on the head is green. Approving and merging.Code read:
<key>.txtexists and every stage.csopasses a DXBC header, size and part-count check. A.psinnewer than the manifest, or a removed.psinwith a.psdepleft, rechecks it. That is thegfx2hlsl.py::pending_keyscontract..failis retried once on the first pass. After that, a.failat least as new as the marker and.psinis skipped..failis removed on success. A stale.psdepis removed when the request no longer has a description, which the--requestsjob does not do.--requestswithgfx1013-direct-cs@0(no.views, entry 0, the same as the stand-in's in-process route).Run on AMD: Windows 11 26300.9974, AMD Radeon RX 9070 XT (driver 32.0.32029.2010), plus WARP, release. This was tested together with #2989, #2990 and #2994 merged onto
cpp-migration4ff5e36d; all four merge cleanly with each other.ctest --preset release --no-tests=error -R '^(native_.*|startup_compute_dispatch(_.*)?_(warp|hardware)|startup_slot67_indirect_dispatch_warp|startup_compute_translate_e2e_warp|startup_stream_draw.*|startup_native_graphics.*)$'gives 88 tests, 84 passed and 4 skipped (77, WARP has no 32-lane waves).native_compile_dxil_watch,native_compile_dxil_refusalsandnative_startup_request_cache_controlspassed.Mutation here: never skipping an unchanged
.failon later passes failsnative_compile_dxil_watchwith "watcher rewrote unchanged .fail on subsequent pass". With it restored, it passes.Notes, not blocking:
compile_watch_itemre-implements the--requestscompile job instead of sharing it. It is equivalent today, but the two will drift. For example, the.rtvvariants from #2989 reach--requestsand not--watch. Moving the job into one shared function would keep them in step.gfx2hlsl.py --watch(whichrun.ps1 -Translatestarts) on the same cache. Whichever translator refuses a fresh request first writes<key>.fail, and after its first pass the other one skips that key. With the native compiler refusing most current compute requests, the Python fallback would lose those keys. One sentence indocs/experiments/native-compile-dxil-watch.mdwould prevent that.I will close #2988 by hand.
AI-assisted; the commands above were run locally.