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

Performance tests #121

Merged
merged 21 commits into from
Nov 1, 2023
Merged

Performance tests #121

merged 21 commits into from
Nov 1, 2023

Conversation

ailrst
Copy link
Contributor

@ailrst ailrst commented Oct 24, 2023

Change summary:

  • Add timing to SystemTests
  • Differentiate timeout from verification failure
  • Have SystemTests write out two CSV files summarising the test results and times
  • Pass CLI configuration through the program in runutils and the boogie translation
    • Add CLI flag --boogie-use-lambda-stores to generate the lambda definition for >8bit stores, rather than the nested MemOp definition, this gives reasonable performance without ArrayAxioms.
  • Add inline flag to BFunction

Breaking changes:

  • boogie timeout is now always a test failure

With defaults MemOps and ArrayAxioms:

[info] - summary
[info]   + Test summary: 305 verified, 81 failed to verify including 0 timeouts. 
[info]   + Average time to verify: 599 
[info]   + Average time to counterexample: 701

With lambdas and array theories:

[info] - summary
[info]   + Test summary: 305 verified, 81 failed to verify including 2 timeouts. 
[info]   + Average time to verify: 665 
[info]   + Average time to counterexample: 1851

@ailrst ailrst marked this pull request as ready for review October 27, 2023 07:32
@ailrst ailrst requested a review from l-kent October 27, 2023 07:32
@l-kent
Copy link
Contributor

l-kent commented Oct 30, 2023

What's the point of storing the expected IL output too? It isn't used for anything here and seems completely redundant since it is just going to be the same information as the final output.

I also think that something like that --boogie-use-lambda-stores flag should probably be in its own pull request so we can really assess if it's a better approach, but I guess you've added it as a flag so you can experiment with it for now.

@ailrst
Copy link
Contributor Author

ailrst commented Oct 30, 2023

I also think that something like that --boogie-use-lambda-stores flag should probably be in its own pull request so we can really assess if it's a better approach, but I guess you've added it as a flag so you can experiment with it for now.

Its necessary for some examples to verify (though none of the test cases we have currently) and just gives worse performance for others, I think we want to keep both around at this stage. But yes it could have been its own PR.

@l-kent
Copy link
Contributor

l-kent commented Oct 30, 2023

Can you explain about storing the IL output?

@ailrst
Copy link
Contributor Author

ailrst commented Oct 30, 2023

Can you explain about storing the IL output?

Yeah that's not particularly useful at this point, my thinking was its so when we have more in-place transformation of the IR we have history in case of regressions.

@l-kent
Copy link
Contributor

l-kent commented Oct 30, 2023

I don't see any point in including it right now, it's just unnecessary bloat and any regressions will be visible in the Boogie output.

val csvHeader = "passed,verified,shouldVerify,hasExpected,timedOut,matchesExpected,translateTime,verifyTime"
}

val testResults: mutable.Map[String, TestResult] = mutable.HashMap()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for using a Map here, given that it means the output isn't ordered, which is much less convenient? It doesn't seem like we care about the constant lookup time?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uses an ArrayBuffer now

Comment on lines 47 to 87
Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--spec", specPath, "--output", outPath))
Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--spec", specPath, "--output", outPath, "--dump-il", ilPath))
} else {
Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--output", outPath))
Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--output", outPath, "--dump-il", ilPath))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really useful right now, as mentioned

build.sbt Outdated
Comment on lines 58 to 60
if (ILOutPath.exists() && !(ILExpectedPath.exists() && filesContentEqual(ILExpectedPath, ILOutPath))) {
IO.copyFile(ILOutPath, ILExpectedPath)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also unnecessary right now

if (verifying.nonEmpty)
info(s"Average time to verify: ${verifying.sum / verifying.size}")
if (counterExamples.nonEmpty)
info(s"Average time to counterexample: ${counterExamples.sum/ counterExamples.size}")

val summaryHeader = "verifiedCount,counterexampleCount,timeoutCount,verifyTotalTime,counterexampleTotalTime"
val summaryRow = s"$numVerified,${counterExamples.size},$numTimeout,${verifying.sum},${counterExamples.sum}"
val summaryRow = s"$numSuccess,${counterExamples.size},$numTimeout,${verifying.sum},${counterExamples.sum}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted verifyTotalTime/verifyCount = mean verify time. scalaTest already tells you how many tests passed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll just make the summary include both things.

@ailrst ailrst merged commit 5f02a10 into main Nov 1, 2023
1 check passed
@ailrst ailrst deleted the performance-tests branch November 6, 2023 23: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.

3 participants