-
Notifications
You must be signed in to change notification settings - Fork 206
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
fix: iterative unification #6540
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, seems like we have one last failing test with the inliner though. Wondering if we should just move to iterative unification for all the types? Perhaps this is better for a followup though.
It looks good to me, we just need to figure out that last arithmetic generics failure. |
It was due to the changes for constant terms during unification. I tried to fix this but it was still failing so I end up using the previous recursive code for this case. |
Is there a good testcase we can add that would break the old type unification code? |
How long is this expected to take now? I ran it for 2:12 before halting it because it was taking too long - it didn't finish monomorphization by that point. Comparing to master, master lasts 1:12 for me before stack overflowing |
For me on the mainframe it run successfully in around 4 minutes (in debug mode) |
I agree it is better to avoir the large binding chain in the first place, but having iterative version is still an improvement over the recursive one. |
I don't think the iterative version is an improvement since we shouldn't have types large enough for a stack overflow now, and the iterative version is longer, more difficult to follow, and clones types on each intermediate step. |
Description
Problem*
Resolves #6457
Summary*
Makes iterative version of:
Additional Context
In the issue, the problem was due to unification during elaboration and check type during monomorphisation. So type conversion was not failing.
Convert and check type are made iterative only for type variables because the issue is happening with them.
Documentation*
Check one:
PR Checklist*
cargo fmt
on default settings.