Skip to content

Add E0 sweep artifacts and an offline fusion rescore for #68 - #80

Open
RodCor wants to merge 2 commits into
mainfrom
cursor/e0s-artifacts
Open

RodCor wants to merge 2 commits into
mainfrom
cursor/e0s-artifacts

Conversation

@RodCor

@RodCor RodCor commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Why

The E0+sweep measurements for issue #68 currently live only on the box. This PR puts the run summaries, the fusion attribution, and an offline rescore script in the repository so those numbers can be cited from commit paths.

What landed

  • docs/audits/2026-11-e0s/: run1 and run2 summary.md / summary.json, capsule histograms, meta and resolved-config JSON, the locomo-conv26 JSONL, determinism-diff.md, resolved-config-per-arm.json, wrapper-sha256.txt, MANIFEST.md, and SHA256SUMS.
  • scripts/experiments/e0s/fusion_attribution.py (byte-identical to the script that produced the committed attribution) plus attribution-run1.md / .json and attribution-run2.json.
  • scripts/experiments/e0s/fusion_rescore.py: an offline reconstruction of the current hybrid formula, a 95% top-8 set-match gate against tinybert_floor_0_fill_to_cap on run1, and TM2C2 bm25/max_q arms at alpha 0.5–0.8 if that gate passes. The script has been syntax-checked (py_compile, --help) but has not been run against the datasets.

Results are under docs/audits/ because that is the existing home for committed measurement artifacts. /bench/ and /e0s-results/ are gitignored.

What is not in the tree

  • run1/lme-oracle.jsonl (2,355,878 bytes) and run2/lme-oracle.jsonl (2,355,648 bytes). SHA-256 values are in docs/audits/2026-11-e0s/SHA256SUMS. On the box they remain at /workspace/fuse/e0s/results/run{1,2}/lme-oracle.jsonl.
  • Stdout logs (*.log); the repository gitignores them.

Binary used for both runs: sha256 262f17def1cfd67f07aaec325a2f2d23aa058d393adefc463d4bfc4c33391985. Run1 runner: run_e0s.sh at cc7b729, sha256 4b4155f1…. Run2 runner: scripts/experiments/e0s/rerun_run2.sh (PR #79), sha256 0580084a…. Scorer: scripts/retrieval_eval.py via scripts/e0_eval.py --profile bench-sweep. Retrieval only; not an official judge.

How to rerun attribution

The script takes --results, --data, and --out-dir. On the box, with the omitted JSONL still in place:

python3 scripts/experiments/e0s/fusion_attribution.py \
  --results /workspace/fuse/e0s/results \
  --data /workspace/fuse/e0/data \
  --out-dir docs/audits/2026-11-e0s

From a checkout, copy the omitted lme-oracle JSONL into docs/audits/2026-11-e0s/run{1,2}/ and point --results at that directory. See docs/audits/2026-11-e0s/README.md.

Offline rescore (not executed in this PR)

python3 scripts/experiments/e0s/fusion_rescore.py \
  --bin /workspace/fuse/e0s/bin/kimetsu-e0s \
  --data /workspace/fuse/e0/data \
  --results /workspace/fuse/e0s/results/run1 \
  --brains /workspace/fuse/e0s/rescore/brains \
  --out /workspace/fuse/e0s/rescore/out

Per-question eval brains were TemporaryDirectory workspaces and were deleted after each question (/workspace/fuse/e0s/tmp/run{1,2} only has logs). The script rebuilds them with the same binary and caches by chunk-set. locomo-conv26 shares one 419-memory corpus across all questions; lme-oracle has 495 distinct corpora, so a first ingest there is the expensive step.

CI eval-scripts only runs named --self-test commands. It does not compile or execute these two new scripts.

Commit the run1/run2 summaries, capsule histograms, resolved configs, and
determinism diff for the E0 hybrid sweep on issue #68, plus the fusion
attribution script and its outputs. Large lme-oracle JSONL files are left
on the box and recorded by hash. Results live under docs/audits/ because
/bench/ and /e0s-results/ are gitignored.
Reproduce the current hybrid formula from sqlite (FTS bm25, cosine over
stored embeddings, union_max, usefulness/trust/decay, per-kind
normalization, semantic floor, MMR) and gate it against fill_to_cap's
top-8 set. If the match rate is at least 95%, score TM2C2 bm25/max_q
arms at alpha 0.5-0.8. The script does not run a benchmark by default;
brains are rebuilt with the same binary when the per-question temp
databases are missing.

@RodCor RodCor left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fail at 78e0ef1: one must-fix, a wrong and unsourced number in the readme. everything else traces.

what i checked:

  • every committed artifact is byte-identical to the box original. sha256sum -c SHA256SUMS passes, and the omitted lme jsonl hashes and sizes match.
  • summary.json recomputed from the per-row jsonl (2520 stats): all match. summary.md vs summary.json (1764 cells): 0 mismatches. capsule-hist (36 hists): 0 mismatches. determinism-diff: 6291 rows, 1099 changed, per-arm counts identical.
  • reran fusion_attribution.py from this branch: outputs are identical except the lines recording its own path. independent recompute of the kill-rule headline: 197 scored, 132 / 95 with gold, 64 affected, 71 lost. matches.
  • pr body figures (jsonl sizes, binary and runner shas, 419-memory corpus, 495 lme chunk sets) all check out. retrieval-only / not-a-judge labeling is present. no secrets, no binaries.

must-fix

  • README.md:39: "R@8 moved by at most 0.005" is wrong (inline).

should-fix

  • SHA256SUMS:31: commit the lme-oracle jsonl gzipped (~116 KB) so the lme figures can be recomputed from a checkout.
  • MANIFEST.md:10: "deterministic" contradicts determinism-diff.md.
  • fusion_rescore.py: drop it from this pr. nothing cites it, and it fails its own gate when run (inline).
  • fusion_attribution.py: no --self-test in ci, unlike the other e0s scripts.

nits

  • the scripts default to /workspace/fuse paths, so running with defaults writes into that tree. make the paths required.
  • /home/box paths in MANIFEST.md and wrapper-sha256.txt. fine as provenance.

foreman's questions: (1) every number traces to a committed source except README.md:39. lme figures trace only through the off-tree jsonl (sha-pinned). (2) fusion_rescore.py: drop it, or land it later with a fixture test once its gate can pass.

ci at 78e0ef1: 17/22 done and green (CodeQL neutral). Analyze (rust) x2 and test embeddings / macos-15 / windows were still running.

|---|---|
| [MANIFEST.md](MANIFEST.md) | Run manifest (commands, env, binary, data paths). |
| [wrapper-sha256.txt](wrapper-sha256.txt) | SHA-256 of the wrappers and data used for run1. |
| [determinism-diff.md](determinism-diff.md) | Row-level run1 vs run2 comparison. 1099 of 6291 rows changed; R@8 moved by at most 0.005. |

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must-fix: "R@8 moved by at most 0.005" is not true and nothing computes it (determinism-diff.md has no R@8 figures). summary.json all-rows R@8, run1 -> run2: locomo-conv26 rrf_k60 0.487 -> 0.462 (-0.025), lme-oracle rrf_k60 0.624 -> 0.639 (+0.015). it only holds without rrf_k60 (max 0.0042). state the real max and cite run{1,2}/summary.json, or add a per-arm delta table to determinism-diff.md.

c00b010d3cd7bc00fe88eef497cf00dc1689fc055c6267ede238d215860b0e37 ./wrapper-sha256.txt

# omitted (live on the box at /workspace/fuse/e0s/results/...)
# OMITTED e6287fb20b4c984d65e065d57aa7e63769f2ae95d96663269519d568f8434eab run1/lme-oracle.jsonl # omitted,2355878 bytes; /workspace/fuse/e0s/results/run1/lme-oracle.jsonl

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should-fix: with the lme-oracle jsonl off-tree, none of the lme figures can be recomputed from a checkout. gzip -c run1/lme-oracle.jsonl is ~116 KB, so commit run{1,2}/lme-oracle.jsonl.gz and keep the raw sha here.

- build (run1 only; run2 reused the binary): (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)
- data: /workspace/fuse/e0/data/locomo-conv26.json (199 q / 197 scored), /workspace/fuse/e0/data/lme-oracle.json (500 q / 479 scored)
- scorer: /workspace/fuse/e0s/kimetsu/scripts/retrieval_eval.py metrics via scripts/e0_eval.py --profile bench-sweep; retrieval only, no reader, NOT an official judge
- seed: none (deterministic); PYTHONHASHSEED=0. threads: 1 ONNX thread

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should-fix: "seed: none (deterministic)" contradicts determinism-diff.md (verdict NOT DETERMINISTIC, 1099/6291 rows changed). add a line under corrections, like the #79 ones.

RERANK_OFF_ARM = "rerank_off"
DATASETS = ("locomo-conv26", "lme-oracle")
BINARY_SHA256 = "262f17def1cfd67f07aaec325a2f2d23aa058d393adefc463d4bfc4c33391985"
DEFAULT_SANITY_THRESHOLD = 0.95

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should-fix: drop this file from the pr. nothing in docs/ cites numbers from it. i ran it on a 5-question locomo-conv26 subset (temp brains, out and model-cache dirs): it runs end to end but matches 0/5 fill_to_cap sets, so it exits 1 and scores no alpha arms. the binary admits mostly D1:* rows, while the offline sets spread across D4-D18, so the reconstruction is off somewhere (likely freshness or tie-break). the 0.95 gate is also above the binary's own rerun agreement: fill_to_cap top-8 sets are equal run1 vs run2 on 164/199 (0.824) locomo and 464/500 (0.928) lme, 0.898 combined. the body says "not run", but a run is going now (/workspace/fuse/e0s/rescore/conv26-gate.log). land it later with a tiny-fixture test once the gate is calibrated and passes.


def parse_args(argv: list[str]) -> argparse.Namespace:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--results", type=Path, default=DEFAULT_RESULTS)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should-fix: memcap.py and run_e0s.sh each have a --self-test that ci runs (ci.yml eval-scripts). add one here on a tiny inline fixture (two questions, two arms) and wire it in. nit: these defaults (lines 33-35) point at /workspace/fuse, so a bare run writes into that tree. make the paths required.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant