Repository navigation
Stop the tuner landing on the same station twice - #82
Merged
Merged
Conversation
Thin pools make repetition obvious. Over 200 draws, Voices pinned to Bangladesh repeated the previous station on 15% of presses, Nepal 10% and Cuba 34%. Two causes: a brand filed under several entries gets several chances, which deduping by stream misses, and nothing stopped the draw landing on the station already playing. Avoiding by id alone left Bangladesh at 5%, because a brand filed twice keeps whichever entry the shuffle put first. Matching on the brand takes all three to 0%. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
raj-khan
added a commit
that referenced
this pull request
Sep 19, 2026
Thin pools make repetition obvious. Over 200 draws, Voices pinned to Bangladesh repeated the previous station on 15% of presses, Nepal 10% and Cuba 34%. Two causes: a brand filed under several entries gets several chances, which deduping by stream misses, and nothing stopped the draw landing on the station already playing. Avoiding by id alone left Bangladesh at 5%, because a brand filed twice keeps whichever entry the shuffle put first. Matching on the brand takes all three to 0%.
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.
What I measured first
You said everything sounded like the BBC. I checked that directly before building anything, and the global draw is already varied: 60 draws gave 50 distinct names and 0 back-to-back repeats, with BBC appearing 2 of 60. Each request hits a random page of the popular list, so that path was fine.
The repetition is in the country-pinned path, which is the one you were using. Over 200 draws with Voices:
Asking for voices in Havana three times and hearing the same reciter each time reads as broken even though the pick is fair. So the "always the same thing" impression is not the BBC dominating, it is thin pools repeating.
Two causes
A brand filed under several entries gets several chances. AL-QURAN BANGLA is in the Bangladesh list twice on different streams, so TASK-74's stream dedupe does not catch it, and it took 21% of the Voices draws.
Nothing stopped the draw landing on the station already playing. The client now sends what is playing as
?heard=.The measurement caught a bug in my first attempt
Avoiding by station id alone only took Bangladesh from 15% to 5%. A brand filed twice keeps whichever entry the shuffle put first, so the id played last time is often not the id that survived this time. Matching on the brand instead takes all three countries to 0%.
A lighter fold than the coverage report's
TASK-77's
brandKeystrips "radio" and "fm" so two directories can be compared. Using that here would merge "Radio One" with "One FM" and shrink an already thin pool, so this one only drops punctuation, accents and a trailing frequency: "Jago Fm" and "Jago FM 94.4" are one brand, "Radio One" and "One FM" stay two. There is a test for both.Checks
npm run lint,npm run format:check,npm run typecheck,npm test(457 passed) andnpm run buildpass, and the full Playwright suite (34 tests) passes locally.