Skip to content

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Feb 26, 2025

Recompute some O(n) things a bit less on every statement. Fix an assert that ensured LimitedAccuracy does not accidentally get preserved when it should have been deleted: the (local) cache should not contain things that are marked as dead (RIP), as that was leading to much code not getting cached when it logically should have. Simplify the computation of frame_parent when the cycle_parent isn't needed.

Recompute some O(n) things a bit less on every statement. Fix an assert
that ensured LimitedAccuracy does not accidentally get preserved when it
should have been deleted: the (local) cache should not contain things
that are marked as dead (RIP), as that was leading to much code not
getting cached when it logically should have. Simplify the computation
of frame_parent when the cycle_parent isn't needed.
@vtjnash vtjnash added compiler:inference Type inference backport 1.12 Change should be backported to release-1.12 labels Feb 26, 2025
nargtypes = length(given_argtypes)
for cached_result in cache
cached_result.linfo === mi || @goto next_cache
cached_result.tombstone && continue # ignore deleted entries (due to LimitedAccuracy)
Copy link
Member Author

Choose a reason for hiding this comment

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

FWIW: this is the bugfix, the rest is various improvements of various sorts

n.b. the LimitedAccuracy object does not need to contain a Set anymore, since all of the nodes now have a frameid::Int, which is reliable and strongly ordered, so we could now build the lattice over the frameid value instead, which may be much simpler.

@vtjnash vtjnash merged commit 0366a2a into master Feb 27, 2025
9 checks passed
@vtjnash vtjnash deleted the jn/cycle_fix_limited branch February 27, 2025 16:18
@oscardssmith oscardssmith added the bugfix This change fixes an existing bug label Feb 27, 2025
serenity4 added a commit to serenity4/Cthulhu.jl that referenced this pull request Feb 28, 2025
serenity4 added a commit to serenity4/Cthulhu.jl that referenced this pull request Feb 28, 2025
KristofferC pushed a commit that referenced this pull request Mar 3, 2025
Recompute some O(n) things a bit less on every statement. Fix an assert
that ensured LimitedAccuracy does not accidentally get preserved when it
should have been deleted: the (local) cache should not contain things
that are marked as dead (RIP), as that was leading to much code not
getting cached when it logically should have. Simplify the computation
of frame_parent when the cycle_parent isn't needed.

(cherry picked from commit 0366a2a)
aviatesk pushed a commit to JuliaDebug/Cthulhu.jl that referenced this pull request Mar 3, 2025
* Adapt to JuliaLang/julia#57545

* Adapt to JuliaLang/julia#57545

* Fixes

* Bump version

* Add tighter version checks

* Revert accidental edit

* Simplify version checks

---------

Co-authored-by: Cédric Belmant <cedric.belmant@juliahub.com>
frames = sv.callstack::Vector{AbsIntState}
causes = typ.causes
for frameid = cycleid:length(frames)
caller = frames[frameid]::InferenceState
Copy link
Member

Choose a reason for hiding this comment

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

this throws BoundsError, #57634

@KristofferC KristofferC removed the backport 1.12 Change should be backported to release-1.12 label Mar 24, 2025
serenity4 pushed a commit to serenity4/julia that referenced this pull request May 1, 2025
Recompute some O(n) things a bit less on every statement. Fix an assert
that ensured LimitedAccuracy does not accidentally get preserved when it
should have been deleted: the (local) cache should not contain things
that are marked as dead (RIP), as that was leading to much code not
getting cached when it logically should have. Simplify the computation
of frame_parent when the cycle_parent isn't needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This change fixes an existing bug compiler:inference Type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants