recomp: omod on f64 and f32/f16 conversions, integer clamp on unsigned/packed adds and dots #119
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!119
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/119/head"
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?
@gefydev on GitHub · 2026-11-23 13:20 UTC · original
gefydev:recomp-clamp-omod→main· +152 −6 · 2 files · 1 commits · closed without merging#105 item 4.
Dropped before this change:
v_cvt_f32_f64andv_cvt_f16_f32;v_add_nc_u32,v_sub_nc_u32,v_subrev_nc_u32,v_add3_u32,v_pk_add/sub_u16,v_pk_add/sub_i16,v_pk_mad_u16/i16,v_dot2_{i32_i16,u32_u16},v_dot4_{i32_i8,u32_u8}andv_dot8_{i32_i4,u32_u4}. These wrapped instead.One point of the audit was wrong: f64 clamp did not narrow to float. DXIL has a double
Saturate, and the test confirms clamp keeps double precision on main. So that part is not changed.Notes:
v_cvt_f16_f32applies the modifiers in f32 before the rounding. The f16 is the same except where it is denormal.sat_u32, next tosat_i32. No-Gis(per #73).Test
gpu_clamp_and_omod_per_instruction: every changed instruction once, with values that saturate. The non-clamp forms of an add, a packed add and a dot are controls that must still wrap. Without the emit change it fails (first atv_add_f64omod). With it, it passes on a GTX 1650 under Wine (vkd3d-proton), and so do the other lib tests that run there. Not run on AMD.The f64 VALU path, v_cvt_f32_f64 and v_cvt_f16_f32 dropped omod (and the two conversions dropped clamp too). Integer clamp (saturation) was handled only on v_add_nc_i32 / v_sub_nc_i32; v_add_nc_u32, v_sub_nc_u32, v_subrev_nc_u32, v_add3_u32, v_pk_{add,sub}_{u16,i16}, v_pk_mad_{u16,i16} and the integer dot products wrapped instead. f64 clamp already kept double precision (DXIL has a double saturate), so it stays. v_cvt_f16_f32 applies the modifiers in f32 before rounding: the same f16 except where it is denormal. Test gpu_clamp_and_omod_per_instruction: every changed instruction, with the non-clamp forms of an add, a packed add and a dot as a control.@ivall on GitHub · 2026-11-23 14:14 UTC · original
Merged. It conflicted with
fdeacf0, which made the plainv_dot4*SM 6.4 intrinsics (dot4add_i8packed/dot4add_u8packed, for FSR4). Your clamped forms keepdot4_u8/dot4_i8(c4df2fe): written with the intrinsic,(int64_t)dot4add_i8packed(a, b, 0)gave DXC an internal compiler error. Your test passes on the RX 9070. Checked on Windows 11 with an RX 9070 (RDNA4), merged together with the rest of #110–#129:cargo test --workspacegreen with the retail samples (shader pack, console DLLs, texture archive), lib tests also withXCL_SPLIT_WAVE64=1; the retail pack still translates 26 698 / 26 698; the FSR4 GPU probe passes; Unicorn Overlord and XDefiant run. Thanks!@ivall on GitHub · 2026-11-23 14:15 UTC · original
Closing by hand: your rebase (
28caa63) landed while I merged the earlier head (34efd81, merge73c7bbeonmain), so GitHub doesn't see it as merged. The content is in. One difference: the rebase writes the clamped 8-bit dots as(int64_t)dot4add_i8packed(a, b, 0)/(uint64_t)dot4add_u8packed(a, b, 0u)- that exact form gave DXC (Windows SDK 10.0.26100) an internal compiler error ingpu_clamp_and_omod_per_instruction, somainkeeps yourdot4_i8/dot4_u8helpers there (c4df2fe).Pull request closed