FA-154 / Storage and queries / Member archive
A top-k query uses distinct score levels instead of the kth row's score · case 04
Tie handling either truncates equivalent rows or admits an extra lower-scoring group beyond the kth-row boundary.
Case contract
Rows are [unique_integer_id,integer_score]. For nonnegative k, return all rows tied with or above the kth row under score-descending ordering, with id ascending within ties. k=0 returns empty; k>=row_count returns all rows.
Why this case matters
Models FETCH FIRST k ROWS WITH TIES using an explicit score-only tie definition and deterministic output order. The task concerns rank cutoff cardinality, not cursor state or duplicate delivery.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| tie straddles a row-count boundary | [[1, 12]] | [[1, 12], [2, 12]] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗