Skip to content

Pass through nothing strides#1610

Closed
nhz2 wants to merge 3 commits into
JuliaLang:masterfrom
nhz2:nz/fix-strides
Closed

Pass through nothing strides#1610
nhz2 wants to merge 3 commits into
JuliaLang:masterfrom
nhz2:nz/fix-strides

Conversation

@nhz2

@nhz2 nhz2 commented May 18, 2026

Copy link
Copy Markdown
Member

Companion PR to JuliaLang/julia#61807

That PR changes strides to return nothing on non-strided arrays instead of throwing an error.

This PR changes strides of Adjoint and Transpose to pass through nothing if strides(parent) is nothing.

This PR should be merged before JuliaLang/julia#61807 is.

Comment thread src/adjtrans.jl
function Base.strides(A::Adjoint{<:Real, <:AbstractVector})
st = strides(A.parent)
isnothing(st) && return nothing
(st[1]*Int(length(A.parent)), st[1])

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

st[1]*Int(length(A.parent)) should match stride(A.parent, 2) since the parent is an abstract vector: https://github.com/JuliaLang/julia/blob/201e056e9ee2398f01ecd2f104f9d8000b04d195/base/abstractarray.jl#L602

JuliaLang/julia#30432 has this return (1, st[1]). The first stride should not get used, so in theory its value shouldn't matter.

@codecov

codecov Bot commented May 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.37%. Comparing base (81a3a0d) to head (2ce35a1).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1610      +/-   ##
==========================================
- Coverage   94.39%   94.37%   -0.03%     
==========================================
  Files          35       35              
  Lines       16050    16062      +12     
==========================================
+ Hits        15151    15159       +8     
- Misses        899      903       +4     

☔ View full report in Codecov by Sentry.
📢 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.

@stevengj stevengj added the speculative Whether the change will be implemented is speculative label May 18, 2026
@stevengj

Copy link
Copy Markdown
Member

Needs to wait on whether JuliaLang/julia#61807 is accepted.

@nhz2 nhz2 marked this pull request as draft May 18, 2026 16:14
@nhz2 nhz2 marked this pull request as ready for review May 18, 2026 19:01
@nhz2 nhz2 closed this Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

speculative Whether the change will be implemented is speculative

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants