Repository navigation
Avoid boxed captured variables, and test for them - #749
Merged
Merged
Conversation
`trim_pools!` assigned `empty` both outside and inside its `do` block, and `profile_internally` captured `t_start`, which is assigned inside a `try`. Both were stored in a `Core.Box` and lost their type.
Use `Test.detect_closure_boxes`, available on Julia 1.14 and later.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #749 +/- ##
==========================================
- Coverage 86.77% 86.64% -0.14%
==========================================
Files 55 55
Lines 5065 5008 -57
==========================================
- Hits 4395 4339 -56
+ Misses 670 669 -1 ☔ View full report in Codecov by Harness. 🚀 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.
Test.detect_closure_boxes(Julia 1.14+) reports two methods whose lowered code allocates aCore.Box:trim_pools!:emptywas assigned both by thedoblock's result and inside the block. The outer variable is now namedslabs.profile_internally: the localsecondsclosure capturedt_start, which is assigned inside atry. It is nowBase.Fix2(relative_seconds, t_start).This also adds a
closure boxestestsuite entry covering oneAPI and its KernelAbstractions extension. It only runs on Julia 1.14+, so on CI only the nightly job (branch builds) runs it.