Move isassigned boundscheck to FSA wrapper#188
Open
jakobnissen wants to merge 1 commit into
Open
Conversation
In Base.boundscheck, instead of forwarding boundscheck to the inner vector, do the boundscheck on the wrapper FSA, and then call inner isassigned with @inbounds. This allows correct results for unsafe inner arrays which does not, or cannot boundscheck. In general, it would be preferred for FSA to check indices where possible, since the FSA wrapper "owns" the indices.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #188 +/- ##
==========================================
+ Coverage 92.78% 92.85% +0.06%
==========================================
Files 5 5
Lines 208 210 +2
==========================================
+ Hits 193 195 +2
Misses 15 15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
nsajko
approved these changes
Apr 3, 2026
Member
nsajko
left a comment
There was a problem hiding this comment.
Looking at @code_native, this change does not appear to cause significant changes for the generated code. At least on my platform, Intel AMD64.
Out of courtesy, we should make sure not to commit with a commit message pinging Github user inbounds.
Author
|
Good sentiment, but @inbounds is a dummy GitHub account set up by JuliaLang - see https://github.com/orgs/JuliaLung/people 😄 |
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.
In Base.boundscheck, instead of forwarding boundscheck to the inner vector, do the boundscheck on the wrapper FSA, and then call inner isassigned with @inbounds.
This allows correct results for unsafe inner arrays which does not, or cannot boundscheck.
In general, it would be preferred for FSA to check indices where possible, since the FSA wrapper "owns" the indices.