Repository navigation
tests: pin the absolute-value and negated-mask refusals on the select - #1776
Conversation
Review nits on the merged R0Y00#1710: the PR text says a source absolute value stays refused and a negated mask cannot be assembled, but nothing pinned either. The encoder gains the abs bits and the mask negate bit, and the test now asserts that |v30| on either source (and both), and a decoder-produced -s0 mask, are refused. All four spellings are words the decoder produces but llvm-mc rejects, so the property under test is the refusal of the printed operand. Fail-first: routing the mask through u_src fails 'a negated mask is refused'; stripping the abs bars fails 'absolute values on both sources are refused'. 22 checks; startup_gfx2hlsl* dev family and the release test pass.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour 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. |
Ran it and tried to break each new caseAt out/pe-env/Scripts/python.exe -B tests/startup_gfx2hlsl_cndmask_neg_check.pyFive mutations, each restored afterwards. Every one is caught, and by the case you would expect:
The last one is the interesting one for this PR: making the integer operand reader quietly strip
The encoder change
One suggestion, not a blockerThe five new cases come after case 7 with a comment block; the existing cases are numbered through 7 but the new ones are VerdictReviewed Notes
|
tedin7
left a comment
There was a problem hiding this comment.
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.- The four new assertions pin refusals for
abs0=1,abs1=1,abs0=1, abs1=1, andneg_mask=1onv_cndmask_b32_e64. - Clean-room verified; 0 P1 / 0 P2 findings.
Verification
- Linux:
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)
- Win2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
- Debug (
--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) - Release
/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)
- Debug (
- Local mutation checks (reverted after verification):
- Routing
ops[3]mask throughself.u_src(ops[3])intools/startup/gfx2hlsl.py: faileda negated mask is refused(exit code 1). - Stripping
|...|bars inu_src()intools/startup/gfx2hlsl.py: failed all three absolute-value refusal checks (exit code 1).
- Routing
AI-assisted; commands listed were executed locally.
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).