Skip to content

migration: shuffle-property regression for sort tie-break#57

Merged
msmakouz merged 1 commit into
masterfrom
fix/determinism-sort-tiebreak
May 20, 2026
Merged

migration: shuffle-property regression for sort tie-break#57
msmakouz merged 1 commit into
masterfrom
fix/determinism-sort-tiebreak

Conversation

@skhaz
Copy link
Copy Markdown
Contributor

@skhaz skhaz commented May 20, 2026

Why

PR #53 fixed the timestamp/id tie-break in migrations.compare. The existing 3-entry tests verify the contract but don't protect against a future refactor introducing a comparator that is unstable across hash-seeded shuffles.

What

Two new tests permute the input 100 times via math.randomseed and assert find() output is byte-identical:

  • all-missing-timestamp case (the production symptom on Drew Altizer Keeper)
  • mixed missing/tied/unique timestamps

PR #53 added the timestamp/id tie-break in migrations.compare. The
existing 3-entry tests verify the contract but do not protect against
a future refactor that introduces a comparator unstable under repeated
hash-seeded shuffles.

Two new tests permute the input 100 times via math.randomseed and assert
the find() output is byte-identical: one covers the all-missing-timestamp
case (the production symptom on Drew Altizer Keeper), and one covers
mixed missing/tied/unique timestamps.
@skhaz skhaz requested a review from wolfy-j May 20, 2026 14:26
@msmakouz msmakouz merged commit 090a93f into master May 20, 2026
18 checks passed
@msmakouz msmakouz deleted the fix/determinism-sort-tiebreak branch May 20, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants