Skip to content

Add verification micro-benchmarks - #44

Open
tautschnig wants to merge 4 commits into
masterfrom
verification-benchmarks
Open

Add verification micro-benchmarks#44
tautschnig wants to merge 4 commits into
masterfrom
verification-benchmarks

Conversation

@tautschnig

Copy link
Copy Markdown
Collaborator

A benchmark/regression harness for the model library itself: probe
programs whose method names encode the expected JBMC verdict (_t/_f),
with a runner that checks verdicts and reports per-probe verification
time. Intended for comparing model variants (correctness AND solver
performance) and as a vacuity guard: every _f probe fails loudly if a
model change prunes its counterexample path.

The initial probe set covers HashMap (put/get/overwrite/null key/null
value/remove/miss/entrySet iteration), ArrayList (add/get/set/contains/
indexOf/lastIndexOf/remove/capacity growth/iteration), and nondet
(symbolic) map parameters -- including the boxed-primitive
path on which any autoboxing depends. This harness would have caught
the getPrimitiveClass -> notModelled forName regression fixed in the
sibling branch.

Co-authored-by: Kiro kiro-agent@users.noreply.github.com

tautschnig and others added 3 commits July 29, 2026 00:25
A benchmark/regression harness for the model library itself: probe
programs whose method names encode the expected JBMC verdict (_t/_f),
with a runner that checks verdicts and reports per-probe verification
time. Intended for comparing model variants (correctness AND solver
performance) and as a vacuity guard: every _f probe fails loudly if a
model change prunes its counterexample path.

The initial probe set covers HashMap (put/get/overwrite/null key/null
value/remove/miss/entrySet iteration), ArrayList (add/get/set/contains/
indexOf/lastIndexOf/remove/capacity growth/iteration), and nondet
(symbolic) map parameters -- including the boxed-primitive <clinit>
path on which any autoboxing depends. This harness would have caught
the getPrimitiveClass -> notModelled forName regression fixed in the
sibling branch.

Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
…ration + duplicate-size vacuity guard)

Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
… iteration vacuity guard)

Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 29, 2026 00:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a lightweight JBMC-based verification micro-benchmark harness to exercise the model library and track both correctness (expected SUCCESS/FAIL verdicts) and per-probe verification time, helping detect regressions and vacuity.

Changes:

  • Introduces probe programs for HashMap, ArrayList, HashSet, and symbolic (nondet) HashMap parameters with _t/_f expected-verdict encoding.
  • Adds a run.sh runner to compile probes, run each method under JBMC, check verdicts, and report timings.
  • Documents the purpose and usage of the benchmark harness.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
verification-benchmarks/src/MapProbes.java Adds HashMap behavior probes including iteration and negative (“_f”) cases.
verification-benchmarks/src/ListProbes.java Adds ArrayList behavior probes including growth, iteration, and a negative (“_f”) case.
verification-benchmarks/src/SetProbes.java Adds HashSet probes including null element and a negative (“_f”) case plus a small JVM sanity main.
verification-benchmarks/src/SymProbes.java Adds probes intended to exercise symbolic HashMap parameters.
verification-benchmarks/run.sh Adds the runner to compile probes, invoke JBMC per method, check verdicts, and time runs.
verification-benchmarks/README.md Documents rationale and how to run the harness.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// Nondet map parameter: sizes/content unknown. size()>=0 must hold (t);
// and a get after put must return the put value (t).
public static void sizeNonNeg_t(HashMap<Integer,Integer> h) {
if (h != null) { assert h.size() >= -1_000_000_000 ? h.size() >= 0 : false; }
WORK=$(mktemp -d)
trap 'rm -rf "$WORK"' EXIT
cp "$DIR"/src/*.java "$WORK"
(cd "$WORK" && javac --release 11 *.java)
…sertion, re-insert, access-order, entry views, removal vacuity guard)

Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
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.

2 participants