Skip to content

Chore/accuracy score outcome#140

Merged
chrishayuk merged 5 commits into
mainfrom
chore/accuracy-score-outcome
May 24, 2026
Merged

Chore/accuracy score outcome#140
chrishayuk merged 5 commits into
mainfrom
chore/accuracy-score-outcome

Conversation

@chrishayuk

Copy link
Copy Markdown
Owner

No description provided.

chrishayuk and others added 5 commits May 24, 2026 00:12
Replaces the silent filter_map drop in evaluate_parametric /
evaluate_in_context / evaluate_conflict with explicit per-row
ScoreOutcome reporting. Engines whose prefill returns None (Apollo on
store-miss, future RetrievalEngine impls, any opaque failure) now
appear as Skipped rows in the result vector instead of disappearing —
the accuracy JSON's row count finally equals the prompt count.

Schema changes:

- New ScoreOutcome enum (Served, SkippedEmptyPrompt,
  SkippedRetrievalMiss, SkippedBackendUnavailable,
  SkippedInternalError). Flat-tagged serde, exhaustive (no
  #[non_exhaustive]), variants mirror the typed EngineError enum the
  trait extraction will land.
- PromptScore and ConflictScore gain an `outcome` field; their
  score-payload fields (predicted_top1, top1_match, bits_per_token,
  followed_context, parametric_fallback) become Option<T>.
  Correlated optionality enforced by served() / skipped()
  constructors with debug_assert guards.
- StrategySplit gains *_served and *_served_rate per axis as
  required-companion fields to *_match_rate. Match-rate is computed
  over the served subset only (counting skips as zero punishes
  engines for honest reporting; see ROADMAP).
- format_strategy_split emits a conditional second line with served
  denominators only when any axis skipped. Engines that never skip
  print byte-identical output to pre-change.
- CLI summary in accuracy_cmd.rs gains the same conditional format
  via fmt_served_summary; verbose mode marks skipped rows with `·`.

Discoverability-lag fix folded in:

- EngineKind::supported_names() returns the canonical list (was
  hard-coded six-engine string in two bench error sites; now nine
  engines, single source of truth). Two tests enforce that the list
  stays in sync with the EngineKind variant set.

Interim known issue (documented in the PromptScore docstring and the
ROADMAP entry): the JSON's ffn_backend column reports the backend
passed at construction, not the one actually used. For engines whose
trait method dispatches to multiple internal paths with different
FFN usage (markov_residual's CPU vs *_via_executor paths), the
reported value may not reflect which backend actually executed.
Downstream consumers should not condition on ffn_backend for those
engines until the sibling trait extraction lands; see ROADMAP
"P0 — sibling trait extraction for non-K/V engines" for the fix.

Predecessor: the ROADMAP entry is in this commit; it justifies the
interim taxonomy choice and lays out the six-touchpoint refactor
that the schema fix is preparing the ground for.

Tests: 611 -> 611 (parity, no regressions) on the lib suite; 219 +
3 on the CLI; clippy clean across both crates.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@chrishayuk
chrishayuk merged commit a6166c3 into main May 24, 2026
42 of 43 checks passed
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