Skip to content

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

Merged
R0Y00 merged 2 commits into
R0Y00:mainfrom
Not-Saii:compute/manifest-reasons
Nov 28, 2026
Merged

R0Y00 merged 2 commits into
R0Y00:mainfrom
Not-Saii:compute/manifest-reasons

Conversation

@Not-Saii

@Not-Saii Not-Saii commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

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

AI-assisted.

🤖 Generated with Claude Code

Each refusal in format_compute_runtime_manifest now returns a fixed
reason. compile_dxil --requests writes it to <key>.fail beside the
published .cs.cso, --watch writes it instead of the reasonless line,
--refusals counts it, and triage_run.py reports it as an allowlisted
category. Accepted manifests and published files are unchanged.

Refs R0Y00#3224

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@R0Y00 R0Y00 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--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.

A program that compiles but gets no runtime manifest is not a failed
request: .fail is the retry marker of both watchers, and with
--skip-failed the Python watcher stopped selecting such a key in a live
cache (review of R0Y00#3268). --requests now removes .fail as before and
prints the reason in the job report as no_manifest input=... <reason>.
--watch, which refuses the key, still writes the reason to its .fail.

The end-to-end check runs --requests in a live cache beside a genuine
refusal and checks both pending_keys selections, plus the --watch case.

Refs R0Y00#3224

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Not-Saii

Copy link
Copy Markdown
Contributor Author

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.

@Not-Saii
Not-Saii requested a review from R0Y00 November 28, 2026 03:30

@R0Y00 R0Y00 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants