4.15.5 regression: a trivially satisfiable quantified array query goes from `sat` in 0.1 s to `unknown` (MBQI fails every round)
This report was investigated and written by Claude (Anthropic's AI model), working for @jeapostrophe, who asked for it to be filed. Every number below was measured on the query at the bottom with official release binaries; anything not measured is marked as such.
Summary
Apologies in advance if this one turns out to be noise: the query is fragile even on the releases that answer it (see Notes), and we could not establish a mechanism.
The 792-byte query at the bottom is satisfiable by inspection. Every release we tried from 4.13.0 through 4.15.4 answers sat using about 22 k rlimit, in under 0.1 s. From 4.15.5 on, through 5.1.0 and the current nightly, it answers unknown (canceled) after 100 M rlimit. Without an rlimit, 5.1.0 had not answered after 10 minutes. Bisecting 4.15.4..4.15.5 with source builds and a fixed-rlimit judge points to e4cdbe003 ("fixes to finite domain arrays", the fix for #7544 and #8065). The mechanism is not established, and the query is fragile (see Notes). ddSMT produced it while reducing, for a different regression (#10934), a query from a program verifier in a fantasy-console toolchain (not public). On our full-size queries this one never shows up by itself. We report it because the query is small and the change in behaviour is large.
Reproduce
$ z3 finite_domain.smt2 # default options
$ z3 finite_domain.smt2 -st smt.mbqi.trace=true # to see the MBQI roundsTo bound the run, put (set-option :rlimit 100000000) first.
| version | result | rlimit | wall |
|---|---|---|---|
| 4.13.0 | sat |
22 210 | 0.07 s |
| 4.13.2 | sat |
22 210 | 0.06 s |
| 4.14.1 | sat |
22 333 | 0.10 s |
| 4.15.4 | sat |
22 335 | 0.10 s |
| 4.15.5 | unknown (canceled) |
100 M cap | 109 s |
| 4.16.0 | unknown (canceled) |
100 M cap | 97 s |
| 5.0.0 | unknown (canceled) |
100 M cap | 155 s |
| 5.1.0 | unknown (canceled) |
100 M cap | 136 s |
nightly (b83dca78) |
unknown (canceled) |
100 M cap | 164 s |
| 5.1.0, no rlimit | no answer | — | killed at 600 s |
The bisection used source builds (Release, Apple clang 17) with a 5 M rlimit judge:
| build | result |
|---|---|
c12425c86 (parent) |
sat, 2 117 336 rlimit |
e4cdbe003 |
unknown (canceled) at 20 M |
Statistics at a 5 M cap (-st, smt.mbqi.trace=true):
| 4.15.4 | 4.15.5 | |
|---|---|---|
| result | sat at 22 335 |
unknown at 5 M |
final-checks |
8 | 41 |
| MBQI | :succeeded true on the first round |
16 of 16 rounds :failed, each with :num-failures 1 |
array-ext-ax |
20 | 50 |
quant-instantiations |
21 | 59 |
Wall times were taken on a heavily loaded machine and are only rough. The rlimit figures are exact and repeat run to run.
Notes on the repro
What it says. There are nine arrays from 11-bit indices to 8- or 16-bit values. A single forall i states that e and h are constant (equal to b[0] and c[0]), that f = a, g = d and k = h pointwise, and that d[0] = 0. Any a, b, c, d with d[0] = 0 extends to a model. The query has no store, no const and no array equality.
It is fragile, so weigh it accordingly. 4.15.4 is not robust on this shape either. Changing only the index width (and the #b0… literal) gives:
| index width | 10 | 11 (as attached) | 12 | 13 | 14 | 15 | 16 |
|---|---|---|---|---|---|---|---|
| 4.15.4 | unknown | sat | sat | unknown | unknown | sat | unknown |
| 5.1.0 | unknown (incomplete quantifiers) | unknown | unknown | unknown | unknown | unknown | unknown |
(20 M cap; "unknown" means canceled at the cap unless noted.) The bisection parent c12425c86 already needs 2.1 M rlimit at width 11, against 22 k for 4.15.4, and it is unknown at widths 12 and 15. So something between 4.15.4 and c12425c86 also moved this query. e4cdbe003 is the step that took width 11 from sat to not finishing.
What we tried on the mechanism. e4cdbe003 does two things. (a) theory_array_full::internalize_term now calls relevant_eh when relevancy is off, which is how the MBQI auxiliary context runs (m_relevancy_lvl = 0 in smt_model_checker.cpp). (b) It adds diag equalities across store for domains smaller than 2^14. We removed (a) from a 5.1.0 source build and it was still unknown at 20 M, so (a) alone is refuted. We did not test (b). It would apply at width 11, but this query contains no store. We did not check whether z3 creates stores internally, for example in the MBQI model. smt.array.extensional=false is not a workaround: 5.1.0 then returns unknown (incomplete quantifiers) at once.
Version
$ z3-5.1.0 --version
Z3 version 5.1.0 - 64 bit
$ z3-nightly --version
Z3 version 5.1.0 - 64 bit - build hashcode b83dca781e457cf4af82501efe8f8fecb745d26emacOS 15.3.1, arm64. Official z3-<ver>-arm64-osx-*.zip release builds.
finite_domain.smt2
(declare-fun a () (Array (_ BitVec 11) (_ BitVec 8)))
(declare-fun b () (Array (_ BitVec 11) (_ BitVec 8)))
(declare-fun c () (Array (_ BitVec 11) (_ BitVec 16)))
(declare-fun d () (Array (_ BitVec 11) (_ BitVec 8)))
(declare-fun e () (Array (_ BitVec 11) (_ BitVec 8)))
(declare-fun f () (Array (_ BitVec 11) (_ BitVec 8)))
(declare-fun g () (Array (_ BitVec 11) (_ BitVec 8)))
(declare-fun h () (Array (_ BitVec 11) (_ BitVec 16)))
(declare-fun k () (Array (_ BitVec 11) (_ BitVec 16)))
(assert (forall ((i (_ BitVec 11)))
(and (= (select e i) (select b #b00000000000))
(= (select f i) (select a i))
(= (select g i) (select d i))
(= (select h i) (select c #b00000000000))
(= (select k i) (select h i)))))
(assert (= (select d #b00000000000) #x00))
(check-sat)Source: Z3Prover/z3