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

Closed
github-bot wants to merge 1 commit from gh-pr/2696/head into gh-pr/2696/base
Owner

@⁠tedin7 on GitHub · 2026-11-26 02:22 UTC · original
tedin7:fix/scalar-arity-control-mul-hi → main · +10 −8 · 1 files · 1 commits · closed without merging

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.

**@⁠tedin7** on GitHub · 2026-11-26 02:22 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2696) `tedin7:fix/scalar-arity-control-mul-hi` → `main` · +10 −8 · 1 files · 1 commits · closed without merging 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.
#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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:15:40 +00:00
github-bot closed this pull request 2026-11-27 01:15:40 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 02:26 UTC · original

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.

**@⁠tedin7** on GitHub · 2026-11-26 02:26 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2696#issuecomment-7180814587) 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

This discussion has been locked. Commenting is limited to contributors.
No description provided.