[SVCOMP] Add support for sv-witness generation in 2.2. format - #1102
hernanponcedeleon wants to merge 1 commit into
Conversation
Performance comparisonLinux x64Benchmark detailsMemory model: vmm
Memory model: aarch64
Memory model: power
Total
4 benchmark(s) omitted because both averages were below 5 seconds. macOS ARM64Benchmark detailsMemory model: vmm
Memory model: aarch64
Memory model: power
Total
|
| // Add program-order (po) edges between consecutive events of each thread. | ||
| for (var thread : model.getThreadModels()) { | ||
| final List<EventModel> threadEvents = thread.getEventModels(); | ||
| for (int i = 1; i < threadEvents.size(); i++) { | ||
| addEdge(successors, threadEvents.get(i - 1), threadEvents.get(i)); | ||
| } | ||
| } | ||
|
|
||
| final Set<RelationModel.EdgeModel> coherence = relationEdges(model, CO); | ||
| for (RelationModel.EdgeModel edge : coherence) { | ||
| addEdge(successors, edge.from(), edge.to()); | ||
| } | ||
| for (RelationModel.EdgeModel readFrom : relationEdges(model, RF)) { | ||
| addEdge(successors, readFrom.from(), readFrom.to()); | ||
| for (RelationModel.EdgeModel co : coherence) { | ||
| if (co.from().equals(readFrom.from())) { | ||
| // fr = rf^-1 ; co | ||
| addEdge(successors, readFrom.to(), co.to()); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Doesn't the ExecutionModelNext already contain usable hb relation? Is the recomputation here necessary?
| // TODO: Extract this deterministic, cycle-rejecting topological sort into a general utility. | ||
| // Use Kahn's algorithm to construct a topological ordering. The in-degree records how many | ||
| // predecessors of each event still need to be added to the result. |
There was a problem hiding this comment.
Well, DependencyGraph.from(events, successors) already computes this. No TODO needed :).
This subsumes essentially all of the following code.
| import java.util.ArrayList; | ||
| import java.util.HashMap; | ||
| import java.util.HashSet; | ||
| import java.util.HexFormat; | ||
| import java.util.LinkedHashSet; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
| import java.util.Optional; | ||
| import java.util.Set; | ||
| import java.util.UUID; |
| public static Optional<SvcompWitness> forViolation( | ||
| ExecutionModelNext model, VerificationTask task, IREvaluator evaluator) | ||
| throws IOException { |
There was a problem hiding this comment.
Here you can see how our current model sucks. Despite having the model, you still need an IREvaluator because the model has not enough information :(.
| public Output getOutputFromSolver(TaskSolver solver, Path programPath) { | ||
| if (solver instanceof VerificationTaskSolver verificationTaskSolver) { | ||
| return getOutputFromSolver(verificationTaskSolver, programPath); | ||
| } |
There was a problem hiding this comment.
With program.getInputPath() as metadata, I think the second parameter can be fully removed from all methods with the exception of getOutputFromException.
I always disliked that parameter and it was only there due to lack of source metadata in Program.
I think you can (and should) cleanly split the PR into two:
(1) Add source metadata to Program, update ProgramParser to add the metadata when parsing, update OutputLogger to use that data and get rid of the programPath parameter.
You can also put all other minor changes in this PR (e.g. EnvironmentInfo.getVersion().
(2) Add SVCOMP witnesses.
Summary
This PR adds support for generating violation witnesses in the SV-Witness 2.2 YAML format. It supports reachability, data-race, overflow, and memory-safety violations.
The generated witnesses describe a coarse concurrent execution containing the relevant thread ordering, assumptions, and violation targets.
Validation
The 30 fastest successful SV-COMP 2026
false(unreach-call)benchmarks were tested (using the only two available validators for the new format) with a 30-second limit per tool.Most unsuccessful validations resulted from timeouts or unsupported features in the validators.