test: count the s_mul_hi templates in the scalar arity control #2688

Closed
tedin7 wants to merge 1 commit from upstream-pr/2696 into main
tedin7 commented 2026-11-26 02:22:05 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T02:22:05Z.


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 #2405) and fails on 6d92f2a8f (#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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6618117921 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2696). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T02:22:05Z. --- 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 #2405) and fails on `6d92f2a8f` (#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.
upstream-sync closed this pull request 2026-11-26 03:03:14 +00:00
tedin7 commented 2026-11-26 03:03:22 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T02:26:59Z.


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

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7180814587 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2696#issuecomment-7180814587). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T02:26:59Z. --- Superseded: #2659 (merged as ad1ad194a) carries the same arity-control fix (c8e05375). `python3 tests/startup_gfx2hlsl_scalar_table_arity_check.py` on main ad1ad194a: 0 failed. Closing this draft. AI-assisted; commands listed were executed locally.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!2688
No description provided.