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

rm reconstruction of cached reports, just force inference on "errorne… #38

Merged
merged 3 commits into from
Sep 22, 2020

Conversation

aviatesk
Copy link
Owner

@aviatesk aviatesk commented Sep 21, 2020

…ous" frames

  • previous "cache clean up" logic potentially throws away true positive
    errors, while we need that to surpress false positives that can be
    revealed by constant propagation
  • this commit removes the whole reconstructions of cached reports, and
    just force inference on those "erronesout" MethodInstances by
    returning default fallback value to CC.get(tpc::TPCache, mi::MethodInstance, default)
  • as a result, those "erronesous" frames will always re-run inference and
    so constant propagation will reveal false/true positives whatever it's cached
    (just because it ignores the cache)
  • this may slow down abstract interpretation performance, but cache ignorance
    is only done partially and so hopefully performance won't get so worse (I hope)
  • at the cost of that, this will simplify the whole code a lot and also resolves
    the previous problems of cache clean up of true positive reports

@codecov-commenter
Copy link

codecov-commenter commented Sep 21, 2020

Codecov Report

❗ No coverage uploaded for pull request base (avi/constantpropagation@094f632). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@                    Coverage Diff                     @@
##             avi/constantpropagation      #38   +/-   ##
==========================================================
  Coverage                           ?   85.77%           
==========================================================
  Files                              ?        9           
  Lines                              ?      689           
  Branches                           ?        0           
==========================================================
  Hits                               ?      591           
  Misses                             ?       98           
  Partials                           ?        0           
Flag Coverage Δ
#unittests 85.77% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.


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 094f632...6f9d360. Read the comment docs.

@aviatesk
Copy link
Owner Author

ah, it turns out the cache invalidation can really slow down profiling on really-world code, e.g.:

using TypeProfiler, StatsPlots

@time @profile_call rand(100)
@time @profile_call density(rand(100))

will take 350 secs from (previously) 15 secs

…ous" frames

- previous "cache clean up" logic potentially throws away true positive 
errors, while we need that to surpress false positives that can be 
revealed by constant propagation
- this commit removes the whole reconstructions of cached reports, and 
just force inference on those "erronesout" `MethodInstance`s by 
returning `default` fallback value to `CC.get(tpc::TPCache, 
mi::MethodInstance, default)`
- as a result, those "erronesous" frames will always re-run inference 
and
so constant propagation will reveal false/true positives whatever it's 
cached
(just because it ignores the cache)
- this may slow down abstract interpretation performance, but cache 
ignorance
is only done partially and so hopefully performance won't get so worse 
(I hope)
- at the cost of that, this will simplify the whole code **a lot** and 
also resolves
the previous problems of cache clean up of true positive reports
@aviatesk
Copy link
Owner Author

Now above example finishes within 15 secs, which isn't worse than previous implementation at least.

the test failure seems unrelated to this PR, going to merge

@aviatesk aviatesk merged commit f952af4 into avi/constantpropagation Sep 22, 2020
@aviatesk aviatesk deleted the avi/nocache branch September 22, 2020 06:52
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