Repository navigation
Preserve parent alias checks for StridedViews - #57
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 3 files with indirect coverage changes 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
StridedViewcurrently relies on the defaultBase.mightaliascheck over its parents'dataids. When two dense parents share an allocation but occupy disjoint ranges, that loses any more precise alias check supplied by the parent array type. This blocks buffer-backed JLArray contractions in QuantumKitHub/TensorOperations.jl#310 even after the dense JLArray check is fixed in JuliaGPU/GPUArrays.jl#803.Specialize
Base.mightalias(::StridedView, ::StridedView)to delegate to the dense parents, with an explicit empty-view guard. Disjoint parents prove their views are disjoint; overlapping parents remain conservatively classified as potentially aliasing. Keepdataidsunchanged for other wrapper combinations.Validation on Julia 1.13.1: five assertions in the existing JLArrays testset check that self-aliasing, disjoint parents, and overlapping parents preserve JLArrays' alias result, plus empty views in both argument orders. They pass with released JLArrays 0.3.3 / GPUArrays 11.5.16 and with GPUArrays #803 applied. Comparing against the parent result keeps the tests compatible with the current release while detecting lost byte-range precision once the JLArrays specialization is available. With this change and GPUArrays #803 applied in the TensorOperations test process, all 219 original allocator assertions pass, including the four failing tensor-network cases. Files pass Runic formatting.