Shader watcher: a request written during a pass waits for the whole backlog #3394
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#3394
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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-11-28 18:55 UTC · original
Question
When
tools/startup/gfx2hlsl.py --watch(orcompile_dxil --watch) has a backlog, how long does a request the application has just written wait for its manifest, and does processing newer requests first shorten that wait without changing any output?Evidence so far
pending_keyssorts pending requests by file name, i.e. by key (tools/startup/gfx2hlsl.py:13848), andwatch_passtranslates the whole list before it scans again (:13738,:13746). A request written during a pass waits for the end of that pass.compile_dxil --watchdoes the same:collect_watch_requestssorts by marker path (tools/startup/compile_dxil.cpp:809,:828), andrun_watchprocesses the wholependingvector before the next scan (:944-1003).docs/startup-runtime.md:968,gfx2hlsl.py:13726), and a revision change followed by a re-key (docs/startup-runtime.md:1368-1373). The only timing on record: 3,513 requests took 56.9 s with one process and 7.8 s in parallel on 16 threads (docs/startup-runtime.md:985-986).docs/startup-runtime.md:963-964).Completion condition
<key>.txt, or<key>.ms57.txtfor mesh), on a synthetic cache with an old backlog and a few new requests, under the current order.A follow-up
tooling:PR would change the order only, with a test where the new request is published before the backlog ends and a negative control with the current order. Not in scope: how anything is translated.Required environment
None for the
gfx2hlsl.pyhalf (pure-Python synthetic cache). Windows x64 and the Windows SDK for thecompile_dxilhalf. A local cache is optional; only counts and durations from it would be posted.Part of #870. Refs #2120, #2925, #2899, #2992.
@Leyukaka on GitHub · 2026-11-28 19:11 UTC · original
Working on this: an order-only change to
gfx2hlsl.py --watch(newest requests first, rescan between batches) with a pure-Python test and a negative control, plus the measurement from the completion condition.compile_dxil --watchafter that.@Leyukaka on GitHub · 2026-11-29 09:36 UTC · original
The question was whether a request written while a
--watchpass has a backlog waits for the whole backlog, and whether taking newer requests first shortens that wait without changing any output. Both halves are onmain(1a0120ba):gfx2hlsl.py --watch: #3398 (6747721c). Requests whose marker is newer than the watcher's start go first, newest first (tools/startup/gfx2hlsl.py:14044-14052). Conditions 1-3 are covered by the synthetic measurement in #3398: median marker-to-manifest for new requests 9.02 s -> 0.02 s, files byte-identical under both orders.compile_dxil --watch: #3405 (e6f2b3ed). Same order (tools/startup/compile_dxil.cpp:924-925), rescan between batches (:1044). The test checks the order and byte-identical outputs (tests/native_compile_dxil_watch_check.py:222-249).Not measured: the wait itself for
compile_dxil, and a real run for either half (synthetic requests only). Closing.