startup: name why s_getpc_b64 is refused instead of reporting the mnemonic alone #2476
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2484"
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 ChazY11 on 2026-11-25T18:07:35Z.
Refs #2463 — third item (
s_getpc_b64refused in a pixel stage), the one the census lists as "not investigated;the first step is to name the exact form and what consumes the pair". This is that step, plus the message the
naming makes possible.
What the pair is, from the tree
s_getpc_b64 s[a:b](one operand, 4-byte encoding) returns the address of its successor. The project alreadydocuments exactly what consumes it —
calculated_pc_proof(), whose docstring says:So the pair is a load address plus a known offset. It is elided when the program also computes a branch target
(
s_setpc_b64), which is what makescalculated_pc_proof()run at all —if not any(name == 's_setpc_b64' ...): return {}. A program with GETPC and no SETPC reaches the dispatcher fallthrough, which raisedUnsupported(base)with the bare mnemonic.
What changed
One named refusal, no behaviour change for any accepted program:
Measured for six forms — the instruction alone, with the
s_add_u32/s_addc_u32pair that makes it a pointer, andwith the pair used directly as a descriptor, each in a pixel and a compute stage. Narrowed to
s_getpc_b64onpurpose:
s_setpc_b64keeps its bare text becausetests/startup_gfx2hlsl_calculated_target_check.pypins anexhaustive refusal list containing it, and changing that message would have meant editing someone else's assertion.
Verification
Registered in
CMakeLists.txt(startup_gfx2hlsl_getpc_refusal), the LinuxRun Python checkslist, andAGENTS.md.What this does not do
It does not lower the instruction. Whether the pair can be lowered for a program without
s_setpc_b64depends onwhat consumes it in the captured requests, which I cannot see; if the value ends up as a pointer into the shader's
own image, the model has nothing to bind it to and the refusal is the honest outcome — now with a reason the census
can group separately from "no handler exists".
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T18:40:35Z.
Review: COMMENTED
Review of head 6df68b1882b1 (comment only, no merge or approval).
What I checked:
tools/startup/gfx2hlsl.pythat raises a namedUnsupportedfors_getpc_b64when no calculated-target proof exists. Accepted programs are unchanged, because the branch sits just before the old bareraise Unsupported(base).calculated_pc_proof()docstring (load address plus a known byte offset, elided only whens_setpc_b64is also present).base == 's_getpc_b64'condition made the new check report 8 failed. Restored, it reports 0 failed.startup_gfx2hlsl_calculated_target_check.pystill passes.s_setpc_b64correctly keeps its bare text, as the PR body explains.CMakeLists.txt, theAGENTS.mdlist and the LinuxRun Python checksstep of.github/workflows/windows.yml. That workflow change is one added line in an existing list.s_getpc_b64). #2238 and #2189 cover the proven-target lowering, not this message.Commands run locally:
python3 -B tests/startup_gfx2hlsl_getpc_refusal_check.py-> 0 failed, PASSpython3 -B tests/startup_gfx2hlsl_calculated_target_check.py-> passpython3 tests/docs_links_check.py-> 19 files, 468 links okpython3 tests/bidi_controls_check.py-> okgit diff --check origin/main...HEAD-> cleangit checkout -- .Not checked:
No blocking findings.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T18:10:03Z.
Two verifications on the rebased head
93208699, so nothing here needs re-running to review:1. Registration is live, not just present in the diff.
2. The new refusal text survives the census normaliser, so it groups separately from the bare mnemonic —
which is the whole point of the change:
Also, for anyone reading the diff: the guard is narrowed to
s_getpc_b64on purpose.startup_gfx2hlsl_calculated_target_check.pypins an exhaustive refusal list that includes a bare
s_setpc_b64, and I would rather leave that assertion untouchedthan retune someone else's expected text. If you want
s_setpc_b64named the same way, it is a one-line follow-up plusthat list's entry.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T18:52:31Z.
I reproduced a false positive in the proposed GETPC control: its target was outside the decoded program, and any refusal other than the new GETPC message satisfied the test.
e2b0a373now reuses the existing assembled calculated-jump fixture and requires the exact CFG and arithmetic result. The pixel and compute refusal checks and the proven control pass locally at this head. Fresh CI is running.