-
Notifications
You must be signed in to change notification settings - Fork 473
Fix infinite recursion in E.econd when optimizing nested conditionals #8039
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
base: master
Are you sure you want to change the base?
Conversation
rescript
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
Where's the self contained repro of a few lines? |
|
Can't review without a repro. |
While I understand that request, I can't reproduce it with the problematic code in a single file. I do not know what exactly trigger it, thus it must be some very unique combination. |
Can you reproduce it on the full repo, and reproduce it going away after the fix in this PR? |
|
Yep, I tried to mention this in https://github.com/rescript-lang/rescript/pull/8039/files#diff-e4faf79cc44b60806dfcf3de513d06c907723189948ac3738b02d4939252f523R109-R128 Works for that change but not for v12 stable. |
can you ask the agent to cut down your project little by little until what's left is small and still loops? |
|
We want to make sure that we're not going after a red herring. |
|
I'm able to trim some more in https://github.com/nojaf/rescript-kaplay/tree/minimal-repro It seems related to https://github.com/nojaf/rescript-kaplay/blob/minimal-repro/packages/skirmish/src/Player.res#L12
|
|
Not an infinite loop: see repro The original example is over-engineered, so it took some time to unentangle this. |
cristianoc
left a comment
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.
See repro.
This is a perf issue not an infinite loop issue.
Ideally we want a solution that avoids the problem and does not change any of the current tests (unless there's a good reason to).
There are several ways to go about this, but prompting from a small repro should make this much easier.
So, my project over at nojaf/rescript-kaplay@2f34e58 was hanging this morning.
bsc.exewas in an infinite loop.The LLM and I chatted about this and we found that the problem was an infinite recursion in compiler/core/js_exp_make.ml.
I added the technical context in debug_compiler_hang.md.
@cristianoc could you take a look at this please?
I was not able to reproduce this outside of my own project.
So, this might be a quite specific edge-case 🤔