shader: lower off and vcc_hi operands in gfx2hlsl (Part of #1723) #2034
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!2034
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2034/head"
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?
@tedin7 on GitHub · 2026-11-24 23:30 UTC · original
tedin7:x2w-r20-off-vcchi→main· +108 −0 · 4 files · 3 commits · closed without mergingPart of #1723
What this unblocks: Run 20 census #20 (34/32 pairs).
gfx2hlslrefused two operands outright. A compressed export with anoffregister (exp mrt0 v0, v1, off, off compr) now exports zero for that pair, as an uncompressedoffalready does.vcc_hias a source now reads zero, because in wave32 the high half of the lane mask holds no lane.Known limit: the
vcc_hirule assumes wave32, which is what the translator targets. Writes tovcc_hiand toexec_hiare unchanged.Changes:
tools/startup/gfx2hlsl.py:u()returns0uforvcc_hi; the compressed export mapsoffto0ubefore splitting it into halves.tests/startup_gfx2hlsl_off_vcchi_check.py(new, registered inCMakeLists.txtasstartup_gfx2hlsl_off_vcchi): translates both forms and checks the emitted lines.Verification: run locally on Linux (not on Win2025), from the repo root of the branch.
python3 -B tests/startup_gfx2hlsl_off_vcchi_check.py: PASS with the change. Withtools/startup/gfx2hlsl.pyfromorigin/main: FAIL (operand 'off',operand 'vcc_hi').python3 -B tests/startup_gfx2hlsl_sop2_complement_check.py: PASS.python3 -B tests/startup_gfx2hlsl_refusals_check.py: no failing check.python3 -B tests/startup_translator_check.py: 0 failed.AI-assisted; commands listed were executed locally.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:31 UTC · original · edited 2026-11-24 23:39 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
6766106ℹ️ 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.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:39 UTC · original
For an RG-only compressed export with a full render-target write mask,
offdisables B/A writes; it does not write zero to those channels. This now emits a fullfloat4, but the manifest carries no channel mask andpipeline_for()insrc/startup_stubs/d3d12_draw.inl:473-476defaults toD3D12_COLOR_WRITE_ENABLE_ALL. Consequently, the newly acceptedexp mrt0 v0, v0, off, off done compr vmoverwrites existing B/A values with zero. Carry the EXP enable mask through to the desktop PSO, as the existingpixel_aot.lower(..., return_write_mask=True)path does, or retain refusal until that mask can be applied.Useful? React with 👍 / 👎.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:39 UTC · original
For a wave64 gfx1013 shader, the legal sequence
s_mov_b64 vcc, -1followed byv_mov_b32 v3, vcc_himust copy0xffffffff, but this change emitsv3 = 0u. NeitherPipelinenorStagevalidates a guest wave32 profile, so the comment's wave32 assumption does not constrain when this folding occurs. The sequence was previously refused and now silently produces incorrect shader data. Require validated mode/value information before folding the high word, and retain refusal for unverified reads.Useful? React with 👍 / 👎.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:39 UTC · original
Accepting previously refused compressed-export and
vcc_hiforms expands the public startup translator capability, but this commit updates neither the README nordocs/experiments.md. The rootAGENTS.mdrequires a documentation update when a public capability changes. Add the new fixture's reproduction command and scope there, distinguishing the passing translation-only checks from unverified GPU behavior and recording the wave-mode limitation.AGENTS.md reference: AGENTS.md:L210-L211
Useful? React with 👍 / 👎.
@tedin7 on GitHub · 2026-11-25 00:55 UTC · original
Already covered on the rebased branch: the export derives its channel mask from the non-
offoperands (0x3 forv0, v0, off, off compr) and the manifestwmaskline carries it to the pipeline write mask, so B/A are not overwritten. The check now asserts the mask. Commit 01e9853f (rebased on current main, pending host push).Commands:
python3 -B tests/startup_gfx2hlsl_off_vcchi_check.pyPASS.AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-25 00:56 UTC · original
Fixed:
vcc_hinow raises Unsupported unless the stage is explicitly marked wave32, which nothing sets yet, so real shaders keep the refusal. The check covers both the refusal and the wave32 case. Commit 01e9853f (pending host push).Commands:
python3 -B tests/startup_gfx2hlsl_off_vcchi_check.pyPASS;tests/startup_smem_address_check.pyandtests/startup_gfx2hlsl_sop2_complement_check.pyPASS.AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-25 00:56 UTC · original
Fixed: new section in docs/experiments.md with the reproduction commands, the translation-only scope (GPU behaviour unverified) and the wave-mode limitation. Commit 01e9853f (pending host push).
AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-25 11:03 UTC · original
Closing: compressed-export
offhandling is already onmain(tools/startup/gfx2hlsl.py), andvcc_hicurrently has no live wave32 caller in the startup translator, so keeping this PR open adds no real startup coverage.@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:39 UTC · original · reviewed
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
6766106b8bℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Pull request closed