Skip to content

Test Int16 reductions whose map overflows - #674

Merged
maleadt merged 1 commit into
mainfrom
tb/int16-reduction
Oct 8, 2026
Merged

maleadt merged 1 commit into
mainfrom
tb/int16-reduction

Conversation

@maleadt

@maleadt maleadt commented Oct 8, 2026

Copy link
Copy Markdown
Member

Adds a regression test for #670. IGC before libigc_jll 2.34.4+2 left the result of a 16-bit mad in the accumulator at full width, so the signed sel implementing max compared the unwrapped value. This produced wrong results on TGL and DG2.

The fix is in IGC (intel/intel-graphics-compiler#449), backported in JuliaPackaging/Yggdrasil#15030 and registered as libigc_jll 2.34.4+2 (JuliaRegistries/General#170943). NEO_jll already pins libigc_jll 2.34.4, and compat can't name a build number, so this needs no compat change.

On Iris Xe, the test fails with 2.34.4+1 and passes with 2.34.4+2. The full test suite passes locally with +2.

Fixes #670.

IGC before libigc_jll 2.34.4+2 left 16-bit mad results in the accumulator
at full width, so a signed max compared the unwrapped value and returned
wrong results on TGL and DG2. Fixes #670.
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Your PR requires formatting changes to meet the project's style guidelines.
Please consider running Runic (git runic main) to apply these changes.

Click here to view the suggested changes.
diff --git a/test/array.jl b/test/array.jl
index f671a75..ca26cc6 100644
--- a/test/array.jl
+++ b/test/array.jl
@@ -197,9 +197,11 @@ end
 @testset "narrow integer reduction with overflowing map" begin
     # IGC < 2.34.4+2 kept the result of a 16-bit `mad` in the accumulator at full width, so
     # the signed `max` compared the unwrapped value (JuliaGPU/oneAPI.jl#670, TGL and DG2).
-    A = Complex{Int16}[22264-2672im -3184-13367im 20267+16808im -29600+21497im;
-                       -2+6036im -13334-32552im -4391+23096im 1804+13481im;
-                       -19764+32524im 20734-5522im 30645+17973im 21749-26470im]
+    A = Complex{Int16}[
+        22264 - 2672im -3184 - 13367im 20267 + 16808im -29600 + 21497im;
+        -2 + 6036im -13334 - 32552im -4391 + 23096im 1804 + 13481im;
+        -19764 + 32524im 20734 - 5522im 30645 + 17973im 21749 - 26470im
+    ]
     mk = A -> view(permutedims(A), [1, 2, 3, 4], :)
     R = Base.mapreducedim!(abs2, max, zeros(Int16, 1, 3), mk(A))
     dR = Base.mapreducedim!(abs2, max, oneArray(zeros(Int16, 1, 3)), mk(oneArray(A)))

@codecov

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.76%. Comparing base (4352038) to head (fe5bc3d).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #674      +/-   ##
==========================================
- Coverage   81.12%   80.76%   -0.37%     
==========================================
  Files          57       56       -1     
  Lines        4121     4101      -20     
==========================================
- Hits         3343     3312      -31     
- Misses        778      789      +11     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maleadt
maleadt merged commit b0ace13 into main Oct 8, 2026
4 checks passed
@maleadt
maleadt deleted the tb/int16-reduction branch October 8, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong results for overflowing Int16 arithmetic in a reduction kernel

1 participant