-
Notifications
You must be signed in to change notification settings - Fork 43
Make Cthulhu cache CodeInstance
-based, continued
#628
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
Although these code paths don’t seem to be used very often.
…voke-codeinstance
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 2.17 #628 +/- ##
======================================
Coverage ? 0.00%
======================================
Files ? 11
Lines ? 1642
Branches ? 0
======================================
Hits ? 0
Misses ? 1642
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
https://github.com/serenity4/cthulhu.jl/blob/d3ff8213541262ec36f08052b15844a44fefe4b1/src/codeview.jl#L336-L395
Do you think we could refactor this part to use CodeInstance
for lookups instead of MethodInstance
? It looks like it might let us get rid of get_mi
completely.
But this add_callsites!
function is only used by an experimental feature in VSCode. So, if it seems too hard or would need a bigger refactoring, it's totally fine to leave it as it is and half-supported.
Good point, I'll take a look 👍 |
When I handed this PR over to you, I felt that completing it would require a more extensive refactoring than the commits you added (the refactoring to split Cthulhu into the UI part and the That said, looking at this code, it seems like most Cthulhu features are probably supported on this PR, so I think it's okay to proceed as is for now. |
That may have been |
Other than that, I don't see major obstacles to use |
c1573d9
to
0ae8e07
Compare
Implemented in 0ae8e07, now we no longer need to define Tests for the VSCode integration were disabled and I had forgotten to update that part which was still failing. Now it seems to be working alright (at least when I quickly tested it manually), will probably need further testing by uncommenting the relevant testsets but that can be done later.
I haven't managed to identify the exact cause beyond the fact that Other than that, unless you have other requests before we merge this should be ready. |
Yeah, I think it's totally fine to change it that way. Eager inference might add a small performance hit to code with task constructs, but Cthulhu's performance doesn't need to be super optimized anyway. Whatever's easiest to deal with is good.
This issue sounds a bit serious. Does this only happen with inference performed from |
My mistake, The issue is apparently that, in the cache, we store a |
I can suggest having a separate data structure in |
Does this issue only happen for |
It only happens there as far as I am aware, yes. I use the following reproducer: using Cthulhu
f() = Base.sum
@descend f() # then descend into `Base.sum` with VSCode integration settings on
I implemented a proof of concept here, this will hopefully better communicate what I meant: 844e6f4 This commit successfully addresses the case above, but I can revert it if you prefer another approach; that was mainly to explore whether that might work in practice. |
Okay, I understand the situation. Currently, the Cthulhu cache uses A more general refactoring idea would be to stop using However, this feature isn't Cthulhu's main focus, and it's experimental anyway, so I'll leave it up to you to decide how to proceed. |
844e6f4
to
8d2b4fb
Compare
Thanks for the clarifications. Thinking about it, I don't really like the idea of adding a field to |
I merged #619, and also updated the |
Yeah, that also sounds reasonable. Let's move ahead with it. |
Do you mean release 2.17 for 1.12 only? I thought this PR would have to drop support for 1.10/1.11. |
Yeah, that's the plan. In v1.11, the inference cache uses Starting with v1.12, we want to move forward with development based on this refactoring. After v1.12 is officially released, we'll stop supporting v1.11. The we'll merge the |
Sounds good! I updated the project and CI versions to use 1.12+ (for Cthulhu only). |
After this is merged to |
Thanks for moving this PR forward! |
* adjust to JuliaLang/julia#54899 Although these code paths don’t seem to be used very often. * Update test/irutils.jl * wip: make Cthulhu cache `CodeInstance`-based * Small fixes * Fix tests * Handle Const wrapper * Use CodeInstance for Bookmark, fix Cthulhu tests * Add invokelatest around binding access * Minor cleanup * Remove special-casing for intermediate 1.12-DEV version * Get rid of `get_mi`, eagerly infer `CodeInstance` for task calls * Don't explore const-proped/semi-concrete evaled callsites * Fix version checks for 1.12-nightly * Comment out CI for Julia versions = '1' * Raise Julia compatibility requirement to 1.12 * Run IntegrationTest on 1.12-nightly --------- Co-authored-by: Shuhei Kadowaki <aviatesk@gmail.com> Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Co-authored-by: Cédric Belmant <cedric.belmant@juliahub.com>
That's great. Please carry on. |
Continues the work started in #614.
Tests are passing locally, this is ready for review.