Skip to content

fix: judge a seed's failing test row by row, not by a marker anywhere in its message - #208

Merged
CaffeinatedCoder merged 2 commits into
mainfrom
fix/seed-known-candidate-per-row
Oct 18, 2026
Merged

CaffeinatedCoder merged 2 commits into
mainfrom
fix/seed-known-candidate-per-row

Conversation

@CaffeinatedCoder

Copy link
Copy Markdown
Owner

Closes #55

Problem

dotnet run tools/oracles.cs seeds decided that a failed test was a "known candidate" whenever its message contained [known candidate: anywhere. One sweep method reports many rows in one message. So when one of those rows matched an unfiled candidate, a seed that broke a different row read as MISSED, even though the sweep had caught it. The seed proof depended on which rows happened to share a method; that is why DecorativeElementContractTests was once split per arity.

Reproduced on main. I registered one RangeSetLiftParityTests row per type as an unfiled candidate, then ran seeds multirange-upper-inc. The tool printed MISSED … all 12 tests pass with the defect planted, while 11 types each failed 21 or more other rows.

Change

  • test/oracles/SeedVerdict.cs (new) holds the rule: a failed test catches the seed when at least one row after the header is not a known candidate. A message with no known row is any other assertion, and catches. It is compiled into the tool through tools/Directory.Build.props and linked into the conventions tests, the same way CloneSweep.cs is, so the tool and its test can't disagree.
  • Candidates.Verdict now lists known-candidate rows last. A message cut short (… and N more) therefore hides known rows first, and "every shown row is known" means every row is. Its judging step is now Candidates.Judge, so a test can feed it candidates directly.
  • tools/oracles.cs uses SeedVerdict.Catches. A failed test whose rows are all known now prints MISSED … every row a known candidate instead of "all tests pass".
  • parser-reads-the-current-culture.patch, re-planted. The full run found this seed MISSED in both its oracles. It passed CultureInfo.CurrentCulture to ParseValue from RangeFormat and SetFormat, but every element ParseValue now ignores its provider (Decimal text beyond 28 significant digits is rounded silently when a literal or JSON array is read #115 for decimal, Integer literals refuse the 0x/0o/0b and digit-separator forms PostgreSQL 16+ reads #127 for the integers). So it applied and planted nothing, and OracleSeedTests can't see that. It now plants the current culture in DecimalLiteral.Parse, the one element parser that still takes a culture.
  • docs/oracles.md: the per-row rule, and the note that a seed can apply and plant nothing, which only the run shows.

Tests

  • SeedVerdictTests (conventions, 7 tests) runs Candidates.Judge output through SeedVerdict.Catches. It covers a mixed message, all-known, cut short with a real row, cut short with all-known, candidate fixed, and plain assertions. With the old substring rule, 3 fail. With the old row order, 1 fails.
  • End to end with the same temporary unfiled candidates as above: seeds multirange-upper-inc now reads CAUGHT … 11 of 12 tests fail.
  • dotnet run tools/oracles.cs seeds, all 50 seeds, Docker up: 69 of 71 (seed, oracle) pairs caught. The 2 misses were the stranded culture seed. Re-planted, it is CAUGHT in CultureEntryPointProbeTests and HostCultureProbeTests, 4 of 53 tests each. So every seed is caught.
  • Conventions 331 passed. Solution builds.

Not covered here: the tool still counts any failing test as a catch, including one that already fails without the seed. A baseline run per oracle would close that gap, at about double the cost.

🤖 Generated with Claude Code

… in its message

tools/oracles.cs seeds counted a failed test as a known candidate whenever its message held
"[known candidate:" anywhere, so a seed that broke a real row beside an unfiled candidate's row read
as MISSED although the sweep caught it (#55). Reproduced on main: with one RangeSetLiftParityTests
row per type registered as an unfiled candidate, multirange-upper-inc-reads-lower-bound.patch read
"MISSED … all 12 tests pass with the defect planted" while 11 types failed 21 or more other rows;
with the fix the same run reads CAUGHT, 11 of 12.

The rule moves to test/oracles/SeedVerdict.cs, compiled into the tool through
tools/Directory.Build.props and linked into the conventions tests, as CloneSweep.cs is: a failed test
catches when one row after the header is not a known candidate. Candidates.Verdict lists the known
rows last, so a message cut short ("… and N more") hides them first, and its judging step is
Candidates.Judge, which SeedVerdictTests drives with an unfiled candidate. A failed test where every
row is known now reads "MISSED … every row a known candidate" rather than "all tests pass".

SeedVerdictTests: the old substring rule fails 3 of 7, the old row order 1.

The full run (`dotnet run tools/oracles.cs seeds`, 50 seeds) then caught 69 of 71 (seed, oracle)
pairs. The two misses were one seed, parser-reads-the-current-culture: it handed the current culture
to element ParseValue methods that no longer read any culture (#115, #127), so it applied and planted
nothing. It is re-planted in DecimalLiteral.Parse and caught again, 4 of 53 tests in each oracle.

Closes #55

Found-By: RV
Defect-Class: PKG

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@CaffeinatedCoder CaffeinatedCoder added this to the 10.0.0 milestone Oct 18, 2026
@CaffeinatedCoder CaffeinatedCoder added the tests Adds or changes tests only (oracles, harnesses); no library code label Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Adds or changes tests only (oracles, harnesses); no library code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Seed tool treats any message containing [known candidate: as known

1 participant