# Casebook scoring comparison
The runner compiles two Git revisions of the casebook engine into one executable. It compares the complete advice returned for 12,288 seeded queries across 192 generated books, including repeated examples, conflicting actions and tied costs. A mismatch fails the run before timing starts.
The timing covers in-memory advice, including result allocation. The eight-row book models the three-check handoff decision. The 128-row book has sixteen checks and twelve possible initial action labels. An empty observation asks for the first check. The one-fact observation fixes the first check to false.
| 8 | 3 | 0 | 1.07× | 1.02× |
| 8 | 3 | 1 | 1.01× | 1.01× |
| 128 | 16 | 0 | 6.03× | 7.35× |
| 128 | 16 | 1 | 2.15× | 2.08× |
These are paired baseline-to-candidate ratios from one x86-64 Linux host under shared load, built with `rustc 1.95.0 (59807616e 2026-04-14)` and `-O`. Each scenario discards one warm-up pair and alternates the order for twelve measured pairs. The printed nanosecond figures are separate medians for each implementation. CLI startup, storage, retrieval and agent work are outside the timed interval. The receiver trial records the agents' decisions on a separate task. [Receiver trial](receiver-trial.json)
## Reproduce from a checkout
Run this block from the repository root with a POSIX shell and Rust. The default baseline is the commit that introduced the pair enumerator. The candidate defaults to `HEAD`. Set `BASELINE_REF` and `CANDIDATE_REF` to explicit revisions when comparing another branch or a squashed history. Set `BENCH_CPU=6` before the block to add the pinned Linux run, or choose another CPU allowed on the host.
```sh
(
set -eu
candidate_ref=${CANDIDATE_REF:-HEAD}
baseline_ref=${BASELINE_REF:-$(git log "$candidate_ref" --diff-filter=A -1 --format=%H -- src/case_learning.rs)}
test -n "$baseline_ref"
work=$(mktemp -d)
git show "${baseline_ref}:src/case_learning.rs" > "$work/baseline.rs"
git show "${candidate_ref}:src/case_learning.rs" > "$work/candidate.rs"
if cmp -s "$work/baseline.rs" "$work/candidate.rs"; then
echo "The exports are identical. Select the pair enumerator and counting revisions explicitly." >&2
exit 1
fi
INSTINCT_BENCH_BASELINE="$work/baseline.rs" \
INSTINCT_BENCH_CANDIDATE="$work/candidate.rs" \
rustc --edition 2021 -O bench/case-learning/compare.rs -o "$work/compare"
"$work/compare"
if [ -n "${BENCH_CPU:-}" ]; then taskset -c "$BENCH_CPU" "$work/compare"; fi
)
```