-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Log a backtrace on entrance to type inference #58124
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
Conversation
I have a weak preference for this over option 1. |
I like this one better too. |
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.
I am neutral between these PR, as they seem to express entirely different operations (first-dispatch vs first-infer) which may occur at different times in different places. The one thing that must occur before merging though is adding a lock around them (c.f. jl_push_newly_inferred
for possible inspiration, as it seems to be fairly common that we need a primitive "locked array push" similar to that)
d8cd21c
to
39d9e56
Compare
This is needed to eliminate the `Core.Compiler.Timings` module while still keeping SnoopCompile working.
Can you write a few devdocs on the intended behavior of this, just especially so we can make sure it keeps working with that behavior? Is there a reason it use CI instead of MI? It looks like we could put the calls themselves in C (in jl_type_infer) as well to keep things a bit more self-contained |
7e5508a
to
0da5143
Compare
Done. The real link is SnoopCompile, specifically JuliaDebug/SnoopCompile.jl#419. SnoopCompileCore is the only place this I don't know whether you need more detail than I provided. The test should keep things working. I added a comment that indicates the purpose of the test, to prevent someone from concluding that it doesn't seem to be used anywhere and just deleting that test.
Not really. I just went with CI since the trend has been to use CI in logs rather than MI. Happy to switch if you'd prefer it.
I once tried to figure out how to collect the backtrace from C, and that looked a lot harder. If I can get both, then sure, moving it makes sense. But the two have to be linked, so I don't see much advantage in getting one from C and the other from Julia when this already seems pretty non-intrusive to me. |
Bump. I'll be on vacation for two weeks starting next week. It would be really nice to get this merged, so we can get rc2 out, so I can start directing users to test timholy/Revise.jl#894 |
a4913ca
to
3c3d955
Compare
(cherry picked from commit fc0017f)
(cherry picked from commit fc0017f)
(cherry picked from commit fc0017f)
This is needed to eliminate the
Core.Compiler.Timings
module while still keeping SnoopCompile working.This is one mechanism to add a backtrace to each entrance to inference. An alternative approach is presented in #58123. Only one of these should be merged.