tooling: compile requests written during a compile_dxil watch pass first #3403

Merged
Leyukaka merged 1 commit from upstream-pr/3403 into main 2026-11-29 09:01:08 +00:00
Leyukaka commented 2026-11-28 22:05:26 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-28T22:05:26Z.


Change

compile_dxil --watch sorted pending requests by marker path and compiled the whole list before it scanned again, so a request written during a pass waited for the whole backlog. As gfx2hlsl.py --watch now does (#3396), requests whose ready marker is newer than the watcher's start go first, newest first, in batches of up to four keys per worker, with a rescan between batches at most once per second (steady clock). A key is attempted once per pass; the first-pass retry of earlier failures, --skip-failed and --requests are unchanged, and each key's outputs are the same.

Refs #3392 (the compile_dxil half; the gfx2hlsl.py half is #3396).

Verification

Commit e270b240 on main 6747721c (the head c901a1f2 is that commit rebased onto 0614f68c, which adds only #3329 in other files), Windows 11, release preset.

  • ctest --test-dir out/build/release -R "^native_compile_dxil_watch$": passes. The new case writes five old requests and one new compute request that sorts last by path, then runs --watch --once twice: with every marker old (the old order) the new key is processed last; with its marker newer than the watcher's start it is processed first; the output files are byte-identical in both runs.
  • Negative control: the same test file against main's compile_dxil fails at watch_orders["fresh"] == [fresh_key, *backlog] (the new key comes last).
  • ctest -j 6 -R "native_compile_dxil|compile_dxil|startup_gfx2hlsl_watch": 5/5 pass.

Evidence and follow-up

Synthetic requests only, written by the test. Not covered by the test: a request written during the pass (the rescan between batches) and the once-per-pass filter; only the order of requests present at start is tested. If a rescan fails in the middle of the first pass, --skip-failed is not switched on, so keys already refused in that pass get one more attempt in the next one. Not measured: the wait in a real run, and passes with several workers (the test uses one); with --jobs > 1, new_worker() now runs per worker per batch instead of per pass.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • No application files, dumps, distribution links or secrets included.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5545022231 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3403). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-28T22:05:26Z. --- ## Change `compile_dxil --watch` sorted pending requests by marker path and compiled the whole list before it scanned again, so a request written during a pass waited for the whole backlog. As `gfx2hlsl.py --watch` now does (#3396), requests whose ready marker is newer than the watcher's start go first, newest first, in batches of up to four keys per worker, with a rescan between batches at most once per second (steady clock). A key is attempted once per pass; the first-pass retry of earlier failures, `--skip-failed` and `--requests` are unchanged, and each key's outputs are the same. Refs #3392 (the `compile_dxil` half; the `gfx2hlsl.py` half is #3396). ## Verification Commit `e270b240` on `main` `6747721c` (the head `c901a1f2` is that commit rebased onto `0614f68c`, which adds only #3329 in other files), Windows 11, release preset. - `ctest --test-dir out/build/release -R "^native_compile_dxil_watch$"`: passes. The new case writes five old requests and one new compute request that sorts last by path, then runs `--watch --once` twice: with every marker old (the old order) the new key is processed last; with its marker newer than the watcher's start it is processed first; the output files are byte-identical in both runs. - Negative control: the same test file against `main`'s `compile_dxil` fails at `watch_orders["fresh"] == [fresh_key, *backlog]` (the new key comes last). - `ctest -j 6 -R "native_compile_dxil|compile_dxil|startup_gfx2hlsl_watch"`: 5/5 pass. ## Evidence and follow-up Synthetic requests only, written by the test. Not covered by the test: a request written during the pass (the rescan between batches) and the once-per-pass filter; only the order of requests present at start is tested. If a rescan fails in the middle of the first pass, `--skip-failed` is not switched on, so keys already refused in that pass get one more attempt in the next one. Not measured: the wait in a real run, and passes with several workers (the test uses one); with `--jobs > 1`, `new_worker()` now runs per worker per batch instead of per pass. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] No application files, dumps, distribution links or secrets included.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!3403
No description provided.