tests: pin the absolute-value and negated-mask refusals on the select #1769
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1776"
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-24T18:23:45Z.
Follow-up to the merged #1710, closing the two test-coverage nits from tedin7's re-review at
f9e815d5. Tests only — no production change.Nit 1 — the negated mask is refused, and now pinned
The reviewer asked for a decoder-produced
-s0mask control or a note on why it cannot be encoded. It can be decoded: settingw1[31]on the select makes the decoder print-s0(LLVM will not assemble that spelling, which is why no fixture existed). Production already refuses it, because the mask goes throughu():The test now asserts that, with a comment stating the encoding is decoder-produced only.
Nit 2 — source absolute values are refused, and now pinned
The PR text said
|v|stays refused but nothing pinned it. The encoder now carries the abs bits, and three cases cover it:Verification
Fail-first, both new control classes fail when the property is broken:
Not in this PR
The reviewer's nit 3 —
v_cndmask_b32_e64 … vcc_loemitting(vcc & 1)— is pre-existing and they flagged it as out of scope; it stays untouched here.AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T18:48:12Z.
Review: COMMENTED
Reviewed at commit
8f333a8a406bfd39d09ba4e756d5218fc7782efd(tests/startup_gfx2hlsl_cndmask_neg_check.py).Code Review
encode_vop2_e64addsabs0/abs1(w0[8]/w0[9]) andneg_mask(w1[31]), matching the VOP3A bit layout decoded bytools/disasm_rdna2.py.abs0=1,abs1=1,abs0=1, abs1=1, andneg_mask=1onv_cndmask_b32_e64.Verification
git diff --check origin/main...HEAD: pass/root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py: pass (Checked 1303 tracked source, script and build/CI files: no bidirectional controls.)/root/.local/share/x2w-rev-venv/bin/python -B tests/startup_gfx2hlsl_cndmask_neg_check.py: pass (22/22 checks,PASS)--preset dev,ctest --preset dev -R '^startup_gfx2hlsl_cndmask_neg$' --parallel 6 --no-tests=error --output-on-failure): 1/1 passed (0.24s:startup_gfx2hlsl_cndmask_neg0.15s)/O2(--preset release,ctest --preset release -R '^startup_gfx2hlsl_cndmask_neg$' --parallel 6 --no-tests=error --output-on-failure): 1/1 passed (0.25s:startup_gfx2hlsl_cndmask_neg0.15s)ops[3]mask throughself.u_src(ops[3])intools/startup/gfx2hlsl.py: faileda negated mask is refused(exit code 1).|...|bars inu_src()intools/startup/gfx2hlsl.py: failed all three absolute-value refusal checks (exit code 1).AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T18:24:06Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
8f333a8ℹ️ 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 ChazY11 on 2026-11-24T18:26:05Z.
Ran it and tried to break each new case
At
8f333a8a, no device needed:Five mutations, each restored afterwards. Every one is caught, and by the case you would expect:
1 << (29 + i)→1 << (28 + i)1 << (30 + i)source == 255dropped from the immediate rangeraise Unsupported('v_cndmask_b32 with %s' % mods)→passu()'sraise Unsupported('operand %r' % tok)→ `return self.u(tok.strip('The last one is the interesting one for this PR: making the integer operand reader quietly strip
|and-fails exactlyan absolute value on the second source is refused,absolute values on both sources are refusedanda negated mask is refused, i.e. the new cases are what stops a modifier from being silently dropped from the emitted text.source == 255being caught means the inline-1boundary is pinned too, which matters because that is the value thedisassembler prints for both plain
-1and1with NEG — the ambiguity the comment in the decoder describes.The encoder change
encode_vop2_e64now takesabs0/abs1/neg_maskand places them at word 0 bits 8/9 and word 1 bit 31. Thosepositions match the VOP3A layout the rest of the file uses (
omodat 27,neg0/neg1at 29/30,clampat 15), so thefixture and the decoder agree on the encoding rather than the fixture being tuned until it passes — which is the failure
mode I look for in a word-level test.
One suggestion, not a blocker
The five new cases come after case 7 with a comment block; the existing cases are numbered through 7 but the new ones are
not number 8+. If the numbering is deliberate for a later group, ignore this.
Verdict
Reviewed
8f333a8a. Every added case is load-bearing against a plausible edit, and the refusal the PR relies on(
u()refusing an unmodelled operand) is covered from both directions. No objections.Notes