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

Small tweak for Julia 1.12 world age change #128

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

Keno
Copy link
Contributor

@Keno Keno commented Nov 20, 2024

Julia 1.12 will clean up when implicit world age increments happen. In particular, there will no longer be implicit increments within the same statement at toplevel. However, we are likely retaining implicit increments before each statement within @testset. This PR makes a small rearrangements to be compatible with this change. See JuliaLang/julia#56509.

Julia 1.12 will clean up when implicit world age increments happen.
In particular, there will no longer be implicit increments within
the same statement at toplevel. However, we are likely retaining
implicit increments before each statement within @testset. This
PR makes a small rearrangements to be compatible with this change.
See JuliaLang/julia#56509.
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.35%. Comparing base (b70e247) to head (e56d18e).
Report is 7 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #128   +/-   ##
=======================================
  Coverage   67.35%   67.35%           
=======================================
  Files          21       21           
  Lines         729      729           
=======================================
  Hits          491      491           
  Misses        238      238           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@THinnerichs THinnerichs self-assigned this Nov 22, 2024
@THinnerichs
Copy link
Member

Hey @Keno, thanks for pointing that out. Sorry for the naive questions, but does that only affect @testset?
We do quite some Julia magic with eval(..) ( see e.g.

check = :(eval($mod.$super) <: HerbSearch.ProgramIterator ||
)
and I am not sure what the difference to the fixed @testsets is.

@Keno
Copy link
Contributor Author

Keno commented Nov 22, 2024

Hey @Keno, thanks for pointing that out. Sorry for the naive questions, but does that only affect @testset?

It's not specific to @testset. The current situation is:

statement1(#= Maybe World Age Increment =#; statement2());
#= Maybe World Age Increment =# statement3();

The Maybe here is a problem, because it's unpredictable and depends on whether we're running in the interpreter or the compiler. 1.12 gives it definite semantics, which are:

At toplevel:

statement1(#= No World Age Increment =#; statement2());
#= Yes World Age Increment =# statement3();

Within begin/end at top level:

being
statement1(#= No World Age Increment =#; statement2());
#= No World Age Increment =# statement3();
end

but @testset goes back to pretending it's toplevel:

@testset being
statement1(#= No World Age Increment =#; statement2());
#= Yes World Age Increment =# statement3();
end

Which is why despite being inside a begin/end block, just making it separate statements is sufficient for getting the implicit increment. You can also always get an explicit increment with @Core.latestworld. This is all at toplevel of course. Both pre- and post- 1.12, there's never an implicit world age increment in local scope.

That said, tests passed with just the changes in this PR. You are correct that if you want to observe the return of the eval inside the :block you linked within the same top-level statement, you need an explicit world-age increment afterwards. Since I didn't see it break, I'm assuming you're not relying on that. My suggestion would be to let the 1.12 changes shake out a bit further and if you notice any world-age related issues in practice, let me know and we can take a look at whether there's any further changes required.

@ReubenJ ReubenJ self-requested a review December 2, 2024 06:52
@ReubenJ ReubenJ merged commit c4c6deb into Herb-AI:master Dec 4, 2024
5 checks passed
@ReubenJ
Copy link
Member

ReubenJ commented Dec 4, 2024

Thanks @Keno for making all of these PRs related to the change—much appreciated!

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