Repository navigation
fix: judge a seed's failing test row by row, not by a marker anywhere in its message - #208
Merged
Merged
Conversation
… 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]>
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.
Closes #55
Problem
dotnet run tools/oracles.cs seedsdecided 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 whyDecorativeElementContractTestswas once split per arity.Reproduced on main. I registered one
RangeSetLiftParityTestsrow per type as an unfiled candidate, then ranseeds multirange-upper-inc. The tool printedMISSED … 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 throughtools/Directory.Build.propsand linked into the conventions tests, the same wayCloneSweep.csis, so the tool and its test can't disagree.Candidates.Verdictnow 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 nowCandidates.Judge, so a test can feed it candidates directly.tools/oracles.csusesSeedVerdict.Catches. A failed test whose rows are all known now printsMISSED … every row a known candidateinstead of "all tests pass".parser-reads-the-current-culture.patch, re-planted. The full run found this seed MISSED in both its oracles. It passedCultureInfo.CurrentCulturetoParseValuefromRangeFormatandSetFormat, but every elementParseValuenow 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, andOracleSeedTestscan't see that. It now plants the current culture inDecimalLiteral.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) runsCandidates.Judgeoutput throughSeedVerdict.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.seeds multirange-upper-incnow readsCAUGHT … 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 isCAUGHTinCultureEntryPointProbeTestsandHostCultureProbeTests, 4 of 53 tests each. So every seed is caught.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