Skip to content

test: count range unions by structure, so a stale floor cannot hide a missing one - #229

Merged
CaffeinatedCoder merged 1 commit into
mainfrom
test/union-discovery-floors
Oct 18, 2026
Merged

CaffeinatedCoder merged 1 commit into
mainfrom
test/union-discovery-floors

Conversation

@CaffeinatedCoder

Copy link
Copy Markdown
Owner

Closes #222

Problem

ClosedUnionContractTests.KnownUnions, RangeOrderParityTests and DifferentialFuzzParityTests asserted at least 11 discovered range unions. There have been 13 since the float family, 9 core and 4 NodaTime. So both float unions could drop out of discovery and the closed-union, order and fuzz sweeps would still pass. The same stale 11 was also in CapturedCollectionProbeTests and JsonDefaultContractTests.

Change

  • RangeCensus (conventions project, linked into the integration project like RangeProbes) counts unions by structure: a top-level abstract type that nests a sealed variant implementing IEmptyRange<T>. It does not use the IRangeFactory<,> or IRange<> interface the sweeps discover by, so a union that lost its interface still counts. AssertReachedEveryUnion(reached, sweep) fails and names every union a sweep did not reach. The only fixed floor guards against the census finding nothing: both the core and the NodaTime assembly must hold a union. A new range type needs no edit.
  • The three sweeps the issue names, and the two other sites with the same stale floor (CapturedCollectionProbeTests.Ranges_AnswerAsInMemory, JsonDefaultContractTests.Discovery_FindsEveryRangeAndSetType), now call it instead of the count. MappingParityTests keeps its per-assembly floors, which were already current, and adds the census check.
  • docs/architecture.md (the add-a-type procedure) and docs/testing.md describe the census.

Tests

  • Shown failing. I dropped Float64Range from RangeProbes.AllRangeTypes and Float32Range from FuzzTypes.Ranges, each by name in the discovery filter. Every test failed with its sweep's name, for example EveryUnion_RefusesAnEmittedSubtype_AndStillCopiesItsOwnVariants did not reach 1 of the 13 range unions: Float64Range., and the same for EveryRangeAndMultirange_OrdersAsPostgres and Ranges_AgreeWithPostgres. The filters were then reverted. These are test-side drops, so no src/ seed exists for them. Removing the interface from a union does not compile.
  • The conventions tests (395) and the full integration suite (256) pass.

Not changed here: the knownRows floors (CultureEntryPointProbeTests, JsonOptionsProbeTests, LiteralEntryPointParityTests: 52; LiteralCorpusProbeTests: 48). They count rows over ranges and sets, so they may be stale the same way. They stay "at least" floors, and the census does not cover the set side.

🤖 Generated with Claude Code

… missing one

The range sweeps asserted "at least 11" discovered unions, a count from before the float family
made it 13, so both float unions could drop out of discovery (a broken IRangeFactory<,> or
IRange<> declaration) and the sweeps would still pass. RangeCensus counts unions by what they are:
a top-level abstract type nesting a sealed variant that implements IEmptyRange<T>. Each sweep now
asserts that it reached every union of the census, naming any it missed, with a floor only
against the census finding nothing (both assemblies hold a union).

ClosedUnionContractTests, RangeOrderParityTests and DifferentialFuzzParityTests (named in the
issue), plus the same stale floor in CapturedCollectionProbeTests and JsonDefaultContractTests,
and a census check beside MappingParityTests' per-assembly floors. Dropping Float64Range from
RangeProbes, or Float32Range from FuzzTypes, fails each of them, naming the union.

Closes #222

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 tests Adds or changes tests only (oracles, harnesses); no library code area/ranges Range unions, variants and the shape engines package/nodatime Affects CodoMetis.ValueRanges.NodaTime package/core Affects CodoMetis.ValueRanges labels Oct 18, 2026
@CaffeinatedCoder
CaffeinatedCoder merged commit ae6127e into main Oct 18, 2026
@CaffeinatedCoder
CaffeinatedCoder deleted the test/union-discovery-floors branch October 18, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ranges Range unions, variants and the shape engines package/core Affects CodoMetis.ValueRanges package/nodatime Affects CodoMetis.ValueRanges.NodaTime tests Adds or changes tests only (oracles, harnesses); no library code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discovery floors say 11 range unions; there are 13

1 participant