Skip to content

Differential fuzzing sweep: random ranges, RangeSets and value sets against PostgreSQL #104

Closed

Description

@CaffeinatedCoder

Problem

The parity layer against PostgreSQL sweeps shapes and chosen edge values, not random values: ShapeMatrixParityTests asks every ordered pair of a dozen hand-picked ranges, TemporalStoreParityTests the store rule at five instants, UnionCanonicalityTests a fixed set of value-set compositions. Every past value-level defect between memory and the database (IsAdjacentTo 6.2.1, IsStrictlyLeftOf and Except 7.0.0, RangeSet.Except with infinity 8.0.0) was a disagreement the EF translation hid because the SQL was right, and each one was found only after a human picked the row that shows it. Nothing generates rows nobody thought of.

Proposal

A differential fuzzing sweep in test/CodoMetis.ValueRanges.EFCore.PostgreSQL.IntegrationTests:

  • Generator — deterministic and seeded (the seed and row index in every failure line), over every range type the packages define, discovered by reflection (BCL and NodaTime): all five shapes, bounds near the element type's extremes and near each other (equal, adjacent, off by one unit, touching), empties, and RangeSets of 0–5 members. Value sets of every family (closed and wrapper arities) with duplicates, whitespace, culture-sensitive and array-literal-hostile strings, and extreme temporals.
  • Three legs per row, which must all agree: the in-memory result; the EF translation (column operands, and a constant operand on a prefix of the rows) against a fuzz table in its own database; and PostgreSQL evaluating the operator on the literals EF writes. A RangeSet result is compared with the multirange result.
  • Operations — every range and RangeSet relation and value-producing operation with an EF translation (Contains range/element/set, IsContainedBy, Overlaps, IsStrictlyLeftOf/RightOf, DoesNotExtendRightOf/LeftOf, IsAdjacentTo, Merge/range_merge, Intersect, Union, Except, Complement, bounds, inclusivity and shape flags). Value sets: Contains, Overlaps, IsSubsetOf/IsSupersetOf and the proper pair, Union through the guard-allowed operators only, Remove, Count/cardinality.
  • Budget — 200 rows per type by default so CI stays fast; VALUERANGES_FUZZ_ROWS raises it and VALUERANGES_FUZZ_SEED changes the seed locally.
  • Disagreements go through Candidates.Verdict into test/oracles/candidates.json with a bug issue each; the sweep is registered in oracles.json with a seed patch, and described in docs/testing.md and docs/oracles.md.

Done when

The sweep runs green in CI with every disagreement it finds filed and registered, and dotnet run tools/oracles.cs seeds shows its seed caught.

Activity

  1. added
    tests
    area/ranges
    area/range-set
    area/value-sets
    package/efcore
    package/core
    on Oct 17, 2026
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/range-setarea/rangesarea/value-setspackage/corepackage/efcoretests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions