tests: compare SDWA binary16 halves without the kept high half #3053
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3053"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-27T11:55:15Z.
Refs #3052 (part 1, the two
native_sdwa_f16_*failures). Part 2,native_cvt_pk_u8_hardware, is a separate cause and is not touched here.Change
#3020 made
native_f16_alu_check.same_halfrequire the keptHI_Ain bits 31:16 of the stored word.native_sdwa_f16_check.Case.matches()passes it the selected half, already shifted down to 16 bits. So since #3020 every SDWA case has failed, including words equal to the expected one, e.g.(0, 'add', '0xa55a4200', '0xa55a4200').same_binary16intests/native_f16_alu_check.py.same_halfcalls it after itsHI_Acheck, so the non-SDWA check is unchanged.native_sdwa_f16_check.pycalls it directly. Its bits outside the selected half were already compared exactly.check_mutantsnow requires every expected word to match itself. Without that, a comparator that rejects everything satisfied all three mutant asserts.Only test code changes.
Verification
maineff2dd7aplus this change. Windows 11 Pro 10.0.26200, NVIDIA GeForce RTX 5090 (driver 32.0.16.1088), dev preset with the debug layer on.native_f16_alu_ir82 results match the model; 16 refusals carry the named diagnosticnative_f16_alu_hardware164 words matched the model, high half keptnative_sdwa_f16_ir17 results and 10 refusals(failed onmain)native_sdwa_f16_hardware34 results and 2030 guards(failed onmain)same_halfnative_sdwa_f16_irfails at the newassert all(case.matches(case.want) ...)same_binary16returns True for any halfnative_sdwa_f16_irfails at thesrc1word-swap mutant assertChecklist
This change was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T12:06:28Z.
Review: APPROVED
Reviewed
4ea1b554withmain35f7197e(integration tree69466018). The source-only comparator fix preserves exact bits outside the selected half and the existing non-SDWA high-half check. I reproduced the equal-word assertion (a55a4200vsa55a4200) on clean main in both IR and GPU modes. With this patch, both modes ofnative_f16_alu_check.pyandnative_sdwa_f16_check.pypassed in Debug and Release /O2 using runtime binaries from that main tree. SDWA matched 17 IR results and 10 refusals, and 34 hardware results plus 2,030 guards. The non-SDWA check still matched 82 IR and 164 GPU results. A separate comparator check rejected the accept-all and reject-all mutants and confirmed NaN handling, signed zero and 16-bit bounds. Windows 11 26200.9974, SDK 10.0.26100, RTX 4060 Laptop driver 32.0.16.1656, native replay debug layer off. The unrelatednative_cvt_pk_u8_hardwareremains tracked in #3052.