Skip to content

Sibling parity sweeps: wrapper arity vs primitive, range vs one-element RangeSet, literal entry points #139

Closed

Description

@CaffeinatedCoder

The claim-driven oracles hold each document's promise per type, so they find a bug where a promise is checked and miss it at the sibling site that makes the same promise implicitly. The changelog shows the pattern repeatedly: IsAdjacentTo (6.2.1) → IsStrictlyLeftOf / Except (7.0.0) → RangeSet.Except(TRange) (8.0.0); wrapper arities lagging their primitive set ("as DecimalSet does"); ==/!= untested on 18 of 20 set types until the Stryker run.

A differential sweep between two things that must agree needs no ground truth: whichever side disagrees is the bug.

Scope

Three sweeps in test/CodoMetis.ValueRanges.Conventions.Tests/, one [DynamicData] row per discovered type, each registered in test/oracles/oracles.json with a seed patch it is shown to catch:

  1. Primitive set vs its wrapper arity over an identity wrapper (Int32Set vs Int32Set<Same<int>>): every public operation (Contains/Add/Remove/Union/Intersect/Except/IsSubsetOf/…, equality and the operators), Parse/TryParse (string and span), ToString, JSON write and read, TypeConverter — same value, or the same exception type on the same bad input. The input grid includes whitespace-padded quoted elements, duplicates, out-of-order, empty and the family's extremes.
  2. A range vs the one-element RangeSet holding it: every binary operation over the shape matrix (the spec enumeration DomainParityOracleTests uses, plus bounds at the domain's extremes) — a set operation on one-element sets equals the set built from the range operation's result, and every predicate answers alike.
  3. One literal through the five entry points: string Parse, span Parse, JSON, TypeConverter, IConfiguration binding — an equal value, or all refuse it.

A disagreement found goes through Candidates.Verdict into candidates.json with its own issue.

Done

  • the sweeps pass, or every disagreement is a candidate with an issue
  • a seed per sweep, and dotnet run tools/oracles.cs seeds is green
  • docs/testing.md and docs/oracles.md describe the sweeps

Activity

  1. added
    testsAdds or changes tests only (oracles, harnesses); no library code
    area/rangesRange unions, variants and the shape engines
    area/range-setRangeSet and multirange algebra
    area/value-setsValue set families and wrapper arities
    package/nodatimeAffects CodoMetis.ValueRanges.NodaTime
    area/literalsParse, TryParse and formatting
    package/coreAffects CodoMetis.ValueRanges
    on Oct 17, 2026
  2. CaffeinatedCoder commented on Oct 18, 2026

    @CaffeinatedCoder
    OwnerAuthor

    Implemented in #143. All three sweeps are registered and seeded, and tools/oracles.cs seeds is green. Disagreements found: #141 (new: wrapper JSON element reads accept tokens the primitive refuses) and #109 (known: re-found between a range and its own multirange). The harness trap found on the way, where generic TSet.Parse(string) binds to the span overload, is #142.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/literalsParse, TryParse and formattingarea/range-setRangeSet and multirange algebraarea/rangesRange unions, variants and the shape enginesarea/value-setsValue set families and wrapper aritiespackage/coreAffects CodoMetis.ValueRangespackage/nodatimeAffects CodoMetis.ValueRanges.NodaTimetestsAdds or changes tests only (oracles, harnesses); no library code

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions