Skip to content

Restore type-stable StridedView construction on Julia 1.10 - #60

Merged
lkdvos merged 4 commits into
mainfrom
ld-normalize-inference
Oct 13, 2026
Merged

lkdvos merged 4 commits into
mainfrom
ld-normalize-inference

Conversation

@lkdvos

@lkdvos lkdvos commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

#58 added a normalize::Bool = true keyword to the StridedView constructors, with an early return for normalize = false. The two branches produce different parent types (Matrix as given vs the normalized Vector), and Julia 1.10 does not constant-fold the keyword, so even StridedView(::Matrix) infers as a Union there. This breaks the @inferred broadcast tests of Strided.jl on Julia 1.10 (QuantumKitHub/Strided.jl#93).

This replaces the keyword by a public (unexported) unsafe_stridedview(T, parent, size, strides, offset, op) that skips normalization, used at all former normalize = false call sites, and adds an @inferred(StridedView(A)) test. Removing the keyword is technically an API change, but it was only exposed in v0.5.4, so this is released as v0.5.5.

Checked on Julia 1.10.12: the StridedViews tests pass, and Strided's othertests.jl passes against this branch.

🤖 Generated with Claude Code

lkdvos and others added 2 commits October 12, 2026 16:46
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lkdvos

lkdvos commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

This is clearly less nice, but I do think it is worth it to fix the type stability regression on 1.10...

@lkdvos
lkdvos requested a review from Jutho October 12, 2026 21:06
Comment thread src/stridedview.jl Outdated
lkdvos and others added 2 commits October 13, 2026 09:12
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lkdvos
lkdvos merged commit c33f6f1 into main Oct 13, 2026
6 of 10 checks passed
@lkdvos
lkdvos deleted the ld-normalize-inference branch October 13, 2026 16:34
@codecov

codecov Bot commented Oct 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 58.33333% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/stridedview.jl 58.33% 5 Missing ⚠️
Files with missing lines Coverage Δ
src/StridedViews.jl 100.00% <ø> (ø)
src/stridedview.jl 29.94% <58.33%> (+0.42%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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