Skip to content

Conversation

@aviatesk
Copy link
Member

@aviatesk aviatesk commented Feb 28, 2023

Since we allow overloading of the bail_out_xxx hooks, we need to make
sure that we widen both type and effects to the top when bailing on
inference regardless of the condition presumed by a hook.

This commit particularly fixes the correctness of bail_out_apply
(fixes #48807). I wanted to make a simplified test case for this, but
it turns out to be a bit tricky since it relies on the details of
multiple match analysis and the bail out logic.

@aviatesk aviatesk requested a review from Keno February 28, 2023 15:31
@aviatesk aviatesk added the backport 1.9 Change should be backported to release-1.9 label Feb 28, 2023
@aviatesk
Copy link
Member Author

Added the 1.9 backport label since this is somewhat critical fix on our effects system and so should be fixed even if the original issue doesn't happen on 1.9.

@aviatesk aviatesk changed the title effects: widen effects when bailing out from _apply_iterate inference: fix the correctness of inference bail out interface Mar 1, 2023
Since we allow overloading of the `bail_out_xxx` hooks, we need to make
sure that we widen both type and effects to the top when bailing on
inference regardless of the condition presumed by a hook.

This commit particularly fixes the correctness of `bail_out_apply`
(fixes #48807). I wanted to make a simplified test case for this, but
it turns out to be a bit tricky since it relies on the details of
multiple match analysis and the bail out logic.
@aviatesk
Copy link
Member Author

aviatesk commented Mar 1, 2023

@nanosoldier runbenchmarks("inference", vs=":master")

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - no performance regressions were detected. A full report can be found here.

@aviatesk aviatesk merged commit 533a094 into master Mar 1, 2023
@aviatesk aviatesk deleted the avi/48807 branch March 1, 2023 06:37
aviatesk added a commit that referenced this pull request Mar 1, 2023
Since we allow overloading of the `bail_out_xxx` hooks, we need to make
sure that we widen both type and effects to the top when bailing on
inference regardless of the condition presumed by a hook.

This commit particularly fixes the correctness of `bail_out_apply`
(fixes #48807). I wanted to make a simplified test case for this, but
it turns out to be a bit tricky since it relies on the details of
multiple match analysis and the bail out logic.
@aviatesk aviatesk removed the backport 1.9 Change should be backported to release-1.9 label Mar 1, 2023
@aviatesk aviatesk mentioned this pull request Mar 1, 2023
50 tasks
KristofferC pushed a commit that referenced this pull request Mar 3, 2023
Since we allow overloading of the `bail_out_xxx` hooks, we need to make
sure that we widen both type and effects to the top when bailing on
inference regardless of the condition presumed by a hook.

This commit particularly fixes the correctness of `bail_out_apply`
(fixes #48807). I wanted to make a simplified test case for this, but
it turns out to be a bit tricky since it relies on the details of
multiple match analysis and the bail out logic.
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.

Side-effectful foreach callback mysteriously eliminated on nightly (miscompilation?)

4 participants