Skip to content

SV-COMP 2027 final version (svcomp27) - #123

Merged
nils-loose merged 22 commits into
devfrom
svcomp27/candidate-hash
Nov 17, 2026
Merged

nils-loose merged 22 commits into
devfrom
svcomp27/candidate-hash

Conversation

@nils-loose

Copy link
Copy Markdown
Contributor

The SV-COMP 2027 final version (svcomp27): dev 1e03c98 plus the changes below, merged on svcomp27/candidate-hash.

Contents

Measured (official limits: 3 GB, 1 core, 900 s CPU, JDK 25; 1925 runs)

🤖 Generated with Claude Code

nils-loose and others added 22 commits November 17, 2026 09:46
Pattern and Matcher get shadows: PatternValue is made from the concrete
(immutable) Pattern, MatcherValue holds the pattern and the input String.
matches() on a fresh matcher of a pattern without flags whose regex
JavaRegex translates is modelled as String.matches (a regex membership);
any other Matcher call (find, group, reset, region, usePattern, ...) stays
unmodelled and records context loss, and disables matches() for that
matcher afterwards. Pattern.matches(c, s) is modelled as s.matches(c).

Adds the model-soundness swat-benchmarks suite (regex pairs) and an L2
agent spec (RegexAgentSpec).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…quals models

Arrays.equals for int/long/short/byte/char/boolean arrays and Object[] of
String, boxed integral types and null; Arrays.hashCode for the same
primitive arrays and Object[] of boxed integral types and null (32-bit
31*h + e with Long/Boolean element hashes); Objects.hash as
Arrays.hashCode(Object[]). Only concrete lengths up to 4096; symbolic
lengths, unknown elements, float/double and Strings in a hash stay
missing invocations (context loss). StringBuilder/StringBuffer.equals is
identity.

Adds swat-benchmarks/java/model-soundness (arrays-*, sb-equals-*,
logger-*) SAFE/VIOLATION pairs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An INVOKEDYNAMIC through LambdaMetafactory that captures arguments for an
implementation method in instrumented code now yields a CapturingLambdaValue
(captured shadows as its fields, the implementation handle and the
instantiated interface type from the bootstrap arguments) instead of a
PlaceHolder, so the capture itself is no longer a missing invocation or a
context loss. The object is symbolic when a captured value is, so passing it
to an unmodelled library call is still a context loss.

When an interface call on such a lambda runs its implementation method, the
body frame is captured ++ interface arguments (receiver first for instance
lambdas). It is adopted only if the method is exactly the handle's and its
parameters/return are exactly captured types ++ instantiated types; any
LambdaMetafactory adaptation (unboxing, widening, dropped return, subtype
receiver) keeps the old untracked-code context loss. JDK method references
keep the old path.

Also: Boolean(boolean) with the argument loaded as an int (ILOAD) is modelled
like Boolean.valueOf(boolean); before, the shadow stayed false.

Adds swat-benchmarks/java/model-soundness with 10 lambda-* SAFE/VIOLATION
pairs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict in targets/sv-comp/swat-benchmarks/README.md only: the lambda and
arrays PRs each added a model-soundness paragraph; both are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From JDK 25 on, every compilation unit imports java.lang.IO (JEP 512).
With javac 25, 'import testcasesupport.*' makes juliet's IO ambiguous
('reference to IO is ambiguous'), and 9 juliet-java tasks (18 runs) did
not compile, so they ended UNKNOWN without a trace. -source 1.8 still
compiles against the JDK's own API; --release 8 compiles against the
Java 8 API, which has no java.lang.IO. The first attempt is unchanged,
so every task that compiles today compiles the same way; the 1110 task
directories of the SV-COMP 2027 freeze compile with javac 21, and with
javac 25 all of them compile with this fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A HashMap, LinkedHashMap, HashSet or LinkedHashSet that SWAT saw created keeps
its exact entries (HashEntries: key shadows in insertion order, value shadows).
A call by key with String, boxed integral, Boolean or null keys is recorded as
the equality chain key.equals(k_j) over the stored keys, as library branches
like those of the String models (masked in the SA walk). The path then fixes
which entry matched, and the solver reaches the others. Before, any symbolic
key was a context loss (cluster A of the context-loss analysis).

- Calls: get, getOrDefault, containsKey, put, putIfAbsent, remove, putAll, the
  copy constructors, size, isEmpty, clear; add, contains, remove, addAll on sets.
- Anything not modelled exactly gives the record up (a call outside the tables,
  a key of another class, a call that ran application code or threw, the
  container or a view passed to code that is not modelled, a change through a
  view or iterator): a context loss if the container held a symbolic key.
- Iterating a plain hash container with two or more entries and a symbolic key
  is a context loss (the order depends on hash codes); linked ones are exact.
- What the record says a call returns is checked against the JVM's result.
- Only keys whose shadow value is known are compared (ObjectValue.valueUnknown):
  the shadow of a boxed char or short constant is the default 0, and comparing
  it gave a false SAFE (model-soundness hash-char-literal_false).
- Lookups in Collections.emptyMap/emptySet/emptyList do not depend on the key.

Tests: swat-benchmarks model-soundness, hash-* and hashset-* (34 pairs).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ConcurrentHashMap is modelled like a HashMap, by reference with concrete keys
and with exact entries for symbolic ones: by key it differs only in that a null
key or value throws, and a call that throws is never modelled. Its iteration
order is the hash order as well.

Tests: model-soundness hash-concurrent, hash-concurrent-iterate,
hash-linked-copy-order (a LinkedHashMap copied from a HashMap iterates in hash
order), hashset-aslist (a source the model does not copy from).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
HashContainerModelTest: which keys are compared, the equality chain of a
lookup, put over an equal key, giving the record up (other key classes, calls
outside the tables, a result that differs), iteration order, set copies,
ConcurrentHashMap, Hashtable and the empty immutable map.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- SWAT's own helpers (RefIdentity.same for `map == null`) and the ignored sinks
  no longer count as code that may change a container they are passed: they
  ended the exact record, a context loss with symbolic keys.
- A list copied from a hash container with an unknown iteration order is
  marked instead of the copy being a context loss: reading an element of it by
  position is one, its size is not. The order of a plain hash container counts
  as unknown once it has held a symbolic key since it was last cleared (the key
  may have shaped the table for the keys after it), and a copy in that order
  inherits this.
- HashSet.addAll and the copy constructor read a map's key set.
- equals of two lists whose elements are known exactly (built by appending) is
  modelled like a lookup: false for different sizes, else a chain over the
  element pairs up to the first that differ; also through Objects.equals.

Tests: model-soundness hashset-keyset-copy, list-equals, list-equals-size,
list-equals-changed (must stay UNKNOWN); HashContainerModelTest.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…object

GETVALUE_Object compares every String or boxed shadow with the object it is
fetched for and marks a differing one (ObjectValue.valueUnknown), so that the
exact model of hash containers does not compare it as a key. Before, only
boxed shadows without an address were compared.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…uments

The models of Character/Short/Byte/Boolean.<init> took only a shadow of their
own primitive type. A constant or an int-typed expression is passed as an int
(BIPUSH, ICONST), so the box kept its default shadow value (0, false) whatever
the object held: `Boolean flag = true` read back as false, a context loss at
the first unboxing (KeywordSearchJobSettings), and such a box was no key for
the hash container model. They now convert as I2C, I2S and I2B do.

Tests: model-soundness hash-char-key, hash-char-literal, hash-short-literal and
hash-boolean-key are exact now; HashContainerModelTest.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
model-soundness hash-unknown-shadow: a Short key from a constructor SWAT does
not model (from a String) keeps the default shadow 0 and must not be compared.
Without ObjectValue.valueUnknown the VIOLATION task is reported SAFE.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
model-soundness hash-identity-put, -get, -remove: reference comparisons on the
value a call by key returns, with possibly equal symbolic keys. They are
decided on the objects, so the path must say which entry matched.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A branch whose solutions kept diverging is given up on (retired); it rules
out SAFE unless some run reaches its open side, on its own node or on a
path with the same relevant decisions (tree.covered). But dfs put the open
side of every solved or retired branch into that same covered set, and the
visit passes the retired gids among the solved ones: the given-up branch's
own marker always forgave it ("Other runs reached the sides of all given-up
branches"), a false SAFE (e.g. a toCharArray length pin whose flip always
diverges, ahead of an assert).

The same marker made check_projected_divergence always report that a
sliced query's run reached its branch: solutions are kept after their run,
so the target's own open side was covered, and a sliced divergence was
never re-solved nor given up on.

Now covered holds only what some path explored, or proved infeasible
(UNSAT of the query over the relevant decisions). Solved and retired sides
go to a separate claimed set that only keeps candidates with the same
identity out, as before, so the candidates and the search order do not
change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GivenUpCoverageTest (test_divergence) walks a tree with two paths that
differ only in an irrelevant decision: a given-up branch is not forgiven by
its own retired marker nor by a solution for the same side on the other
path, but by a run that takes that side there or by an UNSAT proof; and a
sliced query's run that reached nothing is a divergence. The three bug
cases fail on the previous DFS.py.

sa-soundness gets the reviewer's reproducers as pairs,
explore-given-up-tochararray-len and -contains: toCharArray() pins the
length, the pin's flip always diverges. Before the fix both _false tasks
were SAFE; now all four are UNKNOWN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
BooleanObjectValue: both branches convert an int-typed Boolean(boolean) argument;
kept the lambda branch's version, which also checks the descriptor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tests and sa-soundness reproducers for the given-up fix (no shipped code changes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nils-loose
nils-loose merged commit 71e991b into dev Nov 17, 2026
6 checks passed
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.

1 participant