Skip to content

OffDiagonal: Use dense broadcast when other arrays take part - #460

Merged
dlfivefifty merged 1 commit into
JuliaArrays:masterfrom
IanButterworth:ib/offdiagonal-array-broadcast
Oct 26, 2026
Merged

dlfivefifty merged 1 commit into
JuliaArrays:masterfrom
IanButterworth:ib/offdiagonal-array-broadcast

Conversation

@IanButterworth

Copy link
Copy Markdown
Contributor

Claude:


Fixes the PkgEval failure of FillArrays on Julia nightly (1.15-DEV), and the OffDiagonal mul failures in ArrayLayouts' tests.

Since JuliaLang/LinearAlgebra.jl#1549, * counts as zero-preserving whatever its other arguments are, so the OffDiagonal broadcasting from #458 sends A .* M (with M a dense array) down the band path. That broadcasts the band against M and throws a DimensionMismatch, or a MethodError when the result is a matrix.

This only takes the band path when every other argument is a scalar or a zero-dimensional array. ArrayLayouts hits it through diag .* O and O .* permutedims(diag) for a non-square OffDiagonal, which the added tests cover.

Written with Claude Code (Opus 5.5).

Newer LinearAlgebra (JuliaLang/LinearAlgebra.jl#1549) treats `*` as zero
preserving whatever its other arguments are, so `A .* M` for an
`OffDiagonal` `A` and a dense `M` took the band path. That path broadcasts
the band against `M` directly, which throws a `DimensionMismatch`. Only
take the band path when every other argument is a scalar or a
zero-dimensional array.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (3f8b7e9) to head (37b38cd).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #460   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           11        11           
  Lines         1316      1393   +77     
=========================================
+ Hits          1316      1393   +77     

☔ 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.

@dlfivefifty
dlfivefifty merged commit bc2dc9b into JuliaArrays:master Oct 26, 2026
28 checks passed
@IanButterworth
IanButterworth deleted the ib/offdiagonal-array-broadcast branch October 26, 2026 14:16
dlfivefifty pushed a commit that referenced this pull request Oct 26, 2026
I'm just opening this to help the process. No urgency, but it would be
good to get this working on PkgEval.

Claude:

---

Bumps the version to 1.18.2 so the unreleased fixes on master get
registered:

- #460: `OffDiagonal` broadcasting with other arrays. Releasing it fixes
the PkgEval failures of FillArrays and ArrayLayouts on Julia nightly
(1.15-DEV), failing since 2026-10-14 after
JuliaLang/LinearAlgebra.jl#1549.
- #459: faster `sparse` for `RectDiagonal` and `OffDiagonal` (no new
API, so a patch release).

Written with Claude Code (Opus 5.5).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants