tests: assert the expected count in the four hand-written operand refusals #2506
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!2506
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2506/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?
@ChazY11 on GitHub · 2026-11-25 18:52 UTC · original
ChazY11:startup/valu-arity-message→main· +26 −4 · 1 files · 1 commits · merged 2026-11-25 19:11 UTCWhat
The four handlers
#2396guards by hand keep their operand count in a literal message(
"... with N operands, expected 3"), while theVEC_F/VEC_Utables derive it from the arity. The refusal censusprints that text, so a literal that drifted from the condition raising it would be published to the reader as the
requirement.
The fixture asserted only that a refusal happens, not what it says. This PR adds the text assertion.
Evidence
Mutating the message in the merged code, before and after this change:
tools/startup/gfx2hlsl.pys_bfm_b32 ... expected 3→expected 4v_cvt_i32_f32 ... expected 2→expected 3v_cndmask_b32 ... expected 3 or 4→expected 3v_mov_b32 ... expected 2→expected 1Negative control and the vacuous-pass guard
v_cndmask_b32accepts a fourth operand, so the "too many" side does not refuse and has no message to check. Theassertion therefore runs only where a refusal actually occurs, and a separate check pins that the short side always
does — otherwise the loop would pass vacuously for a handler whose guard stopped firing on the short side too.
Scope
Test-only. The guards, every accepted form and the accepted operand counts are unchanged. One reviewable behaviour:
the refusal text is part of what the fixture checks.
AI-assisted. Tested on Windows 11 build 26300.9974; the check is in the platform-independent list, so it also runs on
the Linux job.
@MasterDomino on GitHub · 2026-11-25 19:11 UTC · original · approved these changes
Approved at head
dff7ade3, a rebase ofc6c3462dwith a byte-identical test file; I re-ran everything below atdff7ade3. The change is test-only:tests/startup_gfx2hlsl_operand_count_check.pynow asserts the refusal text for the four handlers whose expected operand count is a literal.Commands executed (Windows 11 build 26300, Python 3.13)
dff7ade3:operand count checks: 0 failed.main, so this run is also the merged result.Negative control
I mutated each literal message in
tools/startup/gfx2hlsl.pyone at a time, ranmain's copy of the check and this PR's, then reverted:mainchecks_bfm_b32 … expected 3changed toexpected 4v_cvt_i32_f32 … expected 2changed toexpected 3v_cndmask_b32 … expected 3 or 4changed toexpected 3v_mov_b32 … expected 2changed toexpected 1This matches the description. The separate short-side check also keeps the
v_cndmask_b32loop from passing vacuously.Merge checks: required CI passed at this head. The
/O2and coverage skips come from explicit workflow conditions. There are no review threads.AI-assisted; commands listed were executed locally.