I have a directory of AI tools — 4,323 listings, live at aiverse.mindutil.com — and I keep publishing posts about how the numbers on my own pages are produced. Yesterday it was the click counter. Today I went looking for the bottom of my own list, and found that it doesn't have one.
The setup: two "browse everything" pages
My site has three pages whose job is to enumerate the catalog:
-
/ai-tools— the full directory, 24 cards per page, sorted by a mirrored read count -
/top-ai-tools— "🏆 Top AI Tools", 48 cards per page, sorted by rating -
/new-ai-tools— same grid, sorted by the publication date the upstream source gives me
All three render a numbered rank badge on each card on /top-ai-tools (1, 2, 3 …), and the header on that page carries a pill that says "Top 500".
So: how many pages is that, really?
/ai-tools last page linked: 181 (180 × 24 + 3 = 4,323) /top-ai-tools last page linked: 91 (90 × 48 + 3 = 4,323) /new-ai-tools last page linked: 181 The arithmetic is fine. I checked it: I fetched all 91 pages of /top-ai-tools and all the rank badges came out as a contiguous run, 1 … 4,323, no duplicates, no gaps, 4,323 distinct listings, exactly the row count of the table. Pagination integrity: passes.
Then I asked for page 92.
Past the last page, the site stops telling the truth
GET /top-ai-tools?page=92 → HTTP 200. Not a 404, not a redirect to page 91. It renders the same header, the same "🏆 Top AI Tools" title, a rel="prev" link back to page 91, and zero cards.
GET /ai-tools?page=182 is worse, because that page still has a count in its intro copy:
<title>All AI Tools - Browse the Full Directory | AIVerse</title> <h1>All AI Tools</h1> "Explore 4,323 curated AI tools. Use the filters to narrow down by category, pricing and rating." "4,323 tools found" "No tools match your current search and filters. Try removing some filters or searching for something else." <link rel="canonical" href="https://aiverse.mindutil.com/ai-tools?page=182"> <meta name="robots" content="index, follow"> Same page, two contradictory sentences. The "4,323 tools found" line and the empty-state line come from different queries: the count is prisma.tool.count() over the filter (which ignores page), the grid is findMany() with skip/take. Off the end of the list, the count stays at 4,323 and the grid goes empty. The copy layer never hears about the other one.
And it's indexable, with a canonical that points at itself. Page 300: also 200. Page 999999: also 200, also index, follow. I tried six different out-of-range page numbers across four listings; every one answered 200 with robots: index, follow and a self-referencing canonical:
| URL | status | cards | robots | canonical |
|---|---|---|---|---|
/ai-tools?page=182 | 200 | 0 | index, follow | ?page=182 |
/ai-tools?page=300 | 200 | 0 | index, follow | ?page=300 |
/ai-tools?page=9999 | 200 | 0 | index, follow | ?page=9999 |
/ai-tools?page=1e9 | 200 | 0 | index, follow | …?page=1000000000 |
/top-ai-tools?page=92 | 200 | 0 | index, follow | ?page=92 |
/free-ai-tools?page=200 | 200 | 0 | index, follow | ?page=200 |
?page=1e9 deserves its own line. The parser is:
export function parsePage(value: unknown): number { const n = Number(Array.isArray(value) ? value[0] : value); return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1; } Number("1e9") is finite and ≥ 1, so it becomes skip: 23999999976. 0, -1 and abc clamp to page 1 — those are handled; everything numeric just… keeps going. There's no upper bound because the handler doesn't know totalPages yet, and totalPages is computed inside the query it's supposed to guard.
Why I care: this is not only a UX thing. A parameter that accepts unbounded integers and answers 200 + index is a crawl-budget question — it's how a site with 4,443 sitemap URLs ends up with an effectively unlimited set of indexable URLs. The fix is four lines (clamp to totalPages, or return 404 past the end, and canonical any clamped page to the real one). I haven't deployed it, because today's rule for this series was "measure, don't touch the code".
The rank badge is a lie, but not in the way you'd expect
Back to /top-ai-tools. The badge next to each card is a real ordinal — it went 1 to 4,323 with no repeats. The problem is what it's an ordinal of. The order is:
case "rating": return [{ rating: "desc" }, { ratingCount: "desc" }]; Across the whole 4,323-row sweep there are only 258 distinct (rating, ratingCount) pairs. Which means most of my ranking is not a ranking.
rows whose (rating, ratingCount) pair is unique ........ 190 (4.4%) rows that share their pair with at least one other row . 4,133 (95.6%) biggest tie: (4.5, 2 reviews) = 695 rows, ranks 2,217–2,911 second: (5.0, 1 review) = 534 rows, ranks 222–755 695 listings are tied on both numbers at once, and I printed them as rank 2,217 through 2,911 in some order that is decided by the database's scan, not by anything I measured. Within a tie, SQLite gives whatever the scan gives — it's stable when the table doesn't change (I re-fetched page 50 twice, byte-identical), and undefined as a ranking.
That directly breaks the "Top 500" pill in the header. The boundary falls inside the (5.0, 1 review) block:
- 279 rows with 5.0/1 review are inside the Top 500,
- 255 rows with exactly the same two numbers are outside it,
- and 497 of the first 500 rows share their numbers with another row.
The cut line between "top" and "not top" runs through a tie. Nobody decided it; the offset did.
The top of the list has its own problem. Rank 1 is Dall-E 2 with "Rated 6.3 out of 5" (3 reviews) — a rating that is arithmetically impossible on the scale the label claims, which comes from the same mirrored source as everything else, and which beats every 5.0 row precisely because rating: "desc" compares floats first. Rank 2 is Math99th at 5.0 with 28 reviews, tagged RIP AI — as are 83 of my first 500 rows. So the single highest-ranked tool on the site is an out-of-scale artifact, and the second is a product I've labeled as dead. At the other end, 129 rows have no rating at all and still got rank badges (4,195–4,323).
What I'm taking away
- A count and a list from the same filter are two different queries, and "N tools found" above an empty grid is a bug I can now reproduce on demand.
-
index, follow+ self-canonical on unbounded page numbers is a crawl surface I created by not clamping a number. - An ordinal badge is only a claim of order if the sort key actually separates rows. With 258 distinct keys over 4,323 rows, 95.6% of my rank numbers describe a tie.
- If a page says "Top 500", the boundary must be a decision (a threshold, or a documented tie-break), not an artifact of
skip.
The tie-break fix that costs nothing: append a stable unique key ({ id: "asc" }) so at least the order is reproducible rather than merely usually-stable — and then stop printing 4,323 rank numbers for 258 distinguishable positions, or print the band instead ("5.0 ★ · 1 review"). Clamping the page parameter is even cheaper. Both are code changes and I'm not making them in a post.
Full data if you want to check my arithmetic: the ranked shortlists that consume these numbers are at aiverse.mindutil.com/best — that's the one link I'll leave here, and yes, the page I just linked has its own defect sitting in its <title> tag, which is a post for another day.