Skip to content

Conversation

aviatesk
Copy link
Member

@aviatesk aviatesk commented Aug 1, 2025

I looked at all the usage sites of these constructors within the compiler, and fortunately it appears that none of the usage sites require that the return values of these constructors be objects of their respective types. So in cases where LimitedAccuracy is given as a wrapped element, these slot type refinements simply will not be performed.

I looked at all the usage sites of these constructors within the
compiler, and fortunately it appears that none of the usage sites
require that the return values of these constructors be objects of their
respective types. So in cases where `LimitedAccuracy` is given as a
wrapped element, these slot type refinements simply will not be
performed.

- fixes #59004
@aviatesk aviatesk added the backport 1.12 Change should be backported to release-1.12 label Aug 1, 2025
Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

Thanks!

assert_nested_slotwrapper(thentype)
assert_nested_slotwrapper(elsetype)
if thentype isa LimitedAccuracy || elsetype isa LimitedAccuracy
return Bool
Copy link
Member

Choose a reason for hiding this comment

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

Technically this is required to be a LimitedAccuracy(Bool) to prevent caching the bad result (same everywhere in this PR)

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think that's necessary?
Conditional(slot, thentype, elsetype) does not represent the type of slot that can either be thentype or elsetype, but just represents the type of the condition. So I don't think we need to pass along the limited accuracy information coming along with thentype/elsetype.
MustAlias(slot, vartyp, fldidx, fldtyp) represents the type of fldtyp, but if fldtyp is LimitedAccuracy, it's returned unchanged.

Copy link
Member

Choose a reason for hiding this comment

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

LimitedAccuracy also doesn't represent the type of the slot, but rather represents that the computation of it was widened to be incomplete (exactly what happened here)

Copy link
Member Author

Choose a reason for hiding this comment

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

@aviatesk
Copy link
Member Author

aviatesk commented Aug 1, 2025

Ok, I understand.
Then let me merge this PR in its current state for now. This issue has made Revise's CI unusable, so I want to resolve that immediately. I will implement the PR to propagate LimitedAccuracy later.

@aviatesk aviatesk merged commit 9473ef7 into master Aug 1, 2025
9 checks passed
@aviatesk aviatesk deleted the avi/59004 branch August 1, 2025 19:21
aviatesk added a commit that referenced this pull request Aug 1, 2025
I looked at all the usage sites of these constructors within the
compiler, and fortunately it appears that none of the usage sites
require that the return values of these constructors be objects of their
respective types. So in cases where `LimitedAccuracy` is given as a
wrapped element, these slot type refinements simply will not be
performed.

- fixes #59004
@aviatesk aviatesk removed the backport 1.12 Change should be backported to release-1.12 label Aug 1, 2025
aviatesk added a commit that referenced this pull request Aug 1, 2025
According to Jameson's comment, we should propagate `LimitedAccuracy`
information not only when we actually use the type information of
variables that are `LimitedAccuracy`, but also when we perform
computations involving variables that are `LimitedAccuracy`. This commit
implements that propagation in relation to #59182.
aviatesk added a commit that referenced this pull request Aug 2, 2025
According to Jameson's comment, we should propagate `LimitedAccuracy`
information not only when we actually use the type information of
variables that are `LimitedAccuracy`, but also when we perform
computations involving variables that are `LimitedAccuracy`. This commit
implements that propagation in relation to #59182.
KristofferC pushed a commit that referenced this pull request Sep 5, 2025
I looked at all the usage sites of these constructors within the
compiler, and fortunately it appears that none of the usage sites
require that the return values of these constructors be objects of their
respective types. So in cases where `LimitedAccuracy` is given as a
wrapped element, these slot type refinements simply will not be
performed.

- fixes #59004
@nickrobinson251
Copy link
Contributor

I just ran into #59004 (on 1.12.0-rc1) -- i don't see this on the rc2 backport branch (#59337) and it doesn't have the backport 1.12 label anymore -- should this have the label so it gets backported? cc @KristofferC @aviatesk

@KristofferC KristofferC added the backport 1.12 Change should be backported to release-1.12 label Sep 5, 2025
@KristofferC
Copy link
Member

KristofferC commented Sep 5, 2025

It's already on release-1.12 (but a new RC has not been cut), this is the commit 962ca50. You can use 1.12-nightly to get it on juliaup.

@KristofferC KristofferC removed the backport 1.12 Change should be backported to release-1.12 label Sep 5, 2025
KristofferC pushed a commit that referenced this pull request Sep 15, 2025
I looked at all the usage sites of these constructors within the
compiler, and fortunately it appears that none of the usage sites
require that the return values of these constructors be objects of their
respective types. So in cases where `LimitedAccuracy` is given as a
wrapped element, these slot type refinements simply will not be
performed.

- fixes #59004
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.

Type inference: Encountered unexpected error in runtime

4 participants