tests: native_sdwa_f16 checks and native_cvt_pk_u8_hardware fail on main #3052
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#3052
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@pigalot on GitHub · 2026-11-27 11:51 UTC · original
Three native compute tests fail on
main1c879506(and on98007de5). There are two separate causes.Environment: Windows 11 Pro 10.0.26200, NVIDIA GeForce RTX 5090 (driver 32.0.16.1088), dev preset with the debug layer on.
native_sdwa_f16_ir(0, 'add', '0xa55a4200', '0xa55a4200')native_sdwa_f16_hardwarenative_cvt_pk_u8_controlsnative_cvt_pk_u8_hardware[(8, '0xa5a5a501', '0xa5a5a500'), (24, …), (40, …), …]Pull-request CI runs only the
prsmoke preset, and the full-E '_hardware$'run onmainhas been cancelled by later pushes. That may be why the IR failure was not seen.1.
native_sdwa_f16_*: the shared comparator now requiresHI_AThis does not depend on the GPU.
native_sdwa_f16_iruses no device.Case.matches()intests/native_sdwa_f16_check.pypasses the extracted 16-bit half tonative_f16_alu_check.same_half.f6cdee10) changedsame_halfto requiregot >> 16 == HI_A >> 16(0xabcd), because the non-SDWA forms now keep D[31:16].same_halfreturns False for every SDWA case, even when the word is identical to the expected one.high=parameter) innative_f16_alu_check.py, used bynative_sdwa_f16_check.py. That keeps #3020's stricter check for the non-SDWA forms.2.
native_cvt_pk_u8_hardware: literal 0.5 becomes 1 on this driver0.5as av_mov_b32literal, select 0. The reference expects 0 (ties to even); the GPU returns 1.compile_dxilemits keeps the operation:bitcast→FMin(36) with 255.0 →Round_ne(26) →fptoui, with no folding.A scratch run of the same program (not committed) compared two sources:
v_cvt_f32_u32 v1, v0thenv_mul_f32 v1, 0.5, v1, so 0.5 × lane, computed at run time0.5Round_ne(0.5)(orfptoui(Round_ne(0.5))) to 1. That is a hypothesis: I have not looked at the driver's ISA and have not run this on AMD or WARP.startup_gfx2hlsl_cvt_pk_u8_hardware,compute_store_aot_alu_cvt_pk_u8_hardware,pixel_aot_rndne_hardwareandstartup_gfx2hlsl_float_round_hardware, pass on this GPU. With a literal,dxcprobably foldsround(0.5)itself, so the driver never sees it.Possible directions; the choice is for the maintainers:
I'd rather not change the expected value, since RDNA 2 was measured as ties-to-even.
I can send a PR for part 1 if that helps. This issue was AI-assisted.
@akimfomin on GitHub · 2026-11-27 12:05 UTC · original
pigalot’s literal-versus-lane comparison leaves the expected tie unchanged. PortBridge found an independent reference in AnyPS5 #501: their gfx1035-tested SPIR-V path expresses ties-to-even with an explicit integer/fraction check. An independently written CPU check of that arithmetic matched an exact decimal oracle on 10,776 binary32 inputs, including every positive half tie below 255 and its two neighbors.
The next useful control is your existing DXIL test with both literal and lane-derived 0.5 on AMD and WARP. I added exact inputs and reporting to PortBridge Lab #121. If a freshly written integer/fraction lowering is tried, verify the emitted operations as well as the readback because optimization might restore the rounding intrinsic. The AnyPS5 code and hardware results belong to that team. This reference does not establish the NVIDIA cause or a DXIL fix.
@R0Y00 on GitHub · 2026-11-27 12:07 UTC · original
Part 1 landed in #3053. Independent check for part 2 on
main35f7197e:native_cvt_pk_u8_check.py controls <compile_dxil> <sdk>passed andhardware <native_store_replay> <sdk>failed with the same first mismatch in Debug and Release/O2on RTX 4060 Laptop (driver 32.0.16.1656, Windows 11 26200.9974, SDK 10.0.26100, native fixture debug layer off). Word 8 was0xa5a5a501, expected0xa5a5a500; the shown mismatches repeat every 16 words. This reproduces literal 0.5 on another NVIDIA adapter. The expected tie-to-even value stays 0. I did not measure the AMD/WARP literal-versus-lane control.@RonLogic on GitHub · 2026-11-27 12:58 UTC · original
I reproduced the packed-U8 failure independently on an RTX 4070 at
fca7c35b: Release readback first differs at word 8 (0xa5a5a501, expected0xa5a5a500). I’ll take the direct compute follow-up and test an integer lowering of the measured ties-even conversion against both literal and lane-derived inputs. The SDWA comparator work from #3053 is separate.@R0Y00 on GitHub · 2026-11-27 13:32 UTC · original
The direct packed-U8 fix merged in #3058 (
246857e4); #3053 already fixed the SDWA comparator. In independent Debug and Release/O2tests on the RTX 4060 Laptop, both the literal and lane-derived packed-U8 replays now matched all 2,064 words, including guards. The related HLSL WARP tests also passed. Native AMD and the original RTX 5090 report are still useful confirmations. If you can rerun the four original entries on that RTX 5090, please post the exact main commit and result.@lambirou on GitHub · 2026-11-27 17:04 UTC · original
Independent Windows receipt for the fixes on
main2641cc72.Windows build 10.0.26300.10075, AMD Radeon RX 9060 XT (driver 32.0.32029.2010), D3D12 debug layer not enabled.
4/4 passed, no skips:
native_sdwa_f16_ir: 17 results and 10 refusals.native_cvt_pk_u8_controls: literal and lane-derived programs compiled without Round_ne or fptoui; negated source refused; the three references differ.native_sdwa_f16_hardware: 34 results and 2030 guards.native_cvt_pk_u8_hardware: literal and lane-derived replays matched all 2064 words (1024 results, guards and sentinels).A second adapter and driver confirm the merged #3053/#3058 fix.
@akimfomin on GitHub · 2026-11-27 17:52 UTC · original
One more independent hardware result for #3058. jstrdev ran the two synthetic packed-U8 checks on a physical Intel Arc B580 at
246857e4593880fbc19ab18eb1d4a56ba8370ad6, Windows Debug, driver 32.0.101.9175. Both passed with zero skips, and both literal and lane-derived readbacks matched all 2,064 words. jstrdev’s report and controlsThe run also exposed a test setup gap on multi-GPU machines. At that revision native_store_replay.cpp opens the default device. The
XBOX2WINDOWS_ADAPTERsetting is handled by the shared test helper, which this runner doesn't use. jstrdev independently checked that the default was the B580 for the recorded run. Printing the selected adapter LUID would make future receipts unambiguous, even when DXGI lists several adapters with identical names. PortBridge coordinated the independent run.@RonLogic on GitHub · 2026-11-27 18:56 UTC · original
I reproduced the adapter-selection gap raised in the Arc report. On Windows 11 and RTX 4070, a
native_store_replaybinary built from the same runner source asmain88cddb09still completed both packed-U8 dispatches withXBOX2WINDOWS_ADAPTER='no adapter has this name'. I’ll take this test-runner follow-up: honor an explicit adapter filter, reject an unmatched filter before dispatch, and print the actual device’s adapter identity and LUID for hardware reports.@Leyukaka on GitHub · 2026-11-29 03:07 UTC · original
Both causes are fixed on
main: #3053 (d6457679) for thenative_sdwa_f16_*comparator and #3058 (246857e4) fornative_cvt_pk_u8_hardware. The adapter filter gap raised above is fixed by #3157 (5fc9f6ff). The four original entries passed 4/4 on RX 9060 XT at2641cc72(above); the packed-U8 replays were also reported passing on RTX 4060 Laptop and Arc B580.native_sdwa_f16_irandnative_cvt_pk_u8_controlspass in both Windows jobs ofmainrun 46194701708 (0614f68c); that run is red on five other tests. The RTX 5090 rerun asked for on 11-27 has not been posted. Close now, or wait for it?