Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that :boundscheck is properly handled #177

Merged
merged 1 commit into from
Jun 29, 2023
Merged

Conversation

staticfloat
Copy link
Collaborator

My previous fix was incorrect because :boundscheck returns a Bool. Let's just force it to true for now, which implicitly disables @inbounds, which is probably a good idea for us since we haven't gone through the effort of ensuring that all indexing is still valid. Add tests for this so that we catch this breakage faster next time.

My previous fix was incorrect because `:boundscheck` returns a `Bool`.
Let's just force it to `true` for now, which implicitly disables
`@inbounds`, which is probably a good idea for us since we haven't gone
through the effort of ensuring that all indexing is still valid.
Add tests for this so that we catch this breakage faster next time.
let var"'" = Diffractor.PrimeDerivativeFwd
@test_throws BoundsError foo_errors'(1.0) == 1.0
end
Copy link
Member

Choose a reason for hiding this comment

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

you might want to add a test of a function with @inbounds that has a chain rule with invalid indexing.

@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Patch coverage: 66.66% and project coverage change: +0.08 🎉

Comparison is base (801ff96) 52.29% compared to head (4924411) 52.38%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #177      +/-   ##
==========================================
+ Coverage   52.29%   52.38%   +0.08%     
==========================================
  Files          27       27              
  Lines        2719     2722       +3     
==========================================
+ Hits         1422     1426       +4     
+ Misses       1297     1296       -1     
Impacted Files Coverage Δ
src/codegen/forward.jl 92.77% <50.00%> (-1.06%) ⬇️
src/codegen/reverse.jl 92.90% <100.00%> (+0.01%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Keno Keno merged commit ea2e9f5 into main Jun 29, 2023
6 checks passed
@oscardssmith oscardssmith deleted the sf/ignore_boundscheck_exprs branch June 30, 2023 00:00
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.

3 participants