Skip to content

Refactor: extend cache transforms to store OptimizedSource#638

Draft
serenity4 wants to merge 4 commits intoJuliaDebug:masterfrom
serenity4:use-cache-transforms
Draft

Refactor: extend cache transforms to store OptimizedSource#638
serenity4 wants to merge 4 commits intoJuliaDebug:masterfrom
serenity4:use-cache-transforms

Conversation

@serenity4
Copy link
Copy Markdown
Collaborator

It seems that using the transform_result_for_cache and transform_result_for_local_cache mechanisms, we don't need to override finish! anymore.

Therefore, we now have:

  • CC.finishinfer! to store inferred, unoptimized sources (InferredSource)
  • CC.transform_result_for_cache and CC.transform_result_for_local_cache to store inferred, optimized sources (OptimizedSource)

Comment on lines +134 to +138
function CC.transform_result_for_cache(interp::CthulhuInterpreter, result::InferenceResult, edges::Core.SimpleVector)
if isa(result.src, CodeInfo)
result.src.edges = edges
end
result.src = CC.transform_result_for_local_cache(interp, result)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aviatesk do you know if it is safe to discard edges for OptimizationState? My understanding is that edges anyways come from opt.inlining.edges, so the structure already has them, but before that we used to take the OptimizationState -> CodeInfo path and attach edges to the resulting CodeInfo.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 11, 2025

Codecov Report

❌ Patch coverage is 0% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (2c33b9a) to head (1d76074).
⚠️ Report is 86 commits behind head on master.

Files with missing lines Patch % Lines
src/interpreter.jl 0.00% 21 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master    #638   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files           9      11    +2     
  Lines        1556    1547    -9     
======================================
+ Misses       1556    1547    -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@serenity4
Copy link
Copy Markdown
Collaborator Author

Whoops, I may have been to eager to get rid of finish! to keep support for 1.12+ 👀 will add that back behind a version check.

Comment on lines +1 to +3
using Cthulhu: CTHULHU_MODULE
const Cthulhu = CTHULHU_MODULE[]
const CC = Cthulhu.CC
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's to ensure that we can do using Compiler and have tests switch to using the extension module and keep working.

@serenity4
Copy link
Copy Markdown
Collaborator Author

Marking as draft for now, there will be upcoming refactors to related functions in Compiler.

@serenity4 serenity4 self-assigned this Apr 14, 2025
@serenity4 serenity4 marked this pull request as draft April 14, 2025 10:51
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