Skip to content

Stop the tuner landing on the same station twice - #82

Merged
raj-khan merged 2 commits into
mainfrom
task-79-spread-draws
Sep 19, 2026
Merged

raj-khan merged 2 commits into
mainfrom
task-79-spread-draws

Conversation

@raj-khan

@raj-khan raj-khan commented Sep 19, 2026 •

Copy link
Copy Markdown
Owner

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:

pool repeated the previous station
Cuba 3 34%
Bangladesh 8 15%
Nepal 10 10%

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 brandKey strips "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) and npm run build pass, and the full Playwright suite (34 tests) passes locally.

raj-khan and others added 2 commits September 19, 2026 11:49
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
raj-khan merged commit 0fc89d9 into main Sep 19, 2026
3 checks passed
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%.
@raj-khan
raj-khan deleted the task-79-spread-draws branch September 19, 2026 04:44
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.

1 participant