You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Verification time increased by 7X on an s2n-quic harness #1693
T-High PriorityTag issues that have high priorityT-UserTag user issues / requests[C] BugThis is a bug. Something isn't working.[E] PerformanceTrack performance improvement (Time / Memory / CPU)
Noticed today that s2n-quic's vectored_copy_fuzz_test harness takes 30 minutes to prove, even though a few weeks ago, it only took 4 minutes. The culprit commit turned out to be ab0f2ad from Aug 18. With this commit, it takes 30 minutes, but with the previous commit (8b1d18c), it takes 4 minutes.
Rewinding back to this commit and changing those two codegen_assert_assume to codegen_assert bring the time down to 4 minutes. However, making those two changes off of more recent commits (e.g. 1f40c65), only brings down the time from 60 minutes to 30 minutes.
We tried introducing a temporary variable for the condition that is then used in the assert and assume, but that didn't make a difference.
07092de (30 minutes to 60 minutes): The rust toolchain update included a change in niche optimization, which is likely the cause of the performance regression.
I had to disable reachability checks though (--no-assertion-reach-checks) because of #1962. However, even if I disable them but use the default SAT solver, it takes close to an hour:
T-High PriorityTag issues that have high priorityT-UserTag user issues / requests[C] BugThis is a bug. Something isn't working.[E] PerformanceTrack performance improvement (Time / Memory / CPU)
Activity
zhassan-aws commentedon Sep 19, 2022
@tedinski, any ideas what may have caused the performance slowdown in ab0f2ad?
tedinski commentedon Sep 19, 2022
That PR turned
assertintoassert-assume. Normally we'd think of it as pruning branches, and so I'd assume it'd improve performance if anything.But perhaps it's complicating the state with new assumptions along the paths it does follow.
zhassan-aws commentedon Nov 10, 2022
Summarizing the current status of the investigation:
There are at least a couple of commits that contributed to the increase in verification time:
assumeintrinsic:ab0f2ad#diff-77bb4928612d2e4c4cd8a6ff43124d05f89d423aaa128656e5a9635dd01e2648R443
and
codegen_offset:ab0f2ad#diff-77bb4928612d2e4c4cd8a6ff43124d05f89d423aaa128656e5a9635dd01e2648R1060
Rewinding back to this commit and changing those two
codegen_assert_assumetocodegen_assertbring the time down to 4 minutes. However, making those two changes off of more recent commits (e.g. 1f40c65), only brings down the time from 60 minutes to 30 minutes.We tried introducing a temporary variable for the condition that is then used in the assert and assume, but that didn't make a difference.
zhassan-aws commentedon Dec 21, 2022
With kissat, this harness completes in ~1 minute:
I had to disable reachability checks though (
--no-assertion-reach-checks) because of #1962. However, even if I disable them but use the default SAT solver, it takes close to an hour:zhassan-aws commentedon Feb 15, 2023
@tautschnig These are the current results with 9439a54 and with CBMC diffblue/cbmc@42d5ce2 built with MiniSAT 2 and CaDiCaL.
With MiniSAT:
With CaDiCaL:
With Kissat:
So CaDiCaL is indeed slightly faster.
All results can be reproduced by doing
cd tests/perf/s2n-quic/quic/s2n-quic-coreand running the specified command.tautschnig commentedon Aug 18, 2023
Resolving with following rationale: