tooling: write .fail diagnostics and add read-only --refusals summary to compile_dxil #2984
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2984"
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 stan495 on 2026-11-27T02:53:42Z.
Target branch
cpp-migration. Fixes #2983. Refs #2935.Behavior
.faillifecycle incompile_dxil --requests( ools/startup/compile_dxil.cpp):<stem>.failalongside<stem>.txtin batch mode.<key>.failwhen a startup graphics (req_<key>.a) or slot-67 compute (req_<key>.c67) request is refused, while publishing no stage.csoor<key>.txt.<key>.failwhen the same request succeeds on a subsequent run.compile_dxil --refusals REQUEST_DIRECTORY [--jobs N] [--json]( ools/startup/compile_dxil.cpp, src/direct_compute_cache.{h,cpp}):req_<key>.aandreq_<key>.c67requests and runs native translation/validation acrossNworkers without invoking DXC or writing any cache/output files (addingwrite_cache = truetoprepare_direct_graphicsso--refusalspassesfalse).native compute +0x...:PC prefixes and normalizes hex literals, byte offsets, VGPR indices, and register numbers/ranges in aggregated refusal counts; emits TSV text or JSON.triage_run.pyclassification ( ools/startup/triage_run.py):.failfirst lines underSHADER_REASONSusing fixed tokens or instruction-family prefixes without copying arbitrary text, paths, or hex words.Verification
b6342d98(based onorigin/cpp-migration05438d65)10.0.26100.0.failremoval, refused re-run withdrawing<key>.txt, directory snapshot proving--refusalsperforms zero writes, hex/key/PC redaction in--refusalsandtriage_run.py, and invalid--refusalsCLI arguments.Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-27T03:17:04Z.
Review: APPROVED
Review of head
b6342d98, which is on the currentcpp-migrationtip05438d65. CI on the head is green. Approving and merging.Code read:
.faillifecycle:<stem>.failis reserved with the other outputs. It is published atomically only from the batch worker's catch, after the job has already withdrawn<key>.txtand published no stage bytecode, and it is removed after each successful compute or graphics publication.--refusals: it readsreq_*.aandreq_*.c67, runsread_graphics_request+prepare_direct_graphics(..., write_cache = false)andread_compute_request+translate_compute(req, 0, true), and never starts DXC. Entry 0 matches the stand-in's in-process route. Withwrite_cache = falsethe pair cache is neither read nor published. Interface companions are still read fromREQUEST_DIRECTORY/interfaces, so the decode matches a real run.at byte N,VGPR NandsN/vN/s[N:N]are normalized before counting. Thetriage_run.pypatterns are anchored allowlists, and the private-text check gains two native lines.parse_jobs_countis shared with the existing--jobspath, with the same 1–64 bounds.Run on AMD: Windows 11 26300.9974, AMD Radeon RX 9070 XT (driver 32.0.32029.2010), plus WARP, release.
ctest --preset release --no-tests=error -R '^(native_.*|startup_compute_translate_e2e_warp|startup_slot67_indirect_dispatch_warp)$'gives 60 tests, 57 passed and 3 skipped (77:native_comparison_pso_warp,native_heap_handle_probe_warp,native_global_srv_heap_replay_warp, because WARP has no 32-lane waves). That includesnative_compile_dxil_refusalsandnative_startup_request_cache_controls.tests/startup_triage_run_check.py: 0 failed.On one local start-up capture (copied request files only; counts only):
--refusals --jobs 8--requests --jobs 8with DXCreq_*.c67).failreq_*.a).failThe census agrees with the real compile on both counts. A snapshot of names, sizes and modification times of the request directory is identical before and after
--refusals.Mutations here:
write_cache = truefrom--refusalsfailsnative_compile_dxil_refusalswithread-only --refusals modified the request directory..failremovals fails it withstale .fail survived successful compilation.Note, not blocking:
<key>.failis the same namegfx2hlsl.pywrites, as #2935 asks, sotriage_run.pyreads both. Ifcompile_dxil --requestswrites into a directory wheregfx2hlsl.py --watchalso runs, a native.failnewer than its request makes later watch passes skip that key (pending_keys(skip_failed=True)). Running both translators into one directory was already unsafe before this PR, since a native refusal withdraws a published<key>.txt. A line in the topic note saying the two should use separate output directories during the migration would help.I will close #2983 by hand.
AI-assisted; the commands above were run locally.