compute: name why a compiled program gets no runtime manifest #3268

Merged
Not-Saii merged 2 commits from upstream-pr/3268 into main 2026-11-28 03:34:52 +00:00
Not-Saii commented 2026-11-28 03:04:55 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Not-Saii on 2026-11-28T03:04:55Z.


Refs #3224

Behavior

format_compute_runtime_manifest (src/direct_compute_cache.cpp) returned std::nullopt from 11 places without saying why. A compute program that compiles to DXIL but gets no manifest can't be dispatched translated, and in compile_dxil --requests it left no trace. In the 878-request census of #3224, 84 shaders fall in this bucket.

  • Each exit now returns a fixed reason through a new optional std::string *reason parameter. Exits that tested two or three conditions are split, for example a resource heap view, the sampler heap, and a view above root parameter 15. When a view kind has no manifest line, the reason names the kind, and for images the ISA dimension and array, for example SRV kind root_buffer_srv or UAV kind texture_uav cube. The reasons hold no register numbers, offsets or keys.
  • Accepted programs produce byte-identical manifests. native_compute_output_revision is unchanged.
  • compile_dxil uses one line for all routes, unsupported startup runtime manifest bindings: <reason>, which keeps the start of the existing --watch text:
    • --requests still publishes <key>.cs.cso, writes no <key>.txt, counts the request as compiled and removes <key>.fail. The exit status and the requests= compiled= refused= line are unchanged. It prints the reason in that job's report as no_manifest input=req_<key>.c67 <line>. It writes no .fail, because .fail is the retry marker of both watchers.
    • --watch writes the reason where it used to write the bare line.
    • --refusals counts such a request under its reason. Before, it counted it as no refusal.
  • triage_run.py reports these lines as runtime manifest: <reason>, matched against an allowlist. Any other text is still reported as "other (text omitted)".
  • format_graphics_runtime_manifest is not changed.

Tests

  • native_compute_manifest_reasons (C++) calls the formatter on 18 source-written programs, one or more per reason, and checks the exact reason. It also checks that the accepted program's manifest text is unchanged.
  • native_compute_manifest_reasons_requests runs one reachable case end to end. The program reads a root CBV and a root SRV (the program of native_compute_raw_root), so it compiles but has no manifest line.
    • --requests runs in a live cache that also holds a genuinely refused request (an undecodable word) and a table-bound control. The control publishes its manifest. The compiled key gets its .cs.cso, no .txt, and no .fail (a stale one is removed); its reason is on stdout. The refused key keeps its .fail.
    • gfx2hlsl's pending_keys(dir, False) selects the compiled key and the refused key; pending_keys(dir, True) still selects the compiled key and skips the refused one.
    • --watch --once refuses the compiled key with the reason in its .fail, a genuine watcher failure: pending_keys(dir, True) skips it and pending_keys(dir, False) selects it.
    • The check also covers --refusals --json and triage_run.py.
  • tests/startup_triage_run_check.py gets a sample line for the new category and a leak control: a disallowed reason text maps to "other".
  • The docs note docs/experiments/native-compile-dxil-refusals.md is updated.

Verification

Commits 3ea1a79f + 50740b7c on main c827d8ba. Windows 11 build 26300, MSVC x64, Windows SDK 10.0.26100. No GPU is involved.

.\tools\dev.ps1
cmake --preset dev
cmake --build --preset dev --target compile_dxil native_compute_manifest_reasons
ctest --preset dev --no-tests=error -V -R "^(native_compute_manifest_reasons|native_compute_manifest_reasons_requests|native_compile_dxil_refusals|native_compile_dxil_watch|native_startup_request_cache_controls)$"
# 100% tests passed, 0 tests failed out of 5 ("0 of 19 manifest reasons wrong", "compute manifest reasons: ok")
.\out\pe-env\Scripts\python.exe -B tests/startup_triage_run_check.py   # 0 failed
.\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py          # Checked 133 Markdown files and 635 links.
.\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py       # no bidirectional controls

Negative control: with the formatter no longer recording reasons (one line changed), native_compute_manifest_reasons reports 18 of 19 manifest reasons wrong. All 18 reason cases fail and only the accepted-program case passes. native_compute_manifest_reasons_requests fails on the missing reason. With --requests writing the reason to .fail again (the first revision of this PR), it fails at pending_keys(dir, True), which returns []: the behavior from the review. With the change restored, both pass.

Not in this PR

  • No new manifest line. The census of the 84 by reason follows on #3224, and adding a line is a separate PR.
  • The open PRs #2975, #3049 and #3154 share one hunk in this function: texture UAV dimensions. It adds a default: return std::nullopt; that would need a reason after rebase. The test uses a cube UAV, which stays refused under that hunk.

AI-assisted.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5536062660 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3268). Originally posted by [Not-Saii](https://github.com/Not-Saii) on 2026-11-28T03:04:55Z. --- Refs #3224 ## Behavior `format_compute_runtime_manifest` (`src/direct_compute_cache.cpp`) returned `std::nullopt` from 11 places without saying why. A compute program that compiles to DXIL but gets no manifest can't be dispatched translated, and in `compile_dxil --requests` it left no trace. In the 878-request census of #3224, 84 shaders fall in this bucket. - Each exit now returns a fixed reason through a new optional `std::string *reason` parameter. Exits that tested two or three conditions are split, for example a resource heap view, the sampler heap, and a view above root parameter 15. When a view kind has no manifest line, the reason names the kind, and for images the ISA dimension and `array`, for example `SRV kind root_buffer_srv` or `UAV kind texture_uav cube`. The reasons hold no register numbers, offsets or keys. - Accepted programs produce byte-identical manifests. `native_compute_output_revision` is unchanged. - `compile_dxil` uses one line for all routes, `unsupported startup runtime manifest bindings: <reason>`, which keeps the start of the existing `--watch` text: - `--requests` still publishes `<key>.cs.cso`, writes no `<key>.txt`, counts the request as compiled and removes `<key>.fail`. The exit status and the `requests= compiled= refused=` line are unchanged. It prints the reason in that job's report as `no_manifest input=req_<key>.c67 <line>`. It writes no `.fail`, because `.fail` is the retry marker of both watchers. - `--watch` writes the reason where it used to write the bare line. - `--refusals` counts such a request under its reason. Before, it counted it as no refusal. - `triage_run.py` reports these lines as `runtime manifest: <reason>`, matched against an allowlist. Any other text is still reported as "other (text omitted)". - `format_graphics_runtime_manifest` is not changed. ## Tests - `native_compute_manifest_reasons` (C++) calls the formatter on 18 source-written programs, one or more per reason, and checks the exact reason. It also checks that the accepted program's manifest text is unchanged. - `native_compute_manifest_reasons_requests` runs one reachable case end to end. The program reads a root CBV and a root SRV (the program of `native_compute_raw_root`), so it compiles but has no manifest line. - `--requests` runs in a live cache that also holds a genuinely refused request (an undecodable word) and a table-bound control. The control publishes its manifest. The compiled key gets its `.cs.cso`, no `.txt`, and no `.fail` (a stale one is removed); its reason is on stdout. The refused key keeps its `.fail`. - gfx2hlsl's `pending_keys(dir, False)` selects the compiled key and the refused key; `pending_keys(dir, True)` still selects the compiled key and skips the refused one. - `--watch --once` refuses the compiled key with the reason in its `.fail`, a genuine watcher failure: `pending_keys(dir, True)` skips it and `pending_keys(dir, False)` selects it. - The check also covers `--refusals --json` and `triage_run.py`. - `tests/startup_triage_run_check.py` gets a sample line for the new category and a leak control: a disallowed reason text maps to "other". - The docs note `docs/experiments/native-compile-dxil-refusals.md` is updated. ## Verification Commits `3ea1a79f` + `50740b7c` on `main` `c827d8ba`. Windows 11 build 26300, MSVC x64, Windows SDK 10.0.26100. No GPU is involved. ```powershell .\tools\dev.ps1 cmake --preset dev cmake --build --preset dev --target compile_dxil native_compute_manifest_reasons ctest --preset dev --no-tests=error -V -R "^(native_compute_manifest_reasons|native_compute_manifest_reasons_requests|native_compile_dxil_refusals|native_compile_dxil_watch|native_startup_request_cache_controls)$" # 100% tests passed, 0 tests failed out of 5 ("0 of 19 manifest reasons wrong", "compute manifest reasons: ok") .\out\pe-env\Scripts\python.exe -B tests/startup_triage_run_check.py # 0 failed .\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py # Checked 133 Markdown files and 635 links. .\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py # no bidirectional controls ``` Negative control: with the formatter no longer recording reasons (one line changed), `native_compute_manifest_reasons` reports `18 of 19 manifest reasons wrong`. All 18 reason cases fail and only the accepted-program case passes. `native_compute_manifest_reasons_requests` fails on the missing reason. With `--requests` writing the reason to `.fail` again (the first revision of this PR), it fails at `pending_keys(dir, True)`, which returns `[]`: the behavior from the review. With the change restored, both pass. ## Not in this PR - No new manifest line. The census of the 84 by reason follows on #3224, and adding a line is a separate PR. - The open PRs #2975, #3049 and #3154 share one hunk in this function: texture UAV dimensions. It adds a `default: return std::nullopt;` that would need a reason after rebase. The test uses a cube UAV, which stays refused under that hunk. AI-assisted. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
R0Y00 commented 2026-11-28 03:24:54 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-28T03:24:54Z.

Review: CHANGES_REQUESTED


--requests now writes a newer <key>.fail for a successful DXIL compile that did not produce a manifest. I reproduced a behavior change in the existing Python watcher: with a synthetic req_<key>.c67, a <key>.cs.cso and no manifest, pending_keys(directory, True) selects the request. Adding the proposed diagnostic .fail newer than the request makes the same call return an empty list. pending_keys(directory, False) still selects it. The normal -Render -Translate launcher uses --watch, which switches to the repeated-pass behavior after its first successful pass. A request first seen during a run can therefore lose its Python translation attempt if the offline C++ batch writes this diagnostic into the live cache first.

Please keep those offline diagnostic entries out of the retry marker, and cover the two watcher selections with an end-to-end control that distinguishes an incomplete C++ publication from a genuine watcher failure. The named reasons, census and byte-identical accepted-manifest control are useful to keep.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6095420462 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3268#pullrequestreview-6095420462). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-28T03:24:54Z. **Review:** CHANGES_REQUESTED --- `--requests` now writes a newer `<key>.fail` for a successful DXIL compile that did not produce a manifest. I reproduced a behavior change in the existing Python watcher: with a synthetic `req_<key>.c67`, a `<key>.cs.cso` and no manifest, `pending_keys(directory, True)` selects the request. Adding the proposed diagnostic `.fail` newer than the request makes the same call return an empty list. `pending_keys(directory, False)` still selects it. The normal `-Render -Translate` launcher uses `--watch`, which switches to the repeated-pass behavior after its first successful pass. A request first seen during a run can therefore lose its Python translation attempt if the offline C++ batch writes this diagnostic into the live cache first. Please keep those offline diagnostic entries out of the retry marker, and cover the two watcher selections with an end-to-end control that distinguishes an incomplete C++ publication from a genuine watcher failure. The named reasons, census and byte-identical accepted-manifest control are useful to keep.
Not-Saii commented 2026-11-28 03:30:01 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Not-Saii on 2026-11-28T03:30:01Z.


Thanks, you're right: a program that compiles without a manifest isn't a failed request, and .fail is the retry marker. Fixed in 50740b7c:

  • --requests no longer writes .fail for these programs. It removes .fail as before and prints the reason in the job report as no_manifest input=req_<key>.c67 unsupported startup runtime manifest bindings: <reason>. --watch (which refuses the key) and --refusals are as before.
  • native_compute_manifest_reasons_requests now runs --requests in a live cache beside a genuine refusal. pending_keys(dir, False) selects both keys. pending_keys(dir, True) still selects the compiled key and skips the refused one. A --watch refusal of the same key is skipped with True and selected with False.
  • Negative control: with --requests writing the .fail again, the check fails at pending_keys(dir, True) == [], which is your reproduction.

Retested on Windows 11 build 26300, Debug, Windows SDK 10.0.26100: native_compute_manifest_reasons, native_compute_manifest_reasons_requests, native_compile_dxil_refusals, native_compile_dxil_watch and native_startup_request_cache_controls all pass. The PR body is updated to match.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7233121850 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3268#issuecomment-7233121850). Originally posted by [Not-Saii](https://github.com/Not-Saii) on 2026-11-28T03:30:01Z. --- Thanks, you're right: a program that compiles without a manifest isn't a failed request, and `.fail` is the retry marker. Fixed in `50740b7c`: - `--requests` no longer writes `.fail` for these programs. It removes `.fail` as before and prints the reason in the job report as `no_manifest input=req_<key>.c67 unsupported startup runtime manifest bindings: <reason>`. `--watch` (which refuses the key) and `--refusals` are as before. - `native_compute_manifest_reasons_requests` now runs `--requests` in a live cache beside a genuine refusal. `pending_keys(dir, False)` selects both keys. `pending_keys(dir, True)` still selects the compiled key and skips the refused one. A `--watch` refusal of the same key is skipped with `True` and selected with `False`. - Negative control: with `--requests` writing the `.fail` again, the check fails at `pending_keys(dir, True) == []`, which is your reproduction. Retested on Windows 11 build 26300, Debug, Windows SDK 10.0.26100: `native_compute_manifest_reasons`, `native_compute_manifest_reasons_requests`, `native_compile_dxil_refusals`, `native_compile_dxil_watch` and `native_startup_request_cache_controls` all pass. The PR body is updated to match. AI-assisted.
R0Y00 commented 2026-11-28 03:34:08 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-28T03:34:08Z.

Review: APPROVED


The new head fixes the watcher regression. In --requests, a successful DXIL compile with no runtime manifest stays eligible for a Python watch pass and records its named reason in the job report. An actual watch failure still leaves the standard retry marker. The end-to-end test checks both pending_keys modes and includes a genuinely refused request.

On main 5033d2d3 plus 50740b7c (tree 5bcfc2d6), Debug and Release /O2 passed all five tests with zero skips. The Python triage check also passed.

ctest --test-dir <build> --no-tests=error --output-on-failure -j 1 -R '^(native_compute_manifest_reasons|native_compute_manifest_reasons_requests|native_compile_dxil_refusals|native_compile_dxil_watch|native_startup_request_cache_controls)$'
python -B tests/startup_triage_run_check.py
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6095466819 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3268#pullrequestreview-6095466819). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-28T03:34:08Z. **Review:** APPROVED --- The new head fixes the watcher regression. In `--requests`, a successful DXIL compile with no runtime manifest stays eligible for a Python watch pass and records its named reason in the job report. An actual watch failure still leaves the standard retry marker. The end-to-end test checks both `pending_keys` modes and includes a genuinely refused request. On main `5033d2d3` plus `50740b7c` (tree `5bcfc2d6`), Debug and Release /O2 passed all five tests with zero skips. The Python triage check also passed. ```powershell ctest --test-dir <build> --no-tests=error --output-on-failure -j 1 -R '^(native_compute_manifest_reasons|native_compute_manifest_reasons_requests|native_compile_dxil_refusals|native_compile_dxil_watch|native_startup_request_cache_controls)$' python -B tests/startup_triage_run_check.py ```
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!3268
No description provided.