Adds scripts for computing "pointwise success rate" metrics. For each function, we run the static analysis and rewrite that function in isolation, producing a new .rs file where that function has been rewritten but all other code remains the same. Then we remove the unsafe qualifier from the target function and try to compile the code. The "pointwise success rate" is the number of functions on which this procedure succeeds.
The main entry point is c2rust-analyze/scripts/run_pointwise_metrics_lighttpd.sh (as the name suggests, this is designed to compute the success rate on lighttpd specifically). It uses a few helpers: pointwise_try_build.sh tries to remove unsafe and compile the rewritten code for a specific function, pointwise_try_build_unmodified.sh does the same but on the unmodified, non-rewritten code (used for computing a baseline success rate), and pointwise_metrics.py tallies up the results and prints overall counts.
Adds scripts for computing "pointwise success rate" metrics. For each function, we run the static analysis and rewrite that function in isolation, producing a new
.rs
file where that function has been rewritten but all other code remains the same. Then we remove theunsafe
qualifier from the target function and try to compile the code. The "pointwise success rate" is the number of functions on which this procedure succeeds.The main entry point is
c2rust-analyze/scripts/run_pointwise_metrics_lighttpd.sh
(as the name suggests, this is designed to compute the success rate on lighttpd specifically). It uses a few helpers:pointwise_try_build.sh
tries to removeunsafe
and compile the rewritten code for a specific function,pointwise_try_build_unmodified.sh
does the same but on the unmodified, non-rewritten code (used for computing a baseline success rate), andpointwise_metrics.py
tallies up the results and prints overall counts.Current output on lighttpd:
This PR depends on #1073, which implements the
pointwise
rewrite mode inc2rust-analyze
.