goblint / bench

The benchmark suite
4 stars 5 forks source link

FFmpeg #18

Open michael-schwarz opened 2 years ago

michael-schwarz commented 2 years ago

FFmpeg (https://github.com/FFmpeg/FFmpeg)

michael-schwarz commented 2 years ago

A first run on these benchmarks (merging of inlines enabled) is thoroughly disappointing:

sim642 commented 2 years ago
  • We seem to produce so many warnings that trying to write them out in json produces a stack overflow in List.map

We should use BatList.map whereever we have possibly large lists. That is implemented using constant stack (and without reversal!), unlike Stdlib.List.map, which is just naive.

michael-schwarz commented 2 years ago

The stackoverflow happens inside

      Yojson.Safe.pretty_to_channel ~std:true out json

(at https://github.com/goblint/analyzer/blob/36a5c5d20e75c06c979a46996c202ed7384ec0ef/src/framework/analyses.ml#L278). So just using BatList.map would not cut it as the call happens inside a library. But I guess this a problem for the future once we actually manage to analyze FFmpeg and get meaningful results.

sim642 commented 2 years ago

The stackoverflow happens inside

      Yojson.Safe.pretty_to_channel ~std:true out json

(at https://github.com/goblint/analyzer/blob/36a5c5d20e75c06c979a46996c202ed7384ec0ef/src/framework/analyses.ml#L278). So just using BateList.map would not cut it as the call happens inside a library.

Do you have a full stack trace of where inside the library? Might be worth reporting or fixing.

Other than that, maybe it's just specific to pretty_to_channel. Could be that the minimal output of to_channel doesn't suffer from the same issue.

michael-schwarz commented 2 years ago

I ran another run with the fix for non privatization and ctx insens base:

Timings:
TOTAL                          106.970 s
  parse                          47.924 s
  convert to CIL                 59.046 s
  analysis                        0.000 s
    makeCFG                         2.077 s
    connect                         4.217 s
    global_inits                   268.657 s
    solving                        99596.327 s
      S.Dom.equal                     5.553 s
      postsolver                     1454.500 s
    warn_global                     1.611 s
      access                          1.500 s
Timing used
Memory statistics: total=203083937.10MB, max=35359.30MB, minor=203055616.41MB, major=3504974.32MB, promoted=3476653.63MB
    minor collections=96826212  major collections=462 compactions=0

So we land at around 27h and 35GB of RAM here. We once again have the issue with the stackoverflow inside the json-messages output.

Another observation is that global inits is now a lot faster, presumably because of small local states?

Also what is a little disturbing is that despite all of this and the analysis now taking considerably longer, most code is still dead (it dead in fact not change at all):

Found dead code on 393400 lines (including 392979 in uncalled functions)!
Total lines (logical LoC): 410495