Skip to content

Benchmarks & Experiments

microharness includes built-in benchmark harnesses and CSV experiment tracking under benchmarks/.


Mini-SWE (Pure-Python Sanity Suite)

Mini-SWE is a fast, zero-Docker, 5-task engineering benchmark designed for rapid local sanity testing and loop verification:

  1. rate_limiter: Token Bucket rate limiter losing fractional refills under rapid polling.
  2. circular_serializer: Circular JSON serializer cycle detection & ISO-8601 formatting.
  3. auth_middleware: HTTP auth middleware case-insensitive headers & whitespace tolerance.
  4. lru_ttl_cache: LRU cache with TTL updating existing keys & refreshing MRU order.
  5. query_builder: SQL query builder AST precedence grouping & single-quote escaping.
# Run all 5 Mini-SWE tasks
uv run microharness --benchmark mini-swe

# Filter to specific tasks (supports comma-separated IDs and !exclusions)
uv run microharness --benchmark mini-swe --task rate_limiter,query_builder
uv run microharness --benchmark mini-swe --task "!circular_serializer"

Anti-Cheating Evaluator (PristineTestEvaluator)

Evaluators restore pristine test files before executing verification so an agent cannot pass by weakening or deleting test assertions. Results are printed as a terminal scorecard and exported to ~/.microharness/runs/benchmark_report.json.


DeepSWE-mini (Harbor Format & Docker)

microharness natively supports DeepSWE-mini (16 curated real-world repositories across Python, Go, and TypeScript):

  • Parses Harbor task.toml metadata using Python 3.11's standard library tomllib.
  • Pulls task container images, mounts behavioral verifiers, captures model.patch, and grades via tests/grader.py.
  • Automatically skips narwhals-rolling-window-suite on arm64 hosts where prebuilt wheels fail.
# Clone task definitions once
git clone --depth 1 https://github.com/datacurve-ai/deep-swe datasets/deep-swe

# Run the suite inside Docker
uv run microharness --benchmark deepswe-mini --docker

# Run a single task with custom budgets
uv run microharness --benchmark deepswe-mini --task aiomonitor --max-steps 500 --timeout 7200 --docker

# Run via Datacurve Pier adapter (benchmarks/pier_agent.py)
uvx --from datacurve-pier pier run -p datasets/deep-swe/tasks/aiomonitor-task-snapshots-diff \
  --agent-import-path benchmarks.pier_agent:MicroharnessAgent --env docker

Experiment Tracking (microharness experiments)

Benchmark runs automatically upsert run-level summaries (~/.microharness/experiments.csv) and per-task outcomes (~/.microharness/experiments_tasks.csv) via benchmarks/experiments.py, recording:

  • harness_version, git_commit, dirty state
  • Active preset, subagents, model configuration
  • Pass/fail scores, durations, and token/cache telemetry
# Inspect recent benchmark runs
uv run microharness experiments list --limit 20

# Backfill historical *_report.json and standalone trace.json runs into CSV
uv run microharness experiments backfill

# Export sanitized Markdown tables for specific runs
uv run microharness experiments export --suite DeepSWE-mini --min-tasks 15

DeepSWE-mini Benchmark Results

Recorded runs from ~/.microharness/experiments.csv under Docker sandboxing (--max-steps 500). On arm64 hosts, narwhals-rolling-window-suite is skipped automatically (15/16 tasks). The preset definitions used in these evaluations live under examples/presets/ (see Agent Config Presets).

Run Version Model Preset Pass Rate Mean Score Steps Duration Cache Hit
exp-hy4-skilled-v0123 0.1.23 tencent/hy4-flash (high) hy4-skilled 12/15 (80.00%) 0.9955 1236 4.26h (15346s) 97.6%
exp-hy4-solo-v0123 0.1.23 tencent/hy4-flash (high) hy4-solo 10/15 (66.67%) 0.9918 1500 3.18h (11437s) 97.6%
deepseek-flash-suite pre-0.1.22 deepseek-flash (high) — 11/16 (68.75%) 0.8683 1868 4.36h (15687s) 98.1%

Per-Task Breakdown

Task exp-hy4-skilled-v0123 exp-hy4-solo-v0123 deepseek-flash-suite
aiomonitor-task-snapshots-diff PASS (1.00) PASS (1.00) PASS (1.00)
bandit-structured-nosec-directives PASS (1.00) FAIL (0.99) FAIL (1.00)
dasel-html-document-format PASS (1.00) PASS (1.00) PASS (1.00)
dynamodb-toolbox-lazy-recursive-schemas PASS (1.00) PASS (1.00) PASS (1.00)
expr-try-catch-errors PASS (1.00) FAIL (1.00) PASS (1.00)
ipython-session-bundle-replay PASS (1.00) FAIL (0.98) PASS (1.00)
koota-composite-trait-aspects FAIL (0.99) PASS (1.00) FAIL (0.00)
narwhals-rolling-window-suite — — FAIL (0.00)
ofetch-per-origin-circuit-breaker PASS (1.00) PASS (1.00) PASS (1.00)
prometheus-transactional-reload-status PASS (1.00) PASS (1.00) PASS (1.00)
prometheus-typed-label-sorting PASS (1.00) PASS (1.00) PASS (1.00)
scc-bounded-memory-spilling PASS (1.00) PASS (1.00) PASS (1.00)
termenv-preserve-ansi-resets FAIL (0.97) FAIL (0.99) PASS (1.00)
textual-kitty-key-phases FAIL (0.97) FAIL (0.91) FAIL (0.94)
valibot-recursive-schema-composition PASS (1.00) PASS (1.00) FAIL (0.96)
yaegi-go-embed-directives PASS (1.00) PASS (1.00) PASS (1.00)

Cost & Token Economics

Published DeepSWE-mini runs prioritize affordable fast models over flagship pricing:

  • exp-hy4-skilled-v0123 (tencent/hy4-flash, $0.035/$0.0015/$0.1405 per 1M tokens): $0.3409 total ($0.0284/pass) across 15 tasks (100.81M prompt tokens, 97.6% cached, 769.7k completion tokens). Removing bloated main-loop schemas (--no-tool-docs + opt-in --inspection-tools in v0.1.23) lifted the exact same 3-skill preset from 7/15 (46.7%, $0.3655) in v0.1.22 to 12/15 (80.0%, $0.3409) in fewer steps (1,236 vs. 1,500 for hy4-solo).
  • exp-hy4-solo-v0123 (tencent/hy4-flash): $0.3759 total ($0.0376/pass) across 15 tasks (115.56M prompt tokens, 97.6% cached, 782.9k completion tokens).
  • deepseek-flash-suite (deepseek-flash off-peak $0.15/$0.003/$0.60): $1.3198 across the 15 ARM64-compatible tasks (11/15, $1.44–$2.87 across all 16 tasks off-peak → peak).

Methodology & Reading Benchmark Numbers

  • N=1 variance: Single 15-task sweeps are directional (N=1) engineering signals rather than statistical proof. Individual boundary edge cases routinely flip a repository between 1.00 and 0.99 (34/35); multi-seed pass@k runs are required for final comparative claims.
  • Network isolation matters: On deepseek-flash, allowing unrestricted container networking inflated the pass rate to 13/16 (81.25%), compared to 11/16 (68.75%) under --docker-network none. Always enforce --docker-network none for honest local-only evaluation.

Updating Published Results

After completing a new benchmark sweep, regenerate the summary and per-task tables directly from your local experiment CSVs (without exposing local trace or workspace paths) by running:

uv run microharness experiments export \
  --suite DeepSWE-mini \
  --run exp-hy4-skilled-v0123 \
  --run exp-hy4-solo-v0123 \
  --run deepseek-flash-suite \
  --write docs/benchmarks.md

Pass additional --run <run_name> flags (or --min-tasks 15 --limit 5 to auto-select the newest full-suite sweeps) and commit the updated docs/benchmarks.md.