Skip to content

test: measure a sibling minority against half the family and the largest cluster - #243

Merged
CaffeinatedCoder merged 3 commits into
mainfrom
fix/236-clone-sweep-small-families
Oct 18, 2026
Merged

CaffeinatedCoder merged 3 commits into
mainfrom
fix/236-clone-sweep-small-families

Conversation

@CaffeinatedCoder

Copy link
Copy Markdown
Owner

Closes #236

Problem

#200's minority (count == 1 || count * 3 < n) never holds for a pair in the NodaTime families (5 value sets, 5 arities, 4 ranges). The pre-tag analysis copied #200's seeded hash into InstantSet and LocalTimeSet, and CloneDivergenceTests passed.

Change

  • test/oracles/CloneSweep.cs:

    • extra: a member present in fewer than half the family (MinorityDivisor = 2), or in one sibling.
    • lone body: a body shared by fewer siblings than the family's largest body cluster, near a larger cluster as before. For two of five against three, that is now a drift.
    • Groups are still reported once under their joined names. The remarks explain the change.
  • test/oracles/clone-waivers.json: 24 sub-family divergences surfaced, each waived with its reason:

    • discrete vs continuous ranges: the canonical factories, IsDiscrete, the step functions and Values();
    • the TimeSpan-stepped Shift/Expand/Split on the timestamp ranges;
    • the calendar-free InstantSet<T>/LocalTimeSet<T> From;
    • the date/year-month Iso vs ExtendedIso round-trip pattern;
    • the EF storeValue and normalizeValue groups.

    None of the existing waivers went stale.

  • docs/oracles.md and the CloneDivergenceTests remarks state the new measure and its remaining limit. A split that is two against two in a family of four still looks like no consensus.

Tests

  • New seed hash-by-reference-copied-into-two-nodatime-sets.patch: copies GetHashCode() => _elements.GetHashCode() into InstantSet and LocalTimeSet. It is caught as InstantSet + LocalTimeSet · GetHashCode() · lone body. With the old CloneSweep.cs and the same seed, nothing is reported.
  • dotnet run tools/oracles.cs seeds hash-by-reference: both seeds (this one and Clone sweep goes quiet when two new siblings share a divergence #200's Int32Set + Int64Set) CAUGHT.
  • dotnet run tools/oracles.cs clones: 174 divergences, 174 waived, 0 stale. Conventions 395 passed.

🤖 Generated with Claude Code

…est cluster

The #200 minority, fewer than a third of the family, never holds for a
pair in the four- and five-member NodaTime families: a hash copied into
InstantSet and LocalTimeSet passed the sweep. A member is now extra when
fewer than half the family has it, and a body is a lone body when fewer
siblings share it than the family's largest body cluster.

24 sub-family divergences surfaced (discrete vs continuous ranges, the
TimeSpan-stepped ranges, the calendar-bearing NodaTime arities, the store
truncation and normalization groups); each is waived with its reason. The
new seed copies the hash into the two NodaTime sets and is caught; the old
rule passed it. The #200 seed is still caught.

Closes #236

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 package/nodatime Affects CodoMetis.ValueRanges.NodaTime labels Oct 18, 2026
CaffeinatedCoder and others added 2 commits October 18, 2026 22:33
The minority sweep (#236) reports IsInfinity($T) on DateRange,
DateTimeOffsetRange and DateTimeRange as 3 of 9 core ranges. Only the
temporal ranges have extremes that stand for PostgreSQL ±infinity, so
only they keep such a bound under Shift and Expand (#224).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@CaffeinatedCoder
CaffeinatedCoder merged commit 5110ecb into main Oct 18, 2026
@CaffeinatedCoder
CaffeinatedCoder deleted the fix/236-clone-sweep-small-families branch October 18, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

The minority clone sweep can't see a pair in the four- and five-member NodaTime families

1 participant