Repository navigation
Add backend A/B eval (graph-lite vs flat) #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
RodCor
wants to merge
7
commits into
main
Choose a base branch
from
fuse/backend-ab-eval
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8257c3a
Add backend A/B eval scripts as-run, with result summaries
RodCor 7f08dee
Rerun timed-out MCP chunks in the backend A/B eval
RodCor f3ec4c5
Load retrieval_eval from a repo-relative path in the backend A/B eval
RodCor cb1fd1d
Parameterize the backend A/B runners and document the as-run build
RodCor 927c686
Commit the 81507db6 timing log and point the repro at repo paths
RodCor 5585029
Wire backend A/B scripts into eval-scripts CI
RodCor 1c149d0
Commit resolved-config snapshots and run-log headers
RodCor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,161 @@ | ||
| # Backend A/B eval (graph-lite vs flat) | ||
|
|
||
| Two-arm storage-backend A/B on locomo-conv26 and lme-oracle. The single | ||
| variable is `storage.backend` (`graph-lite` vs `flat`). Both arms use TinyBERT | ||
| and `broker.rerank_min_score=0.0` (fill-to-cap, reorder only). The scorer also | ||
| reports a `vector` arm as a ceiling; that arm is not part of the A/B variable. | ||
|
|
||
| Scorer: `scripts/retrieval_eval.py` (retrieval-only, not an official judge). | ||
|
|
||
| On this branch, `scripts/retrieval_eval.py` has the same sha256 as the as-run | ||
| copy (`6e2b69257b1133202ec69fe48e4dcdaf46dfda2162201c804a4a95497d983442`). | ||
| `scripts/retrieval_eval_profiles.py` differs only in `sweep_profile` | ||
| (`rerank_off` now spreads fused defaults, plus a comment wording change). | ||
| This profile uses `bench_profile`, not `sweep_profile`. | ||
|
|
||
| ## Run1 and run2 | ||
|
|
||
| Each table in the PR and in `results/*-summary.json` has two values per arm | ||
| because the same command was run twice (`run1` and `run2`) as a determinism | ||
| check. No component takes a seed; the runner pins `PYTHONHASHSEED=0`. The | ||
| output is not deterministic (`deterministic` is false in both summaries). | ||
|
|
||
| On locomo-conv26, flat beats graph-lite by +21 / +20 hits (+0.1066 / +0.1015 | ||
| R@8) against 1 hit of run-to-run drift on flat (graph-lite R@8 is identical | ||
| across runs). On lme-oracle the run-to-run drift is identical in both arms | ||
| (the same 9 rank flips): flat minus graph-lite is +2/479 hits in both runs, | ||
| which is the same size as the run-to-run drift. So: a clear win on conv-26, | ||
| and no measurable difference on lme. | ||
|
|
||
| The `determinism.run1` / `determinism.run2` fields in the committed summaries | ||
| keep the as-run box paths (`/workspace/fuse/backend-ab/results/...`). A | ||
| checkout `--summarize-pair` regen matches the summaries byte-for-byte except | ||
| those two path strings. `--self-test` checks that. | ||
|
|
||
| ## Rerun | ||
|
|
||
| `run_conv26.sh` and `run_lme.sh` take paths from flags or environment | ||
| (`BIN`, `DATA`, `RESULTS`, `MEMCAP`, `MODEL_CACHE`, `EVAL`) and default to | ||
| repo-relative locations: | ||
|
|
||
| - `BIN`: `$REPO/e0s-results/bin/kimetsu` | ||
| - `DATA`: `$REPO/e0-data/locomo-conv26.json` or `$REPO/e0-data/lme-oracle.json` | ||
| - `RESULTS`: `$REPO/backend-ab-results` (gitignored) | ||
| - `MEMCAP`: `scripts/experiments/e0s/memcap.py` (in-repo) | ||
| - `MODEL_CACHE`: `$REPO/e0s-results/model-cache` | ||
| - `EVAL`: `scripts/experiments/backend_ab/backend_ab_eval.py` | ||
|
|
||
| Example: | ||
|
|
||
| ``` | ||
| BIN=/path/to/kimetsu DATA=/path/to/e0-data/locomo-conv26.json \ | ||
| MODEL_CACHE=/path/to/model-cache \ | ||
| scripts/experiments/backend_ab/run_conv26.sh | ||
| ``` | ||
|
|
||
| Regenerate a summary from committed jsonl: | ||
|
|
||
| ``` | ||
| python3 scripts/experiments/backend_ab/backend_ab_eval.py --summarize-pair \ | ||
| scripts/experiments/backend_ab/results/run1/locomo-conv26.jsonl \ | ||
| scripts/experiments/backend_ab/results/run2/locomo-conv26.jsonl | ||
| ``` | ||
|
|
||
| The as-run box paths that produced the committed results are in `as-run.env`. | ||
| Commit 1 also keeps the original hardcoded runners | ||
| (`git show 8257c3a3:scripts/experiments/backend_ab/run_conv26.sh`). The as-run | ||
| memcap was the box copy `/workspace/fuse/e0s/memcap.py` | ||
| (sha256 `6737690dbe820c2a3fe15081510c984c215c56de120ca116902a259f02db446e`); | ||
| the default here is the later in-tree `scripts/experiments/e0s/memcap.py`. | ||
|
|
||
| Data comes from `scripts/prepare_e0_data.py` (locomo-conv26 sha256 | ||
| `a996cc78f35f78d24114800636e4a2425ddf60639254532bfacff35a2013dcd7`, | ||
| lme-oracle sha256 | ||
| `1dcfd431b1a145d2a234e07d1a72f246fbc37019bb4e3409a6a191beb965b129`). | ||
|
|
||
| ## Binary 262f17de | ||
|
|
||
| The recorded runs used `/workspace/fuse/e0s/bin/kimetsu-e0s`, | ||
| `kimetsu 2.11.0 (embeddings)`, sha256 | ||
| `262f17def1cfd67f07aaec325a2f2d23aa058d393adefc463d4bfc4c33391985`. | ||
| The file on the box still hashes to that digest, and `--version` still prints | ||
| `kimetsu 2.11.0 (embeddings)`. | ||
|
|
||
| Box evidence for how it was built: | ||
|
|
||
| - `/workspace/fuse/e0s/run_e0s.log` (2026-11-13 13:16:08 / 13:22:36 ART): | ||
| `building release at 61dc9f01a60999d18d8614e0337272f893643fa0 (Rust == main 19112dae937fb3b1842983943a0def6fad75f4b1)` | ||
| then `built kimetsu 2.11.0 (embeddings) sha256=262f17def1cfd67f07aaec325a2f2d23aa058d393adefc463d4bfc4c33391985`. | ||
| - `/workspace/fuse/e0s/wrapper-sha256.txt` and | ||
| `docs/audits/2026-11-e0s/MANIFEST.md` record the same SHAs. | ||
| - `61dc9f01` is one commit on top of `19112dae` (message: "Add a bench-sweep | ||
| profile..."). GitHub compare shows a scripts-only diff | ||
| (`scripts/e0_eval.py`, `scripts/retrieval_eval_profiles.py`). The box runner | ||
| also required `git diff --quiet 19112dae 61dc9f01 -- crates Cargo.toml Cargo.lock`. | ||
| So the Rust tree equals main `19112dae`. | ||
| - The cargo argv is in `/workspace/fuse/e0s/run_e0s.sh` (the runner that wrote | ||
| `logs/build.log`) and is copied in `docs/audits/2026-11-e0s/MANIFEST.md`. | ||
| `logs/build.log` is cargo's stdout (`Finished release ... in 6m 27s`) and | ||
| does not itself contain the argv. This was not rebuilt here to reconfirm | ||
| the digest, so 262f17de is the sha of that box build, not a sha we | ||
| reproduced in this PR. | ||
|
|
||
| Recorded command (box toolchain under `/workspace/fuse/e0s/toolchain`): | ||
|
|
||
| ``` | ||
| (cd /workspace/fuse/e0s/kimetsu && env \ | ||
| PATH=/home/box/.cargo/bin:/workspace/fuse/e0s/toolchain/bin:/usr/local/bin:/usr/bin:/bin \ | ||
| CXX=/workspace/fuse/e0s/toolchain/zig-cxx \ | ||
| OPENSSL_INCLUDE_DIR=/usr/include OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu \ | ||
| LIBRARY_PATH=/workspace/fuse/e0s/toolchain/lib \ | ||
| CARGO_BUILD_JOBS=2 CARGO_TARGET_DIR=/workspace/fuse/e0s/target \ | ||
| nice -n 19 /home/box/.cargo/bin/cargo rustc -p kimetsu-cli --bin kimetsu \ | ||
| --release --locked --features embeddings -j 2 -- \ | ||
| -C link-arg=-L/workspace/fuse/e0s/toolchain/lib \ | ||
| -C link-arg=-lc++ -C link-arg=-lc++abi -C link-arg=-lunwind) | ||
| ``` | ||
|
|
||
| A portable embeddings build from the same Rust tree is: | ||
|
|
||
| ``` | ||
| cargo build --release --locked -p kimetsu-cli --bin kimetsu --features embeddings | ||
| ``` | ||
|
|
||
| A different toolchain or linker may not reproduce sha256 262f17de | ||
| byte-for-byte. The recorded digest is tied to the box command above. | ||
|
|
||
| ## Timing source for question 81507db6 | ||
|
|
||
| The first lme-oracle attempt died on a 300 s MCP client timeout during a | ||
| ~17 min box stall on 2026-11-29 (memcap silent 13:08:41–13:26:10 ART). The | ||
| call in flight was graph-lite on question `81507db6`. | ||
|
|
||
| The per-call times come from `repro-81507db6/timed.log` (sha256 | ||
| `c1715f2e7a471536db5500c3c5cdacb07f37589e13df7a23d0e5dde7242390db`). | ||
| That log is the output of `timed.py` invoked three times against the as-run | ||
| eval `dbdb3ecc`, after one untimed pass through `run.sh`. Quoted from the | ||
| log, `brain_context` took 1.04 / 1.04 / 1.32 s on graph-lite and | ||
| 0.87 / 0.87 / 1.03 s on flat (8 capsules every time; mcp_start 0.01 s). | ||
| Whole-question wall times were 10.1 / 9.6 / 11.0 s. | ||
|
|
||
| `repro-81507db6/run.sh`, `timed.py`, and `time_reps.sh` now default to | ||
| repo-relative paths. `q.json` is the single-question slice that was used. | ||
|
|
||
| ## Earlier failed attempts (disclosure) | ||
|
|
||
| The reported locomo-conv26 and lme-oracle runs show no chunk reuse in their | ||
| logs. These earlier attempts are not in the committed results; their run-log | ||
| headers are in `results/run-log-headers.txt`. | ||
|
|
||
| - locomo-conv26 died 2026-11-27 (`run_conv26.died-20261127.log`). Same | ||
| binary and data shas; eval sha256 was | ||
| `e61b45e2d0f732f3c27d8240a42f653910d66f7fc6e05d9a15e994293f5375b6` | ||
| (earlier than the as-run `dbdb3ecc` used for the reported conv-26 runs). | ||
| - locomo-conv26 stalled 2026-11-28 (`run_conv26.stalled-20261128.log`). | ||
| Same binary, data, and eval `dbdb3ecc` as the reported conv-26 runs. | ||
| - lme-oracle died 2026-11-29 (`run_lme.died-20261129.log`), the stall | ||
| described above. Eval was `dbdb3ecc`. The reported lme runs used | ||
| `5c371964` (chunk retry). Resolved configs from that dead attempt are | ||
| under the box path `results/run1.lme-died-20261129/` and are not | ||
| committed; the committed resolved-config files are from the successful | ||
| `run1/` and `run2/` writes. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # As-run box paths for the recorded locomo-conv26 and lme-oracle A/B. | ||
| # The committed results were produced with these values, not the repo-relative | ||
| # defaults. Source this only on the box that still has those paths. | ||
| # | ||
| # BIN=/workspace/fuse/e0s/bin/kimetsu-e0s \ | ||
| # DATA=/workspace/fuse/e0/data/locomo-conv26.json \ | ||
| # RESULTS=/workspace/fuse/backend-ab/results \ | ||
| # ... scripts/experiments/backend_ab/run_conv26.sh | ||
| # | ||
| # Binary sha256: 262f17def1cfd67f07aaec325a2f2d23aa058d393adefc463d4bfc4c33391985 | ||
| # locomo-conv26 data sha256: a996cc78f35f78d24114800636e4a2425ddf60639254532bfacff35a2013dcd7 | ||
| # lme-oracle data sha256: 1dcfd431b1a145d2a234e07d1a72f246fbc37019bb4e3409a6a191beb965b129 | ||
| # conv-26 eval sha256: dbdb3ecc7f86f1ad60921b1afe5f075ef44c1b0f90d531cfae68c0505c1c04b6 | ||
| # lme-oracle eval sha256: 5c371964c37b369bf53d63616ba30eb065e921da172252e33fcda2c485035fac | ||
| # memcap (as-run box copy): /workspace/fuse/e0s/memcap.py | ||
| # sha256 6737690dbe820c2a3fe15081510c984c215c56de120ca116902a259f02db446e | ||
| # The repo default is scripts/experiments/e0s/memcap.py (later in-tree copy). | ||
|
|
||
| export BIN=/workspace/fuse/e0s/bin/kimetsu-e0s | ||
| # Set DATA to one of these before launching the matching runner: | ||
| # /workspace/fuse/e0/data/locomo-conv26.json | ||
| # /workspace/fuse/e0/data/lme-oracle.json | ||
| export RESULTS=/workspace/fuse/backend-ab/results | ||
| export MEMCAP=/workspace/fuse/e0s/memcap.py | ||
| export MODEL_CACHE=/workspace/fuse/e0s/model-cache | ||
| export EVAL=/workspace/fuse/backend-ab/backend_ab_eval.py | ||
| export FASTEMBED_CACHE_DIR=/workspace/fuse/e0s/model-cache | ||
| export HF_HOME=/workspace/fuse/e0s/model-cache | ||
| export OPENBLAS_NUM_THREADS=1 | ||
| export HF_HUB_OFFLINE=1 | ||
| export PYTHONHASHSEED=0 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the regen really is byte-for-byte apart from the 2 path lines (checked by hand).
--self-testcompares parsed json with the paths dropped, though, so "self-test checks that" is a bit stronger than what it actually checks.