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

Add an option to not emit unionsplit fallback blocks #43923

Merged
merged 1 commit into from
Feb 9, 2022

Conversation

Keno
Copy link
Member

@Keno Keno commented Jan 25, 2022

When union splitting, we currently emit a fallback block that prints
fatal error in type inference (type bound). This has always been an oddity,
because there are plenty of other places in the compiler that we
rely on the correctness of inference, but it has caught a number of
issues over the years and we do still have a few issues (e.g. #43064)
that show this error. Nevertheless, the occurrence of issues like
this has become less frequent, so it might be time to turn it off soon.
At the same time, we have downstream users of the compiler infrastructure
that get confused by having extra throw calls inserted into functions
that (post-#43852) were inferred as :nothrow.

Here we add an optimization param (defaulted to on) to determine whether
or not to insert the unionsplit fallback block. Because of the conservative
default, we can decide later what the correct default is (maybe turn it on
in debug mode?), while letting downstream consumers play with the setting
for now to see if any issues crop up.

@vtjnash
Copy link
Member

vtjnash commented Jan 26, 2022

This can close #43138, and we should revert #40564 also now

@Keno
Copy link
Member Author

Keno commented Jan 27, 2022

Well, the default here is still to emit the fallback block. It seems risky to turn that off while we still have open issues that trigger it, but yes, once that default is flipped that would fix said issues.

@vtjnash
Copy link
Member

vtjnash commented Jan 27, 2022

Seems okay to flip it. There will always be known bugs.

When union splitting, we currently emit a fallback block that prints
`fatal error in type inference (type bound)`. This has always been an oddity,
because there are plenty of other places in the compiler that we
rely on the correctness of inference, but it has caught a number of
issues over the years and we do still have a few issues (e.g. #43064)
that show this error. Nevertheless, the occurrence of issues like
this has become less frequent, so it might be time to turn it off soon.
At the same time, we have downstream users of the compiler infrastructure
that get confused by having extra `throw` calls inserted into functions
that (post-#43852) were inferred as `:nothrow`.

Here we add an optimization param (defaulted to on) to determine whether
or not to insert the unionsplit fallback block. Because of the conservative
default, we can decide later what the correct default is (maybe turn it on
in `debug` mode?), while letting downstream consumers play with the setting
for now to see if any issues crop up.
@Keno
Copy link
Member Author

Keno commented Feb 8, 2022

Discussed with @JeffBezanson and we continue to be uncomfortable with flipping this given the open bugs, so I'm gonna rebase and merge the switch and then we can have further discussion on a separate PR on whether or not to flip the switch.

@Keno Keno force-pushed the kf/unionsplitfallback branch from b53fc41 to 8b8e338 Compare February 8, 2022 21:36
@vtjnash
Copy link
Member

vtjnash commented Feb 8, 2022

Aww, but it requires so much extra state to add this option, and it would be great to be able to get to eliminate it

@Keno Keno merged commit 2118a08 into master Feb 9, 2022
@Keno Keno deleted the kf/unionsplitfallback branch February 9, 2022 11:19
@mcabbott mcabbott mentioned this pull request Feb 9, 2022
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this pull request Feb 17, 2022
When union splitting, we currently emit a fallback block that prints
`fatal error in type inference (type bound)`. This has always been an oddity,
because there are plenty of other places in the compiler that we
rely on the correctness of inference, but it has caught a number of
issues over the years and we do still have a few issues (e.g. JuliaLang#43064)
that show this error. Nevertheless, the occurrence of issues like
this has become less frequent, so it might be time to turn it off soon.
At the same time, we have downstream users of the compiler infrastructure
that get confused by having extra `throw` calls inserted into functions
that (post-JuliaLang#43852) were inferred as `:nothrow`.

Here we add an optimization param (defaulted to on) to determine whether
or not to insert the unionsplit fallback block. Because of the conservative
default, we can decide later what the correct default is (maybe turn it on
in `debug` mode?), while letting downstream consumers play with the setting
for now to see if any issues crop up.
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
When union splitting, we currently emit a fallback block that prints
`fatal error in type inference (type bound)`. This has always been an oddity,
because there are plenty of other places in the compiler that we
rely on the correctness of inference, but it has caught a number of
issues over the years and we do still have a few issues (e.g. JuliaLang#43064)
that show this error. Nevertheless, the occurrence of issues like
this has become less frequent, so it might be time to turn it off soon.
At the same time, we have downstream users of the compiler infrastructure
that get confused by having extra `throw` calls inserted into functions
that (post-JuliaLang#43852) were inferred as `:nothrow`.

Here we add an optimization param (defaulted to on) to determine whether
or not to insert the unionsplit fallback block. Because of the conservative
default, we can decide later what the correct default is (maybe turn it on
in `debug` mode?), while letting downstream consumers play with the setting
for now to see if any issues crop up.
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
When union splitting, we currently emit a fallback block that prints
`fatal error in type inference (type bound)`. This has always been an oddity,
because there are plenty of other places in the compiler that we
rely on the correctness of inference, but it has caught a number of
issues over the years and we do still have a few issues (e.g. JuliaLang#43064)
that show this error. Nevertheless, the occurrence of issues like
this has become less frequent, so it might be time to turn it off soon.
At the same time, we have downstream users of the compiler infrastructure
that get confused by having extra `throw` calls inserted into functions
that (post-JuliaLang#43852) were inferred as `:nothrow`.

Here we add an optimization param (defaulted to on) to determine whether
or not to insert the unionsplit fallback block. Because of the conservative
default, we can decide later what the correct default is (maybe turn it on
in `debug` mode?), while letting downstream consumers play with the setting
for now to see if any issues crop up.
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.

2 participants