Eval harness: stop hiding hard extraction failures in accuracy - #3
Merged
Conversation
Paired files whose extraction throws no longer vanish from the denominator. Report hard-failure count/share in AccuracySummary, markdown, and JSONL, and add a failure-inclusive accuracy that scores every GT field on those files as incorrect. Keep overallAccuracy/presentAccuracy as successful-extractions-only so CHANGELOG history stays comparable. A/B compare shows hard-failure counts and treats a missing field score as incorrect (Δ −1, not silent 0).
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When extraction throws, the record gets
fieldScores: [], andAccuracySummary.reduceonly walksfieldScores— so a failed file contributes nothing to the denominator. It is not counted as a miss; it disappears.Observed twice during real measurement work in this repo:
Overall field accuracy | 0.0% (0/0)— which reads as "very low accuracy" but actually means "nothing was scored at all".Both mislead in the same direction: failure looks like success at a low score.
What changes
hardFailureper record in the JSONL.overallAccuracy/presentAccuracykeep the successful-extractions-only definition used for the numbers inCHANGELOG.mdfor 0.3.0 and 0.4.0. Silently changing what those names mean would make the project's own history incomparable. Every row in the report is now explicitly labelled with which definition it uses.Behaviour change worth noting in review
ABCompareRunner's per-field delta previously mapped(aCorrect: true, bCorrect: nil)to 0 — a field the baseline got right and the other arm never produced was invisible in the per-file deltas.nilis now treated as incorrect, so that case is a visible −1. This changes existing compare output; it is the point of the PR rather than a side effect.Headline case
Before — every file hard-fails:
After:
Verification
swift build,swift test(root) — 177 tests, no regressionsswift format lint --strict— silentTools/EvalHarnessbuilds; newEvalHarnessTeststarget — 4 tests coveringAccuracySummary.reducefor a mixed run and for a total wipeoutHarness-only;
Sources/Extractis untouched.