GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — a320-cli/bench at main · Santisoutoo/a320-cli

Expand file tree

/

bench

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

bench

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
a320_bench
a320_bench
 
 
tests
tests
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 

README.md

Outline

a320-bench — Phase 5 benchmark harness

Code half of the benchmark (#19): scenario loading/validation, the episode runner that sits an LLM in front of the benchmark MCP surface, and trajectory recording. The data half — scenario YAMLs and their QRH-sourced ground truth — lives in scenarios/.

Install

pip install -e bindings/   # a320_sim (not on PyPI)
pip install -e mcp/        # a320_mcp (START_STATES, create_server)
pip install -e bench/

Layout

  • a320_bench/scenario.py — YAML loader: jsonschema shape validation against scenarios/schema/scenario.schema.json, then live cross-checks of every control name, failure id and start state against the core catalogs (a bad reference fails at load time, not mid-episode).
  • a320_bench/episode.py — the episode runner. In-process and privileged: it owns the Sim (setup, world controls, failure injection, ground truth via active_failures()), while the agent talks to a benchmark-profile MCP server (no inject_failure/clear_failure, plus report_done) over the SDK's memory transport. Records every turn and tool call to JSONL with the simulated clock around each call; ends on report_done, budget exhaustion, two empty turns (one nudge), a provider error (partial trajectory kept), or a failed validity gate (invalid_scenario: the world never showed the ECAM the scenario promised, so there is nothing to score).
  • a320_bench/recorder.py — JSONL trajectory writer/reader; the trajectory is self-contained (scenario embedded, tool surface, vendor pin, versions) so the #20 scorer never re-simulates.
  • a320_bench/providers/ — agent adapters; scripted needs no LLM and is what CI runs; litellm_adapter (pinned litellm, [providers] extra) is the canonical real-model path.
  • a320_bench/serve.py — a320-bench serve --scenario X --result out.json: the same privileged setup + injection + validity gate, then the benchmark tool surface on stdio for an external MCP client that owns its own agent loop — above all claude -p on a Claude subscription. The harness's verdict lands in --result on shutdown. Demo/dev path: the trajectory is the client's transcript (--output-format stream-json), and the client's system prompt is a confound for model-vs-model baselines — those go through a320-bench run.
  • a320_bench/scoring.py + a320_bench/cli_score.py — a320-bench score PATH... [--json] [--detail] [--include-errors]: turns recorded trajectories (files or run directories) into procedure-compliance ScoreCards. Pure and offline — no Sim, no network, no compiled binding — so a reviewer scores results with pip install -e bench/ alone. The metric is a reported vector (coverage, order, end_state, safety, extraneous) plus a derived scalar for rankings; full spec in docs/fase5-metrica.md.

Score a batch

a320-bench score runs/                       # human table + per (scenario,model) aggregates
a320-bench score runs/ --json > scores.json  # ScoreCards + aggregates for plots
a320-bench score runs/elec-apu-gen-fault/one.jsonl --json --detail

Experiment runbook (needs provider API keys)

The baselines and ablations of #20 are a loop over run (records) and score (measures) — no bespoke code. The protocol (models, N per cell, ablation axes, statistical power) is in docs/fase5-metrica.md; here are the exact commands the matrix executes.

Keys live in the environment, never in a file or a trajectory (the adapter records the model and sampling, never the credential):

$env:ANTHROPIC_API_KEY = "..."          # Claude via litellm
$env:GEMINI_API_KEY   = "AQ..."          # Gemini via Vertex express (AQ.* keys)

One cell — a model against every scenario, N runs each, into a run tree:

$SCEN = Get-ChildItem scenarios -Recurse -Filter *.yaml |
        Where-Object { $_.Directory.Name -ne "schema" }
foreach ($s in $SCEN) {
  a320-bench run --scenario $s.FullName `
    --model anthropic/claude-opus-4-8 --runs 10 --out runs/baseline
}
# Gemini needs its Vertex express api_base passed through --sampling:
foreach ($s in $SCEN) {
  a320-bench run --scenario $s.FullName --model gemini/gemini-2.5-flash --runs 10 `
    --out runs/baseline `
    --sampling '{"api_base": "https://aiplatform.googleapis.com/v1beta1/publishers/google"}'
}

Score the whole tree — the table separates by (scenario, model), the JSON feeds the plots:

a320-bench score runs/baseline                 # human table + aggregates
a320-bench score runs/baseline --json > baseline.json

An ablation is the same loop with one lever changed (a scenario variant with a different instructions_profile, a --sampling temperature, a tool-surface profile) into a separate --out runs/ablation-<name>, scored the same way. score needs no binding and no network, so the whole measurement half runs on a reviewer's machine with pip install -e bench/ alone.

Tests

python -m pytest bench/tests -q     # no LLM, no network

License

GPLv3 — drives the a320_sim extension, which links the vendored FlyByWire crates and inherits their license.

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.