startup: translate device slot 67 compute requests with the gfx2hlsl compute stage #2215
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2223"
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 NiiRoZz on 2026-11-25T05:56:52Z.
Change
Based on
main. Both pieces it connects are merged: the gfx2hlsl compute stage (#2182) and slot 67 requestpublishing (#2195). This PR is the consumer between them, in one commit.
gfx2hlsl.py --pendingand--watchnow translate areq_<key>.c67request instead of recordingcompute stage not supported. The stand-in is unchanged and still creates a placeholder. Loading andbinding the result at run time is the next PR.
Request checks. A request is refused into
<key>.fail, with no manifest, when:.descis not 96 bytes;.desc(code word 6, data word 8, state blocks words 2and 4);
s_endpgm.No cache path reaches the
.failtext: file errors becomeunreadable shader request, and DXC's file prefixis stripped.
Translation.
ComputePipeline(code, .root, rsrc2, group):rsrc2is state block A dword 6;groupis (dword 3 bits 15:0, dword 3 bits 31:16, dword 4 bits 15:0);This mapping is a hypothesis supported only by a local observation (below). The stand-in does not decode
these values.
Outputs.
<key>.cs.hlsl, then<key>.cs.cso(DXCcs_6_0 -Gis), then thestage csmanifest<key>.txtlast.A stage refusal goes to
<key>.failwith the stage's own reason.pending_keystreats a compute request as done once<key>.txtand<key>.cs.csoexist.X2W_FXC=(empty) publishes the manifest alone, as for graphics.<key>.cs.csohas the same form as the slot 62 results of #1441 in the same directory. The keys come fromdifferent hashes, so the names clash only on a 64-bit collision.
Refs #1412. Overlap:
<key>.cs.cso);req_<key>.csfor slot 62);gfx2hlsl.py).Verification
Head
ae0bcb9a, one commit onorigin/main2e4f44cb(which includes #2182, #2195, the compute D16 load guard and#2139). Windows 11 build 26300, MSVC x64, DXC from Windows SDK 10.0.26100.0. Adapters, as printed by
offscreen_check:Microsoft Basic Render Driver vendor=1414 device=008c;NVIDIA GeForce RTX 5090 vendor=10de device=2b85, driver 32.0.16.2135.Debug layer on, with
debug_errors=0 debug_warnings=0.Result: 26 of 26 passed, with no skips. The selection includes all of #2182's controls on both adapters.
startup_compute_translate_e2e_warpand_hardware: all 320 words match.startup_compute_translate_e2e_wrong_group_warpand_hardware: bothrejected at word=5 expected=f5c0f122 actual=c5c5c5c5.Also passed:
python -B tests/startup_compute_translate_check.py, pure Python, added to the CI list and AGENTS.md;startup_compute_request_offline_check.py, which now expects the stage's refusal of its synthetic 24-bytestate block A;
startup_gfx2hlsl_compute_check.py,startup_triage_run_check.py,docs_links_check.pyandbidi_controls_check.py.Evidence and follow-up
startup_compute_translate_requests(pure Python) writes requests withgfx2hlsl.compute_key:stage csmanifest withnumthreads(2, 3, 4);s_endpgm, a data size word that disagrees, a 24-byte state block, files renamed to another key, and amissing
.root(whose.failhas no path);startup_compute_translate_e2e_<adapter>goes end to end:--pendingtranslates it and DXC compiles it;offscreen_checkdispatches the published<key>.cs.csoand compares all 320 words with #2182'sexpectation.
The control swaps the group size in the state block and must mismatch.
What the e2e test proves: the request files, translation, compiled bytecode and dispatch fit together. It
does not prove the state-block mapping, because the fixture builds the block at the offsets the translator
reads.
Local observation (one title, local files only, counts only):
dwords 3 and 4 are within
numthreadslimits in all 2,689, with 43 distinct sizes.it covers Y > 1 in 2,671 of 2,689.
TG_SIZE_ENis set in 91, which the stage refuses.offline with this branch's
compute_key, which leaves the files unchanged and renames them. This PR'sgfx2hlsl.py --pending(head
ae0bcb9a, on currentmain) then translated and compiled 8 of 2,689 in 11 s, with no translator error.No request was refused by the request checks, and DXC rejected none of the 8.
.failfiles):buffer_load_format_* requires descriptor FORMAT and DST_SEL: 1,280 (1,266 of them_x);... inside a block s_cbranch_execz skips per lane, for any instruction: 541;s_loadwith a register offset through the resource heap: 158;image_store: 110;TG_SIZE_EN: 91.Limits:
main's compute stage at2e4f44cb. An earlier run with #2182's5633dcd0gave the same counts.Follow-up:
buffer_load_formatfrom the descriptor format and scalar writes unders_cbranch_execz;<key>.txtand<key>.cs.csoat slot 67 and bind the compute root (after #1803).Checklist
AI-assisted (Claude Code); the commands above were run locally.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T05:59:21Z.
Review: COMMENTED
Review of head
ae0bcb9a1f81ecf513e41a11b51172d58ba4ab20(comment only).Scope read:
tools/startup/gfx2hlsl.py(compute_entry,load_compute_request,compute_refusals,translate_compute,pending_keys), the three tests, docs, CMake and workflow wiring. Mergeable. Title is neutral. No clean-room concerns seen.Commands run locally (Linux):
python3 tests/startup_compute_translate_check.py-> pass (case A manifest, 5 malformed requests refused, renamed and incomplete refused)python3 tests/startup_compute_request_check.py-> ran (usage text only; the negative control needs the Windows render path)python3 tests/startup_compute_request_offline_check.py-> passpython3 tests/docs_links_check.py-> pass (18 files, 410 links)python3 tests/bidi_controls_check.py-> passgit diff --check origin/main...HEAD-> cleanMutations (both reverted with
git checkout -- .):compute_entry(dword 3 halves): the translate check fails (group 2 3 4expected). Killed.load_compute_request: the translate check fails (data size wordreturnedok). Killed.Findings
tools/startup/gfx2hlsl.pytranslate_compute: if DXC fails after an older<key>.txtexists, that manifest stays in place next to the new.fail.pending_keysstill treats it as done only when.cs.csois valid, so this is harmless today, but removing the stale.txton the failure paths would match the success path.cs_6_0compile, so a Win2025 pass is worth waiting for before Ready.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T06:08:14Z.
Review: COMMENTED
Re-review of head
04894d4adf4c80b1dfc0200c6e5f584c91570437(delta sinceae0bcb9a: withdraw a stale manifest when DXC fails).Result: no P1. The new fix is correct and tested. Two P2 items, one nit.
Commands run locally on the PR worktree:
python3 tests/startup_compute_translate_check.py-> pass (includes the new "failed compile withdraws the manifest" case)python3 tests/startup_compute_request_check.py-> pass (usage text only, no FAIL)python3 tests/startup_compute_request_offline_check.py-> passpython3 tests/docs_links_check.py-> 410 links OKpython3 tests/bidi_controls_check.py-> OKgit diff --check origin/main...HEAD-> cleanMutations:
os.remove(name + '.txt')in the DXC-failure path (tools/startup/gfx2hlsl.py:3205) withpass. The new test fails with "a manifest was left next to the failure". Killed.pending_keys, change the compute stage list from('.cs.cso',)to('.vs.cso',). The test still passes. Survived.Findings:
tools/startup/gfx2hlsl.py(pending_keys, thestages = ...line): no test covers the non-manifest-only branch for c67. A request with a.txtbut no.cs.csoshould stay pending whenX2W_FXCis not empty. Mutation 2 shows nothing guards it. Add one assertion withX2W_FXCunset: a.txtalone is pending, and.txtplus a real.cs.csois done.translate_compute: the stale-manifest withdraw runs only when DXC runs and fails. The "dxc not found" path (around line 3190) writes.failbut leaves an older.txtin place. TheUnsupportedpath fromload_compute_requestdoes the same. The key is a content hash, so this needs a manual cache edit or a toolchain change to hit. Still, the invariant "no manifest next to a.fail" is only partly kept. Remove.txtonce in a shared spot before any.failwrite..cs.hlslfile is always rewritten, even when DXC is missing. That is harmless, but it is another file that can go stale next to a.fail.No Windows run was needed for this delta. It is Python cache handling only and has no shader or C++ change. CI already ran the Windows job.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T06:22:24Z.
Review: COMMENTED
Re-review of head
9c8457c0fe20b85935d8de9322a0e599cb0ed03d(delta since04894d4a: one commit, "Withdraw compute manifests before retrying slot 67 requests"; comment only).Result: no P1. Previous P2 #2 is resolved. Previous P2 #1 is still open.
Previous findings
.txtnext to a.failon the "dxc not found" andUnsupportedpaths): RESOLVED.translate_computenow removes<key>.txtonce at the top (tools/startup/gfx2hlsl.py:3181-3182), before any.failwrite, and the duplicate removals were dropped. The new test deletesreq_<key>.rootafter a published run and checks the refusal and that no manifest remains.pending_keysfor c67): STILL OPEN. The commit touches only the test lines above; no assertion was added withX2W_FXCunset.Commands run locally (Linux, PR worktree at
9c8457c0):python3 tests/startup_compute_translate_check.py-> pass (includes the new "refused request withdraws the manifest" case)python3 tests/startup_compute_request_offline_check.py-> passpython3 tests/startup_compute_request_check.py-> usage text only (needs the Windows render path), no FAILpython3 tests/docs_links_check.py-> 410 links OKpython3 tests/bidi_controls_check.py-> OKgit diff --check origin/main...HEAD-> cleanMutations (each reverted with
git checkout -- .):os.remove(name + '.txt')at line 3182 withpass: translate check fails with "a manifest was left next to a refused request". Killed.pending_keys(line 3719) change the c67 stage tuple('.cs.cso',)to('.vs.cso',): translate check and offline check both still pass. SURVIVED (same as last round).Findings
tests/startup_compute_translate_check.py/tools/startup/gfx2hlsl.py:3719: the c67.cs.csostage rule inpending_keysis unguarded. The existing "done" assertion runs withX2W_FXC=""(manifest-only), where the stage list is not consulted. Add, withX2W_FXCunset: a.txtalone keeps the key pending;.txtplus a non-empty.cs.csomakes it done. That kills mutation 2.Windows proof: not run here. The delta is Python-only manifest handling, and CI Windows build/test passes at this head.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by NiiRoZz on 2026-11-25T06:02:58Z.
Thanks. Fixed in
04894d4a: a failed DXC compile now withdraws<key>.txtas the success path does.startup_compute_translate_check.pycovers it with a manifest from an earlier pass plus a forced compile failure: only<key>.failis left andpending_keysretries the request. The check fails without the fix.The same commit brings the docs census in line with the PR body (541, 11 s). 26/26 of the ctest selection and the pure-Python checks pass.
On the second nit: agreed, the state-block layout stays a hypothesis here; the runtime loading step will not rely on it without a second source.
AI-assisted (Claude Code).