tooling: report compute dispatch refusals in triage summary #3384
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3384"
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 triggered02 on 2026-11-28T17:24:38Z.
Refs #3381
Adds an allowlisted compute Dispatch section to
tools/startup/triage_run.py. The shareable summary previously omitted the current first blocker of a startup run.x2w-draw compute ... refused: <reason>by the fixed reason literals insrc/startup_stubs/d3d12_compute_dispatch.inl; unknown text becomesother (text omitted).x2w-render compute dispatches:totals: translated, refused, no translation, not modelled and builder gate refused.Verification (Debian x64, Python 3.12, standard library only):
python3 -B tests/startup_triage_run_check.py->startup triage_run checks: 0 failed(known reason, unknown reason, mirrored trap.log deduplication, per-bucket totals, negative control, redaction).python3 -B tests/startup_triage_run_cli_check.py-> 8 tests OK.an input is in a placed buffer that does not alias title memorywith totals 0 translated / 2942 refused; a grep of the report for the program key, descriptor address and host paths returned 0 matches.AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-28T17:24:46Z.
Codex Review Summary: ❌ Failed
This comment shows the latest Codex review activity on this pull request.
We couldn’t complete this review. Comment
@codex reviewto try again.ce63461ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-28T17:24:49Z.
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-28T18:17:09Z.
Review: CHANGES_REQUESTED
Reviewed
ce63461eby its diff. Request changes.The allowlist misses many reasons that reach the
Dispatch(...) refused:line. Onmainf2972840, bind refusals fromcompute_root_srv_buffer,compute_token_output/volume_uav_range_errorandrecord_translated_dispatchind3d12_compute_dispatch.inl, and fromindirect_table_bufferinsrc/startup_stubs/d3d12_draw.inl(for example lines 2566 and 2598), are not inCOMPUTE_DISPATCH_REASONS; neither are the manifest reasons that come throughtr->unmodelled. Examples:an output UAV interval is unaligned, oversized or outside its buffer,an output token's backing does not uniquely alias its guest byte interval,an input view token is not a buffer view of a desktop resource. Two listed strings are not refusals onmain:zeros for a null descriptoris an input-source label (line 800), andan output texture view is not 1Disan output texture view or resource is not 1Dthere.The line is printed for the first 16 bind refusals and the first 16 untranslated or unmodelled dispatches per process, and not for indirect dispatches (
d3d12_compute_dispatch.inl:972-975), so the table counts log lines, not dispatches. In a 600 s and a 900 s start-up run here, 9 and 7 of the 32 refused lines carry a reason missing from the set and would show asother (text omitted). The four largestcompute census reasonentries afterno translationin both runs (1,146,106, 831,790, 547,723 and 356,938 dispatches at 900 s) are reasons missing from the set.Fix: in the test, check that every reason literal of these functions is in the set, so a new reason fails the test instead of folding into
other; drop or correct the two stale entries.Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T20:34:50Z.
Review: APPROVED
LGTM — useful addition to the triage tool.
Adds compute dispatch refusal tracking to triage_run.py. Defines COMPUTE_DISPATCH_REASONS allowlist for known first-refusal reasons; unknown reasons are bucketed as OTHER without copying private text (keys, addresses, descriptors) into the report. Parses cumulative
x2w-render compute dispatches:totals and takes per-bucket maxima across snapshots. New report section### Compute Dispatch Refusalswith markdown table. Test covers known reasons, OTHER bucket, privacy, negative control, and deduplication with trap.log.Ready to land.
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T21:57:08Z.
Review: APPROVED
LGTM — useful addition to the triage tool.
Adds compute dispatch refusal tracking to triage_run.py. Defines COMPUTE_DISPATCH_REASONS allowlist for known first-refusal reasons; unknown reasons are bucketed as OTHER without copying private text (keys, addresses, descriptors) into the report. Parses cumulative
x2w-render compute dispatches:totals and takes per-bucket maxima across snapshots. New report section### Compute Dispatch Refusalswith markdown table. Test covers known reasons, OTHER bucket, privacy, negative control, and deduplication with trap.log.Ready to land.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T04:01:10Z.
Review: APPROVED
Approve at
e44093d8. Reviewed by reading the diff againstce63461eand main212d4b5f; nothing was built or run here. The first commit (9b07999c) is the same patch asce63461e, rebased.COMPUTE_DISPATCH_REASONS(tools/startup/triage_run.py:69-200) now holds 130 strings. All 130 occur as literals on main: 111 insrc/startup_stubs/d3d12_compute_dispatch.inl, 19 inindirect_table_buffer(d3d12_draw.inl:2511-2654). The reasons ofcompute_root_srv_buffer,compute_token_output,volume_uav_range_error,record_translated_dispatchandload_compute_translationare covered. The one refusal literal of these functions left out,typed input range is not dword aligned(d3d12_draw.inl:2640), needsalignment == 4; the compute calls (d3d12_compute_dispatch.inl:794,:939,:1131) use 16.zeros for a null descriptorand the snapshot label are no longer listed, andan output texture view is not 1Dbecamean output texture view or resource is not 1D.### Compute Dispatch Refusals (logged lines, capped per process)(tools/startup/triage_run.py:896), which matches the 16-line caps and the indirect exclusion atd3d12_compute_dispatch.inl:990-992.check_allowlist_covers_source_reasons(tests/startup_triage_run_check.py:367, called at:796) scans both sources and fails when a matching literal is missing from the set. The file runs as CTeststartup_triage_run(CMakeLists.txt:5285-5286) and in the Linux Python job (.github/workflows/windows.yml:327); both jobs pass ate44093d8.Not blocking:
reason_start(tests/startup_triage_run_check.py:376-380), so a new reason starting with another word (typed,descriptor, ...) would still fall intoother (text omitted)without failing the test.:432), a set entry that no longer exists in the source is not detected.Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-29T13:36:27Z.
Review: CHANGES_REQUESTED
Independently reviewed
e44093d8integrated overmain17b662a2(treeb70be32b). Request changes: two reproducible problems, both small.The trial merge is clean and
git diff --checkis clean. I read the two rules against the log statements they parse (src/startup_stubs/d3d12_compute_dispatch.inl:1084andsrc/startup_stubs/d3d12_xs_device.cpp:7833) and ran the Python checks on the merged tree and on the head alone. This is tooling only, so nothing was built and no title run was requested.1. Merged over current
main, the PR's own test fails.python -B tests/startup_triage_run_check.pyon the trial merge printsOn the head alone (merge base
212d4b5f) the same command printsstartup triage_run checks: 0 failed.maingained these 12 literals after the merge base (for example in7aa09ec0,80952189,647db688,19bf3cabandd13a3353). The branch has no textual conflict, so GitHub shows it as mergeable and the checks one44093d8are green, but merging it as it stands would turn thestartup_triage_runCTest and the Linux Python job red onmain. Please merge or rebase onto currentmainand add the 12 strings.This is the source scan doing what it was added for. It also means every later PR that adds a refusal literal to
d3d12_compute_dispatch.inlorindirect_table_buffermust touchtools/startup/triage_run.pytoo; a sentence saying so in the comment aboveCOMPUTE_DISPATCH_REASONSwould help the next author who hits it.2. The totals rule does not match the line the runtime prints.
RE_COMPUTE_TOTALSends inbuilder gate refused (\d{1,19})\s*$. The log statement atd3d12_xs_device.cpp:7833continues after that number:The suffix is already there at the PR's merge base. Filling that format string with integers and passing the line to
triage_run.summarize_linesgivescompute_totals: None, on the head alone and on the trial merge, so the cumulative row is never printed for a real log. The fixtures intests/startup_triage_run_check.pyuse a shortened line that stops atbuilder gate refused N, which is why the test passes. I could not reproduce the "0 translated / 2942 refused" totals from the description with this regex and this format string; if your local log comes from a build with a different line, say which.Suggested direction: drop the
\s*$anchor (or accept;after the last number) and make the fixture lines carry the real suffix. Dropping the anchor is mutant M12 below; it passes the present tests, so the fixture change is what pins it.Mutants (each applied to
tools/startup/triage_run.pyat the head, thentests/startup_triage_run_check.pyandtests/startup_triage_run_cli_check.py; file restored andgit diff --quietchecked afterwards):Killed (7):
leaked 'alice' in report.max->min, and M3 last snapshot wins:compute totals did not take per-bucket maxima.'no translation'from the set:compute refusal counts wrong.'manifest version'(not used by any fixture): caught by the source scan.'an output texture view is not 1D':stale reason still allowlisted.Surviving (5):
\s*$anchor. See finding 2.if compute:). No fixture has totals without refusal lines..strip()on the reason. Not equivalent: with CRLF line ends the reason would keep the\rand fall intoother. The fixtures only use\n. (CRLF input does work at the head; I checked it by hand.)[0-9a-fA-F]{16}->\S+. No fixture has a near-miss line.continueafter a refusal line. Probably equivalent, since I found no later rule that matches this line, but I did not prove it.Equivalent: none shown.
M7, M8, M9 and M11 are not blocking. The two notes in the approval on this head (the
reason_startword list, and the one-directional check) still stand and are not blocking either.Hard-rule screen: no game files or dumps, wording is title-neutral, one behaviour, no test weakened, the new section has a negative control (the rule replaced by
(?!)), title form is fine. The privacy property holds as far as tested: an unknown reason, the program key and theDispatch(...)arguments do not reach the report.Environment: Windows 11 25H2 build 26200.9974; Python 3.12.10. No GPU tests.
CI:
Build and test on WindowsandRun platform-independent Python checks on Linuxpass one44093d8; those runs are from 03:27Z on 2026-11-29 and do not covermain17b662a2, where finding 1 reproduces locally.This reply was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-29T17:42:14Z.
Review: APPROVED
Retested
de70c492integrated overmain26df1826(tree1830c3d3). Approve. This supersedes my changes-requested review one44093d8.The branch is now rebased onto
c4b8a41b; againste44093d8the two PR files differ only in the allowlist, the totals rule, its comment and the fixtures. The trial merge is clean andgit diff --checkis clean. Tooling only, so no title run was requested.Earlier finding 1 (the PR's own test fails over current
main): addressed.python -B tests/startup_triage_run_check.pyon the trial merge printsstartup triage_run checks: 0 failed.COMPUTE_DISPATCH_REASONSnow holds 166 strings; the 12 I listed are in it, along with the typed-buffer, cube, indexed-atomic and adapter-capability reasonsmaingained since. I also checked the other direction by hand: all 166 occur as literals ind3d12_compute_dispatch.inlord3d12_draw.inlonmain26df1826, so there is no stale entry today. The comment above the set now says a new refusal literal must be added there in the same PR.Earlier finding 2 (the totals rule does not match the runtime's line): addressed.
RE_COMPUTE_TOTALSno longer ends in\s*$. I filled the format string atsrc/startup_stubs/d3d12_xs_device.cpp:7855with integers and passed it totriage_run.summarize_lines: the five totals are read correctly with\nand with\r\nline ends, and also from the short form without the placed-input suffix. The fixtures now carry the real suffix, so putting the old anchor back fails the test (M12 below).Tests on the trial merge:
python -B tests/startup_triage_run_check.py:0 failed.python -B tests/startup_triage_run_cli_check.py: 8 tests OK.compile_dxilandnative_compute_manifest_reasonsindev, thenctest --test-dir out/build/dev --no-tests=error -j 4 -R "^(startup_triage_run|runtime_startup_triage_run_cli_check|startup_refusal_census|native_compile_dxil_refusals|native_compute_manifest_reasons|native_compute_manifest_reasons_requests|startup_run_preset)$":7 passed, no skips. These are the other tests that import or call
triage_run.py.Mutants (each applied to
tools/startup/triage_run.pyon the trial merge, then both Python checks; file restored andgit diff --quietchecked afterwards):Killed (9):
leaked 'alice' in report.max->min, and M3 last snapshot wins:compute totals did not take per-bucket maxima.'no translation':compute refusal counts wrong.'a content view token is not readable'(one of the 12 new strings): caught by the source scan.'an output texture view is not 1D':stale reason still allowlisted.totals-only log produced no totals row. This survived one44093d8; the new totals-only fixture kills it.\s*$anchor back on the totals rule:TypeError: 'NoneType' object is not subscriptablein the test. This is the old behaviour from finding 2 and it survived one44093d8.Surviving (5), none blocking:
.strip()on the reason. With CRLF line ends the reason would keep the\rand fall intoother; the fixtures only use\n.continueafter a refusal line. Probably equivalent (I found no later rule that matches this line), not proven.[0-9a-fA-F]{16}->\S+. No fixture has a near-miss line.\s*$after the optional suffix. Same output for both line forms the runtime has printed.Equivalent (1):
The two notes from the approval on
e44093d8(thereason_startword list and the one-directional check) still stand and are not blocking.Hard-rule screen: no game files or dumps, wording is title-neutral, one behaviour, no test weakened, the section has a negative control, title form is fine. All three commits are the author's.
Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; Python 3.12.10. No GPU tests.
CI:
Build and test on WindowsandRun platform-independent Python checks on Linuxpass onde70c492.This reply was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T17:45:31Z.
On main
1b8e2fee:de70c492removed'an input view token is not a buffer view of a desktop resource'fromCOMPUTE_DISPATCH_REASONS, butinput_view_token_refusalstill returns it (src/startup_stubs/input_view_token.h:69) andindirect_table_bufferforwards it withrefuse(token_reason)(src/startup_stubs/d3d12_draw.inl:2597).Ten more reasons from that function are not in the list either (
input_view_token.h:58-75; onlyhas an unrecognized slotis), so all eleven are counted asother (text omitted).check_allowlist_covers_source_reasonsdoes not catch this because it reads onlyd3d12_compute_dispatch.inlandd3d12_draw.inl.I can open a follow-up for this: add the eleven strings and scan
input_view_token.hin the check.