Repository navigation
Description
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
RangeSetresult is compared with the multirange result. - Operations — every range and
RangeSetrelation and value-producing operation with an EF translation (Containsrange/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/IsSupersetOfand the proper pair,Unionthrough the guard-allowed operators only,Remove,Count/cardinality. - Budget — 200 rows per type by default so CI stays fast;
VALUERANGES_FUZZ_ROWSraises it andVALUERANGES_FUZZ_SEEDchanges the seed locally. - Disagreements go through
Candidates.Verdictintotest/oracles/candidates.jsonwith a bug issue each; the sweep is registered inoracles.jsonwith a seed patch, and described indocs/testing.mdanddocs/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