fix(parity): compare playlists_containing_track as a set, accept duration NULL->0 - #518
Open
rickyrombo wants to merge 1 commit into
Open
fix(parity): compare playlists_containing_track as a set, accept duration NULL->0#518rickyrombo wants to merge 1 commit into
rickyrombo wants to merge 1 commit into
Conversation
…tion NULL->0 Two sources of noise on tracks, together 434 of 3,526 sampled rows. Ordering. The reference array is the order playlists were appended and removed over that track's history. It is not derivable from any column: 63% of multi-playlist tracks carry one identical backfill created_at across every row, and where timestamps do differ the array still does not follow them (track 4740 lists a Jul 13 entry before a Jul 10 one). The migration replays playlist_tracks grouped by playlist_id, so its arrays come out ascending. Sorting both sides compares the membership we can reproduce instead of failing on an ordering nobody can. Multiplicity. The reference appends unconditionally, so a track added to one playlist repeatedly is listed repeatedly -- [18598, 18601 x8] for track 161160. The indexer dedupes on purpose. Comparing multisets reports a divergence the indexer is designed to create. duration. The reference leaves it NULL when unknown; the indexer writes 0. Accepted, so it moves to KnownDiffs and is reported rather than counted. Result on the 2026-08-07 snapshot: 87.7% -> 99.9% match rate, 434 mismatches down to 3. The 3 that remain are real membership differences and stay visible, as do the whole-table in_playlists aggregates that catch over-population.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two sources of noise on
tracks, together 434 of 3,526 sampled rows — none of them a defect the migration can fix.Ordering
The reference array is the order playlists were appended and removed over that track's history. It is not derivable from any column.
created_atacross every row4740lists a Jul 13 entry before a Jul 10 oneThe migration replays
playlist_tracksgrouped byplaylist_id, so its arrays come out ascending:Sorting both sides compares the membership we can reproduce instead of failing on an ordering nobody can.
Multiplicity
The reference appends unconditionally, so a track added to one playlist repeatedly is listed repeatedly:
The indexer dedupes on purpose — it checks
@> ARRAY[id]before appending. Comparing multisets reports a divergence the indexer is designed to create.duration
The reference leaves it NULL when unknown; the indexer writes 0 (~99k tracks). Accepted as no semantic difference — absence and zero both mean "no duration known" — so it moves to
KnownDiffsand is reported rather than counted as a mismatch.Result
The 3 remaining are real membership differences and stay visible, as do the whole-table
in_playlistsaggregates that catch over- or under-population.🤖 Generated with Claude Code