Skip to content

feat(core): Fusion as default recall strategy + benchmark tooling (v0.16.0) - #1134

Closed
ajianaz wants to merge 15 commits into
developfrom
fusion-default-and-bench
Closed

ajianaz wants to merge 15 commits into
developfrom
fusion-default-and-bench

Conversation

@ajianaz

@ajianaz ajianaz commented Aug 28, 2026 •

Copy link
Copy Markdown
Collaborator

What

  • Promote Fusion (weighted RRF of the vector and hybrid rankings (k=60, weights benchmark-tuned)) to the default recall strategy across core/CLI/server/MCP
  • Benchmark harness: --strategy default sentinel, fusion first-class, 3-way RRF simulation tooling
  • Docs + CHANGELOG for 0.16.0

Why

  • Fusion default delivers benchmark-grade recall out of the box (zero-config): fast50 R@5 = 0.9800 vs hybrid 0.9200 / vector 0.9267
  • 3-way RRF (+fts5 arm) simulated on full 500Q fts5 rankings: no-go — 0 flipped questions at any grid weight; ranking-side optimization exhausted
  • Validation: parity proven (implicit default == explicit fusion, ≠ hybrid), local ARM zero-config fast10 R@5 = 0.9667 / R@10 = 1.0

Testing

  • 520+ unit tests green (pre-existing suite)
  • Parity test binary 0.16.0: default==fusion rankings identical; default≠hybrid
  • fast10 zero-config local run: R@5=0.9667, R@10=1.0000, NDCG@5=0.9643
  • 3-way sim cross-check: fts5-only R@5 sim 0.8211 vs harness 0.820 ✅
  • Modal fts5 collection 500Q complete (10/10 shards, resume-safe via volume)

ajianaz added 15 commits August 28, 2026 14:42
x86 re-simulation using ACTUAL Modal rankings (results_modal_vector +
results_modal_hybrid_fresh_post1130) shows:
- vec×1.5: R@5=0.9600 (4 fails: gpt4_8279ba03, 60472f9c, 862b... etc)
- vec×1.7: R@5=0.9800 (3 fails, gpt4_8279ba03 fixed at rank≤5)
- plateau [1.7, 1.9] all → 0.9800

wv=1.7 chosen (mid-plateau, not edge). The default remains 1.5 in
run_eval.py; production runs pass --fusion-primary-weight 1.7.
Re-simulation on ACTUAL x86 Modal rankings (results_modal_vector +
results_modal_hybrid_fresh_post1130) instead of ARM-local rankings:
- wv=1.5: R@5=0.9600 (4 fails, incl. gpt4_8279ba03 at 0.0)
- wv=1.7: R@5=0.9800 (gpt4_8279boss rank pushed <=5)
- plateau [1.7, 1.9] -> 0.9800; 1.7 = mid-plateau

Also fixes stale help text (default: 1.7).
The wv=1.7 confirm run silently returned the cached wv=1.5 shards:
variant key 'vector_fusion' was shared by both weights. Weight is now
part of the variant key (vector_fusion1.7 vs vector_fusion1.5), and
--fusion-weight passes the value through to run_eval so the cache key
matches what actually ran (#1129 pattern applied to fusion).
Adds the Fusion strategy to the public enum with exact-match parsing
and kebab-case serde, plus roundtrip tests. Dispatch returns a loud
Validation error until the arm is wired in the follow-up commit —
never a silent fallback to another strategy.

Benchmark evidence (#1123): vector and hybrid fail on disjoint
question sets; weighted RRF fusion (vector x1.7 + hybrid x1, k=60)
reaches R@5 0.98 vs 0.9267 hybrid on LongMemEval fast50.
The strategy match inside recall_hybrid moves verbatim into a private
compute_recall method. The dispatcher (cache check, cache put,
salience/recency boosts, truncation) is unchanged — pure refactor,
zero behavior change, full workspace tests green.

Fusion (#1123) will call compute_recall twice (Vector + Hybrid) and
fuse the rankings, bypassing the per-sub-call cache so the dispatcher
applies boosts exactly once.
Wires RecallStrategy::Fusion into compute_recall: runs the Vector and
Hybrid sub-strategies at boost_window depth and fuses their rankings
with the benchmark-tuned weights (vector x1.7, hybrid x1.0, k=60).
Sub-calls bypass the cache/boost layer; the dispatcher applies
salience/recency boosts exactly once and caches the fused set —
mirroring the harness semantics that measured fast50 R@5 0.98.

Includes rrf_fuse_weighted helper (unit-tested: overlap wins + dedup,
weight-driven ordering, empty inputs) and end-to-end integration
tests: on-topic memory ranks first, cold/warm cache parity, empty
store returns empty (no silent fallback, no error).
Moves #[default] from Hybrid to Fusion: every recall that does not
specify a strategy now uses the benchmark-proven weighted RRF fusion
(vector x1.7 + hybrid x1, k=60; fast50 R@5 0.98 vs 0.9267 hybrid).

Behavior change ONLY for implicit-default callers; explicit
strategy=default_strategy config is untouched. 0.x semver: minor
version bump (0.16.0) carries this change.
- default_strategy: hybrid -> fusion (0.16.0, #1123)
- UTEKE_RECALL_STRATEGY env var accepts 'fusion'
- generated-config template and --help text list fusion
- default_recall_config test asserts fusion

Explicit [recall].default_strategy in user configs still wins via the
overlay merge — only the implicit default changes.
Implicit fallback when a request omits strategy and uteke.toml has no
default_strategy: Hybrid -> Fusion (#1123, 0.16.0), matching the core
enum default and CLI default_strategy. The 400 message for invalid
strategy values now lists all five strategies. Request-level strategy
and config default_strategy semantics unchanged.
MCP recall tool schema gains 'fusion' (default since 0.16.0, #1123);
implicit fallback when the client omits strategy: Hybrid -> Fusion,
matching core/CLI/HTTP defaults. Invalid-strategy error lists all five
strategies. Explicit client strategy values are unchanged.
run_eval.py --strategy fusion exercises the IN-CORE default path
(uteke 0.16.0+ weighted RRF), distinct from the harness-level --fusion
flag which post-processes two CLI recalls. Enables the zero-config
validation run: --strategy fusion on a default-config binary.
- CHANGELOG 0.16.0: fusion strategy added, default hybrid -> fusion
  (implicit-default callers only; explicit config untouched)
- docs/configuration.md: default_strategy fusion + env var table
- docs/benchmarks.md: fusion pipeline + fast50 numbers
- benchmarks/longmemeval/RESULTS.md: fusion run row, disjoint-failset
  explanation, tuning evidence (plateau 1.7-1.9 on actual x86 rankings)
- workspace + crates 0.15.0 -> 0.16.0
'default' omits --strategy in the recall command so the binary's own
implicit default (0.16.0: fusion) is exercised — validates that a
fresh install with no config gets benchmark-grade recall out of the
box (#1123).
- Parity proven: implicit default == explicit fusion (identical top-10)
- Divergence from hybrid confirmed (default is not the old behavior)
- fast10 zero-config: R@5 0.9667, R@10 1.0, NDCG@5 0.9643
- 1 partial miss @5 (60472f9c) matches known hard question from
  the Modal x86 fusion run (#1123)
- collect fts5-only rankings 500Q via modal fanout (fix: bake temporal.py
  + mmr.py into image)
- 3-way grid best = 2-way shipped (0 flipped questions at any weight)
- fts5-only 500Q baseline R@5=0.8211 (matches harness 0.820)
- ranking-side optimization exhausted; next headroom is insert granularity
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz ajianaz closed this Aug 28, 2026
@ajianaz
ajianaz deleted the fusion-default-and-bench branch August 28, 2026 23:00
@ajianaz ajianaz changed the title Fusion as default recall strategy + benchmark tooling (v0.16.0) feat(core): Fusion as default recall strategy + benchmark tooling (v0.16.0) Aug 28, 2026
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