Skip to content

claude code vibe feat: add SSR'd /compare/[a]-vs-[b] head-to-head GPU comparison pages#314

Open
functionstackx wants to merge 1 commit intomasterfrom
claude/issue-267-20260505-0421
Open

claude code vibe feat: add SSR'd /compare/[a]-vs-[b] head-to-head GPU comparison pages#314
functionstackx wants to merge 1 commit intomasterfrom
claude/issue-267-20260505-0421

Conversation

@functionstackx
Copy link
Copy Markdown
Contributor

Closes #267

Summary

Adds a new top-level /compare/[slug] route that renders any pair of GPUs from HW_REGISTRY as a focused, indexable, link-shareable head-to-head comparison.

  • Server-rendered (force-dynamic) with JSON-LD ItemList of Product entries — vendor, arch, TDP, best-in-class throughput/TTFT/TPOT pulled from actual benchmark data.
  • Reads from the same cachedQuery blob cache as /api/v1/benchmarks, so /api/v1/invalidatepurgeAll() already flushes compare pages. No time-based revalidation.
  • Slug = <a>-vs-<b>, canonical = alphabetical; non-canonical 307 to canonical.
  • Reuses <InferenceProvider> + <InferenceChartDisplay> — chart, table, controls, PNG/CSV, pan/zoom, unofficial-run overlay path all preserved.
  • Server picks (precision, sequence) defaults that maximise overlap between the pair — /compare/h100-vs-h200 lands on FP8 automatically, not the FP4 site-wide default which has no Hopper data.
  • OG image generator at /compare/[slug]/opengraph-image.
  • Sitemap includes all canonical pairs.
  • 14 unit tests for slug parse / canonicalize / pair-enumeration.

Test plan

  • pnpm typecheck clean
  • pnpm lint clean
  • pnpm test:unit — all 1745 app tests pass (3 pre-existing packages/db TLS failures unrelated)
  • Verified in Playwright: /compare/h100-vs-h200 renders real H100/H200 data with FP8 auto-selected
  • /compare/b200-vs-mi355x — cross-vendor pair renders both with real data
  • /compare/h200-vs-h100 → 307 → /compare/h100-vs-h200
  • /compare/a100-vs-h100 → 404
  • OG image renders (valid PNG, 1200x630)
  • JSON-LD visible in SSR HTML with real metric values
  • Verify unofficial-run overlay at /compare/…?unofficialrun=… on Vercel preview

🤖 Generated with Claude Code

Issue #267. New top-level route that renders any pair of GPUs from the
HW_REGISTRY as a focused, indexable head-to-head comparison.

- `/compare/[slug]` is server-rendered (`force-dynamic`) and reads from the
  same `cachedQuery` blob cache used by `/api/v1/benchmarks`, so the
  existing `/api/v1/invalidate` endpoint (which calls `purgeAll()` →
  `blobPurge()` + `revalidateTag('db')`) also flushes the compare pages
  on each ingest. No time-based revalidation.
- Slug = `<a>-vs-<b>`. Canonical = alphabetical; non-canonical slugs
  redirect (307) to canonical so we get one URL per pair.
- JSON-LD `ItemList` of `Product` entries with vendor, architecture, TDP,
  and best-in-class throughput / TTFT / TPOT pulled from the actual
  benchmark data — consumable by search engines and LLMs.
- Reuses `<InferenceProvider>` + `<InferenceChartDisplay>` so the chart,
  table, controls, PNG/CSV export, pan/zoom, and unofficial-run overlay
  path all carry over unchanged.
- Server picks `(precision, sequence)` defaults that maximise overlap
  between the two GPUs in the pair (so `/compare/h100-vs-h200` lands on
  FP8 instead of the global FP4 default which has no Hopper data). New
  `initialModel` / `initialSequence` / `initialPrecisions` props on
  `GlobalFilterProvider` take effect only when the URL has no override.
- `InferenceProvider` gains `initialActiveHwTypes` to seed the legend
  filter from the slug. The existing `pendingActiveHwTypes` consumer now
  understands bare GPU prefixes (e.g. `h100`) in addition to full
  framework-suffixed hwKeys, so we can pass `[a, b]` without knowing
  which framework configs exist.
- OG image generator at `/compare/[slug]/opengraph-image` produces a
  vendor-coloured side-by-side `A vs B` PNG.
- Sitemap includes all C(n, 2) canonical pairs.
- 14 unit tests for slug parse / canonicalize / pair-enumeration.

Verified in Playwright:
- /compare/h100-vs-h200 → FP8 auto-selected, H100/H200 active in legend,
  others dimmed; both charts render real data.
- /compare/b200-vs-mi355x (cross-vendor) → both shown, real data.
- /compare/h200-vs-h100 → 307 → /compare/h100-vs-h200.
- /compare/a100-vs-h100 → 404.
- OG image renders correctly.

Co-authored-by: functionstackx <functionstackx@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
inferencemax-app Ready Ready Preview, Comment May 5, 2026 4:48am

Request Review

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.

Add SSR'd /compare/[a]-vs-[b] head-to-head GPU comparison pages

1 participant