Skip to content

Resolve sub_materialize ambiguity for Fill layouts with infinite axes - #254

Merged
dlfivefifty merged 2 commits into
masterfrom
fill-sub_materialize-ambiguity
Nov 13, 2026
Merged

dlfivefifty merged 2 commits into
masterfrom
fill-sub_materialize-ambiguity

Conversation

@dlfivefifty

Copy link
Copy Markdown
Member

Taking an infinite view of a blocked Ones/Zeros/Fill currently throws an ambiguity error:

julia> b = BlockedVector(Ones(∞), Ones{Int}(∞));

julia> b[2:∞]
ERROR: MethodError: sub_materialize(::ArrayLayouts.OnesLayout, ::SubArray{...}, ::Tuple{InfiniteArrays.OneToInf{Int64}}) is ambiguous.

Candidates:
    sub_materialize(::ArrayLayouts.OnesLayout, V, ax)
      @ ArrayLayouts src/memorylayout.jl:551
    sub_materialize(::Any, V, ::Tuple{InfAxes})
      @ InfiniteArrays src/infarrays.jl:427

This PR adds sub_materialize methods for AbstractFillLayout, ZerosLayout and OnesLayout with each of the infinite-axis tuples (Tuple{InfAxes}, Tuple{InfAxes,InfAxes}, Tuple{Any,InfAxes}, Tuple{InfAxes,Any}). They return a Fill/Zeros/Ones with the view's axes, which stays lazy, so b[2:∞] isa Ones{Float64,1,Tuple{OneToInf{Int}}}.

Tests for vectors and matrices (with infinite rows, columns, or both) are added to test/test_infblock.jl. The full test suite, including Aqua, passes locally.

🤖 Generated with Claude Code

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

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.32%. Comparing base (7300dce) to head (c01e69a).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #254      +/-   ##
==========================================
+ Coverage   91.19%   91.32%   +0.12%     
==========================================
  Files          12       12              
  Lines        1363     1383      +20     
==========================================
+ Hits         1243     1263      +20     
  Misses        120      120              

☔ 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 de9db7a into master Nov 13, 2026
16 checks passed
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.

1 participant