Skip to main content

benchmark

Measure Z3 performance on a formula or file. Collects wall-clock time, theory solver statistics, memory usage, and conflict counts. Results are logged to z3agent.db for longitudinal tracking.

소스 정보

저장소
Z3Prover/z3
최근 소스 활동
2026년 3월 11일 21:53
감지된 SKILL.md 언어
영어
스타
12,902
포크
1,725

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
2 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
benchmark
description
Measure Z3 performance on a formula or file. Collects wall-clock time, theory solver statistics, memory usage, and conflict counts. Results are logged to z3agent.db for longitudinal tracking.
Given an SMT-LIB2 formula or file, run Z3 with statistics enabled and report performance characteristics. This is useful for identifying performance regressions, comparing tactic strategies, and profiling theory solver workload distribution. # Step 1: Run Z3 with statistics Action: Invoke benchmark.py with the formula or file. Use `--runs N` for repeated timing. Expectation: The script invokes `z3 -st`, parses the statistics block, and prints a performance summary. A run entry is logged to z3agent.db. Result: Timing and statistics are displayed. Proceed to Step 2 to interpret. ```bash python3 scripts/benchmark.py --file problem.smt2 python3 scripts/benchmark.py --file problem.smt2 --runs 5 python3 scripts/benchmark.py --formula "(declare-const x Int)..." --debug ``` # Step 2: Interpret the output Action: Review wall-clock time, memory usage, conflict counts, and per-theory breakdowns. Expectation: A complete performance profile including min/median/max timing when multiple runs are requested. Result: If performance is acceptable, no action needed. If slow, try **simplify** to reduce the formula or adjust tactic strategies. The output includes: - wall-clock time (ms) - result (sat/unsat/unknown/timeout) - memory usage (MB) - conflicts, decisions, propagations - per-theory breakdown (arithmetic, bv, array, etc.) With `--runs N`, the script runs Z3 N times and reports min/median/max timing. # Step 3: Compare over time Action: Query past benchmark runs from z3agent.db to detect regressions or improvements. Expectation: Historical run data is available for comparison, ordered by recency. Result: If performance regressed, investigate recent formula or tactic changes. If improved, record the successful configuration. ```bash python3 ../../shared/z3db.py runs --skill benchmark --last 20 python3 ../../shared/z3db.py query "SELECT smtlib2, result, stats FROM formulas WHERE run_id IN (SELECT run_id FROM runs WHERE skill='benchmark') ORDER BY run_id DESC LIMIT 5" ``` # Parameters | Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | formula | string | no | | SMT-LIB2 formula | | file | path | no | | path to .smt2 file | | runs | int | no | 1 | number of repeated runs for timing | | timeout | int | no | 60 | seconds per run | | z3 | path | no | auto | path to z3 binary | | debug | flag | no | off | verbose tracing | | db | path | no | .z3-agent/z3agent.db | logging database |
GitHub에서 보기