Skip to content
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

Move backedge analysis here from Revise, add docs, and release 1.0 #30

Merged
merged 9 commits into from
May 26, 2020

Conversation

timholy
Copy link
Member

@timholy timholy commented May 22, 2020

Revise has had "backedge" analysis code for some time. It uses it to restrict the amount of code it needs to interpret in order to discover signatures. Unfortunately, it's been only partly successful, and the recent timholy/Revise.jl#479 demonstrates that small tweaks can lead to big breakage.

This PR rewrites that entire code base and moves it from Revise to here. The old code relied on whole block-level decisions, whereas the new algorithm is granular to the level of individual statements. That means that it is more capable of stepping over lines that "do work" rather than define methods, even when the two are intermixed deep within an @eval (as is the case with AstroBase). I have verified that this, together with a suitably-rewritten Revise to be pushed later, fix (don't close yet) timholy/Revise.jl#479 and seems to make Revise handle a wider variety of tricky code. CC @helgee.

This also adds documentation. As you can see, this is a very large PR, though much of its size comes from splitting the original package up into several source files and adding documentation. Nevertheless the new codeedges file is sizable and bears almost no resemblance to its parent in Revise.

Once merged, I propose we call this the 1.0 release of LoweredCodeUtils.

Unfortunately there seems to be something messed up with my account so I don't have permissions to add the deploy key, we will want to get that figured out.

timholy added 2 commits May 21, 2020 19:03
This package seems like a more natural home. It might be useful in
contexts outside of Revise. In Revise they are a means to an end,
and that's resulted in limited direct testing.

Moving them here also encourages fleshing out the API.
This adds many new utitilies and `show` methods.
Testing is done by checking the selectivity of execution, an easier
but thorough way of examining whether its making the correct decisions.
@codecov-commenter
Copy link

codecov-commenter commented May 22, 2020

Codecov Report

Merging #30 into master will increase coverage by 85.67%.
The diff coverage is 85.50%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #30       +/-   ##
===========================================
+ Coverage    0.00%   85.67%   +85.67%     
===========================================
  Files           1        4        +3     
  Lines         375      691      +316     
===========================================
+ Hits            0      592      +592     
+ Misses        375       99      -276     
Impacted Files Coverage Δ
src/utils.jl 66.66% <66.66%> (ø)
src/codeedges.jl 81.90% <81.90%> (ø)
src/signatures.jl 91.63% <91.63%> (ø)
src/LoweredCodeUtils.jl 95.00% <100.00%> (+95.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a3c0a0b...7db57e9. Read the comment docs.

@KristofferC
Copy link
Member

Unfortunately there seems to be something messed up with my account so I don't have permissions to add the deploy key, we will want to get that figured out.

I see that a deploy key got added today by you.

@timholy
Copy link
Member Author

timholy commented May 22, 2020

Yeah, I don't know what was going on last night.

Once this finishes building there should 🤞 be a preview of the docs at https://juliadebug.github.io/LoweredCodeUtils.jl/previews/PR30/. I think you'll enjoy the "edges" page and especially the selective execution, @KristofferC.

For print_with_code you need JuliaLang/julia#35952.

@KristofferC
Copy link
Member

KristofferC commented May 22, 2020

I think you'll enjoy the "edges" page and especially the selective execution, @KristofferC.

I am sure I will. I am bogged down in a project now so I haven't been able to fully enjoy and experiment with all the new method/code analysis stuff you have made so much progress on. I mean to take a careful look at it in hopefully not too long.

This also fixes some desynchronization problems with the previous
version of the "edges" docs.
timholy added 2 commits May 23, 2020 10:51
Also get rid of an anoymous function to make it more precompile-friendly
@timholy
Copy link
Member Author

timholy commented May 23, 2020

Now with better precompiles, xref JuliaLang/julia#34516 (comment)

@timholy timholy merged commit 00c82ff into master May 26, 2020
@timholy timholy deleted the teh/codedges branch May 26, 2020 12:03
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.

3 participants