Files
romm/backend/handler/database
Sam Dornan 4f59480ae5 fix(backend): correct ranking defects found on a real library
Validating the index against a 12.7k-game library surfaced four problems a
synthetic fixture could not, because each depends on the shape of real
metadata.

Stop penalising well-documented games. Vectors were L2-normalised, on the
assumption that facet counts behave like document length in text retrieval.
They do not: a long document repeating a word is not more relevant, but a game
tagged with three genres and two franchises genuinely has more in common than
one carrying a single tag. Normalising by a vector's own length made every top
match a sparsely-tagged entry -- a Mario compilation matched Golf, F-1 Race and
Pinball (6-8 tokens each) while the actual Mario platformers (12-16 tokens)
were nowhere in the list. Scaling by the library average instead returns
Yoshi's Island, Super Mario 64 and Donkey Kong.

Two hypotheses were measured and rejected on the way: franchise coherence via
genre entropy (Metroid scored higher than Mario, so no signal) and the
franchise/genre weight ratio (five configurations, none of which moved the
result).

Suppress duplicates against each other, not just against the source. Two discs
of one release share an igdb_id and platform, so both took a slot in the same
list. The same game ported to another platform gets its own igdb_id, so it
needs a title comparison rather than an id one.

Diversify across series. Similarity ranking alone made the section a franchise
filter -- five Metroid games for Super Metroid. Slots are reserved at build
time so the stored graph always carries cross-series options, and the per-
series cap is applied when serving so the policy can change without a rebuild.
Capped-out entries backfill a short list in score order.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 21:17:00 -05:00
..
2025-09-04 11:17:00 -03:00
2026-03-12 23:02:12 -04:00
2026-08-01 14:49:58 -04:00
2026-04-06 22:29:55 -04:00
2026-07-19 22:59:37 -04:00