Skip to content

Conversation

@aviatesk
Copy link
Member

Starting from v1.12.1, the implementation of isconst/getglobal became more accurate, and when called in a generator's world that was defined before the target method table, it now correctly determines that the method table is not yet defined.

So, from v1.12 onwards, it seems necessary to use functions like [getglobal|isconst]_at_world as implemented here. This might be something that should be provided by Base itself though.

Starting from v1.12.1, the implementation of `isconst/getglobal` became
more accurate, and when called in a generator's world that was defined
before the target method table, it now correctly determines that the
method table is not yet defined.

So, from v1.12 onwards, it seems necessary to use functions like
`[getglobal|isconst]_at_world` as implemented here. This might be
something that should be provided by Base itself though.
@aviatesk aviatesk requested a review from Keno November 12, 2025 19:38
@Keno
Copy link
Member

Keno commented Nov 12, 2025

This should look at the world validity bounds of the binding and merge those into the world bounds of the returned CodeInfo.

@aviatesk
Copy link
Member Author

What do you think on a3e583d?

@Keno
Copy link
Member

Keno commented Nov 12, 2025

Looks reasonable, though as a general comment, it looks like we may be missing the world bounds constraint and the forward edge for the method we're looking up? We fixed a lot of the correctness around this in 1.12, so very possible it just wasn't feasibly to write this correctly before.

@aviatesk
Copy link
Member Author

Are you saying we should also include the generator's own world age itself? I think I still don't understand which world age we're missing.

@Keno
Copy link
Member

Keno commented Nov 12, 2025

We're missing the worldage of the method table query of the signature we're overlaying and the corresponding forward edge (but that can be a separate PR).

@aviatesk
Copy link
Member Author

Ah, I see. I can work on that in a separate PR.

@aviatesk aviatesk merged commit ba7c4f4 into master Nov 13, 2025
16 of 17 checks passed
@aviatesk aviatesk deleted the avi/fix-world-age-error branch November 13, 2025 15:34
aviatesk added a commit that referenced this pull request Nov 13, 2025
This implements feedback from the GitHub issue comment at
#66 (comment).

Specifically, we now use the world age from method matches by directly
utilizing `Base.Compiler.findall`. However, the updated tests pass even
without this change, which suggests there may be issues with the test
coverage.
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