Skip to content

chore(deps): bump z3 to 0.20 in /rust#74

Merged
debe merged 1 commit into
mainfrom
chore/bump-z3-0.20
Jul 8, 2026
Merged

chore(deps): bump z3 to 0.20 in /rust#74
debe merged 1 commit into
mainfrom
chore/bump-z3-0.20

Conversation

@debe

@debe debe commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Addresses the second bump deferred in #72 (rand 0.10 landed in #73). The z3 crate was redesigned between 0.12 and 0.20, so this is a version bump plus a solver rewrite.

Changes (all in findchars-solver)

  • Feature static-link-z3vendored — builds Z3 4.16 statically from the z3-src crate (cmake + C++), no system Z3 needed.
  • Implicit-context API rewrite of src/solver.rs: the 'ctx lifetime is gone and constructors no longer take &ctx.
    • Drop Context; wrap solve_one in with_z3_config(&cfg, …) with a fresh Config per group (set_timeout_msec(5000) replaces the old Params timeout), preserving per-group context isolation.
    • Remove the leading &ctx from BV::new_const / BV::from_u64.
    • _eq → fully-qualified Ast::eq (bare .eq() now collides with PartialEq on BV, and _eq is deprecated → -D warnings).
    • assert() now takes Borrow<Bool>, so the Bool is passed by value (no outer &).

Public API unchangedLiteralCompiler::solve / solve_with_auto_split signatures and AsciiFindMask are identical; only the z3 calls inside solve_one changed.

Verification (local)

  • cargo build -p findchars-solver ✓ (vendored Z3 4.16 compiles from source)
  • cargo test -p findchars-solver7/7 (incl. the slow auto_split_many; each test actually invokes Z3 and validates the produced masks)
  • cargo test -p findchars -p findchars-csv ✓ (exercises the solver at runtime via engine construction — the 150s parity test)
  • cargo clippy --workspace --all-targets -- -D warnings

z3 0.13+ removed the explicit-context API: the `'ctx` lifetime is gone and
constructors run against an implicit thread-local context. Rewrite the solver
in findchars-solver accordingly:

- feature static-link-z3 -> vendored (builds Z3 4.16 from the z3-src crate)
- drop Context; wrap solve_one in with_z3_config(&cfg, ..) with a fresh Config
  per group (set_timeout_msec replaces the old Params timeout), preserving the
  per-group context isolation
- drop the leading &ctx arg from BV::new_const / BV::from_u64
- _eq -> fully-qualified Ast::eq (the bare .eq() now collides with PartialEq on
  BV, and _eq is deprecated)
- assert() now takes Borrow<Bool>, so pass the Bool by value (no outer &)

Public API (LiteralCompiler::solve / solve_with_auto_split) and AsciiFindMask
are unchanged. Verified: cargo test -p findchars-solver (7/7), cargo test
-p findchars -p findchars-csv, and clippy --all-targets -D warnings.
@debe debe merged commit 4ca0a70 into main Jul 8, 2026
3 checks passed
@debe debe deleted the chore/bump-z3-0.20 branch July 8, 2026 12:48
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