Skip to content

test: count the s_mul_hi templates in the scalar arity control - #2696

Closed
tedin7 wants to merge 1 commit into
R0Y00:mainfrom
tedin7:fix/scalar-arity-control-mul-hi
Closed

tedin7 wants to merge 1 commit into
R0Y00:mainfrom
tedin7:fix/scalar-arity-control-mul-hi

Conversation

@tedin7

@tedin7 tedin7 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

Part of #1723
What this unblocks: main passes startup_gfx2hlsl_scalar_table_arity_check again, so Win2025 runs for every shader PR stop failing on this check.

What

#2405 gave s_mul_hi_u32 and s_mul_hi_i32 their own operand-count refusal (... expected 3). The negative control in tests/startup_gfx2hlsl_scalar_table_arity_check.py (from #2515) removes the generic len(srcs) < needed guard and expects every two-source template except one (s_bfm_b32) to raise IndexError. Now three templates refuse by themselves, so on main the control reports MISMATCH 37 of 40 and the check exits 1.

This PR names the templates that keep their own arity check (OWN_ARITY = {s_bfm_b32, s_mul_hi_u32, s_mul_hi_i32}). The control now asserts that exactly the other templates raise IndexError, and that the named ones still refuse with their own message. Only the test changes. tools/startup/gfx2hlsl.py is untouched.

Verification

Linux:

  • git checkout origin/main (e76f8acd5): python3 tests/startup_gfx2hlsl_scalar_table_arity_check.py gives 1 failed (control ... MISMATCH 37 of 40). The same check passes on f27737c36 (the commit before startup: lower v_mul_hi_i32 and s_mul_hi_i32 in gfx2hlsl #2405) and fails on 6d92f2a8f (startup: lower v_mul_hi_i32 and s_mul_hi_i32 in gfx2hlsl #2405).
  • This branch: python3 tests/startup_gfx2hlsl_scalar_table_arity_check.py gives 0 failed.
  • Mutation: replace if base in ('s_mul_hi_u32', 's_mul_hi_i32') and len(srcs) != 2: with if False: in tools/startup/gfx2hlsl.py. The check then fails 2 (extra ['s_mul_hi_i32', 's_mul_hi_u32']). The change was reverted afterwards.
  • python3 tests/startup_gfx2hlsl_mul_hi_i32_check.py: ok. git diff --check: clean.

Win2025: not run yet (Draft). This is a pure-Python check with no arguments, so it runs in the Windows Python-check step.

AI-assisted; commands listed were executed locally.

… themselves

R0Y00#2405 added an operand-count refusal to s_mul_hi_u32 and s_mul_hi_i32, so the arity control's single exception (s_bfm_b32) no longer holds and main fails startup_gfx2hlsl_scalar_table_arity_check. Name the three self-checking templates and assert the rest still raise IndexError without the generic guard.
@tedin7

tedin7 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded: #2659 (merged as ad1ad19) carries the same arity-control fix (c8e0537). python3 tests/startup_gfx2hlsl_scalar_table_arity_check.py on main ad1ad19: 0 failed. Closing this draft.

AI-assisted; commands listed were executed locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant