From 69569a5c2bf31f82d0745405e68b1f7bee6c62c0 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Fri, 15 May 2026 07:32:55 -0400 Subject: [PATCH] feat(playlists): expand For You to 100 tracks (Discover parity) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes Fable #414. forYouHeadN/forYouTailN go 12/13 → 50/50 so the For-You snapshot is 100 tracks, matching Discover. Motivated by the shuffle-on-play default that just shipped (#413): a 25-track shuffle pool repeats fast; 100 makes re-plays within a day feel varied. pickHeadAndTail already degrades gracefully when the candidate pool is too thin for a full head/tail split (returns top-N-by-score), mirroring how Discover returns <100 when its buckets are thin — no new edge-case handling needed. No build-path test asserts the For-You total; pickHeadAndTail unit tests pass their own head/tail values so they're unaffected. Co-Authored-By: Claude Opus 4.7 (1M context) --- internal/playlists/system.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/internal/playlists/system.go b/internal/playlists/system.go index 63c1f800..7bb03c20 100644 --- a/internal/playlists/system.go +++ b/internal/playlists/system.go @@ -151,14 +151,22 @@ var systemMixWeights = recommendation.ScoringWeights{ // forYouHeadN is the number of top-scored tracks that anchor the For-You // playlist; forYouTailN is the number sampled from positions 2*headN -// onward, daily-deterministic via tieBreakHash. The 12 + 13 split +// onward, daily-deterministic via tieBreakHash. The 50 + 50 split // (~50% from the tail) gives the user a substantially different mix // day-to-day while preserving a recognizable anchor of strong -// similarity matches. Songs-like-X keeps simple pickTopN (the +// similarity matches. +// +// Sized to 100 to match Discover so the shuffle-on-play default +// (system playlists shuffle when launched from a tile) has a deep +// enough pool that re-plays within a day feel varied. Libraries with +// a thin For-You candidate pool degrade gracefully: pickHeadAndTail +// returns top-N-by-score when the capped pool can't support a full +// head/tail split, exactly as Discover returns fewer than 100 when +// its buckets are thin. Songs-like-X keeps simple pickTopN (the // seed-artist context already frames the "you'll like this" promise). const ( - forYouHeadN = 12 - forYouTailN = 13 + forYouHeadN = 50 + forYouTailN = 50 ) // scoreAndSortCandidates scores every candidate with recommendation.Score