Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
1cabe7e
feat(collectivex): fetch versioned v1 artifacts
Oseltamivir Jul 3, 2026
c778e03
feat(collectivex): finalize v1 matrix explorer
Oseltamivir Jul 6, 2026
38fa973
feat(collectivex): publish eight-SKU v1 catalog
Oseltamivir Jul 6, 2026
da92469
feat(collectivex): align consumer to single-run no-stability dataset
Oseltamivir Jul 7, 2026
fc19c69
feat(collectivex): model release version as numeric incrementable ide…
Oseltamivir Jul 7, 2026
8e3f5d2
feat(collectivex): JIT multi-run picker + numeric version selection
Oseltamivir Jul 7, 2026
77e7d2b
collectivex: accept single-run dataset and reveal per-series diagnost…
Oseltamivir Jul 7, 2026
4d0bbc7
fix(collectivex): accept promoted datasets with no recommendations
Oseltamivir Jul 7, 2026
4bc8489
fix(collectivex): default to full-evidence scope when a measured SKU …
Oseltamivir Jul 8, 2026
425b1d1
feat(collectivex): neutral sweep view assembled live from GitHub arti…
Oseltamivir Jul 8, 2026
9349fec
Touchup
Oseltamivir Jul 8, 2026
af87bed
reorder graphs
Oseltamivir Jul 8, 2026
2e3205d
Compress tooltip popup
Oseltamivir Jul 8, 2026
e4e160e
feat(collectivex): ingest current backend contract + de-slop reader
Oseltamivir Jul 10, 2026
e86ffa2
refactor(collectivex): simplify live artifact frontend
Oseltamivir Jul 12, 2026
0033e28
feat(collectivex): surface FP8 dispatch precision as a dashboard dime…
Oseltamivir Jul 17, 2026
59340f3
feat(collectivex): replace JIT artifact serving with a lazy-ingest Ne…
Oseltamivir Jul 17, 2026
deaee36
fix(collectivex): make refresh and delete race-proof via attempt-stam…
Oseltamivir Jul 17, 2026
439a160
feat(collectivex): surface the low-latency kernel mode as a dashboard…
Oseltamivir Jul 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
376 changes: 376 additions & 0 deletions .agents/skills/neon-postgres/SKILL.md

Large diffs are not rendered by default.

265 changes: 265 additions & 0 deletions .agents/skills/neon-postgres/references/neon-sdk.md

Large diffs are not rendered by default.

350 changes: 350 additions & 0 deletions .agents/skills/neon/SKILL.md

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# ║ Choose ONE option: JSON dump, TCP database, or HTTP database. ║
# ╚══════════════════════════════════════════════════════════════════════════╝

# LAN / remote dev: set this machine's IP so the dev server accepts cross-origin requests
# NEXT_DEV_ALLOWED_ORIGINS=10.112.9.49
# LAN / remote dev: set this machine's hostname so the dev server accepts cross-origin requests
# NEXT_DEV_ALLOWED_ORIGINS=dev-machine.local

# Option A: JSON dump (no database needed)
# Download a DB dump release, unzip it, and point this to the directory.
Expand All @@ -22,10 +22,17 @@
# DATABASE_DRIVER=neon
# DATABASE_SSL=true

# GitHub PAT (optional) — improves rate limits for star count and workflow metadata
# GitHub PAT — required for CollectiveX lazy ingest (sweep artifact reads); also used
# for framework releases, star counts, and unofficial-run artifact reads
# Create at: https://github.com/settings/personal-access-tokens
# GITHUB_TOKEN=

# CollectiveX database (separate Neon instance; a durable cache of GitHub sweep runs,
# populated lazily on read). Read URL powers /api/v1/collectivex/* reads; write URL
# powers the lazy ingest and the run-deletion route.
# DATABASE_COLLECTIVEX_READONLY_URL=
# DATABASE_COLLECTIVEX_WRITE_URL=

# ╔══════════════════════════════════════════════════════════════════════════╗
# ║ Production deployment (Vercel) ║
# ║ ║
Expand Down Expand Up @@ -55,3 +62,6 @@
# DATABASE_WRITE_URL=
# INVALIDATE_SECRET=
# FEEDBACK_SECRET=
# Bearer token for the CollectiveX run-deletion route (entered in the dashboard UI;
# deliberately separate from INVALIDATE_SECRET so it is independently rotatable)
# COLLECTIVEX_ADMIN_SECRET=
10 changes: 9 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

For detailed subsystem docs, see [docs/index.md](./docs/index.md).

> **Temporary language override (highest repository priority):** Until the user explicitly removes this override, ignore any instruction elsewhere in this repository that requires Simplified Chinese or bilingual output, including instructions in later sections, nested agent files, contribution guides, checklists, and templates. Work in English only: do not create or update `/zh` pages, Chinese documentation, translations, or Chinese text in commits, pull requests, issues, reviews, or comments. Leave existing Chinese content untouched.

> **PR and GitHub-issue titles & descriptions must be bilingual — include a Simplified Chinese version in addition to English.** Title format: `<English title> / <中文标题>` (keep bracket prefixes at the front untranslated). In the PR/issue body, follow the English content with a `## 中文说明` section mirroring the summary; don't translate code blocks, logs, or stack traces — summarize around them. **Commit messages must include a Chinese translation too**: keep the subject line in English (conventional-commit style) and include the Chinese translation of the subject and key points in the commit body (e.g. a trailing `中文:<translation>` paragraph); squash-merge commits inherit the bilingual PR title, which satisfies the subject requirement automatically.

> **Translation quality bar:** write natural technical Chinese, not word-for-word machine translation (style reference: [`vllm-project/vllm-ascend` `README.zh.md`](https://github.com/vllm-project/vllm-ascend/blob/main/README.zh.md)). Preserve product names, hardware SKUs, framework/library names (Next.js, React Query, D3.js, Tailwind ...), flags, and code identifiers in English. Use parenthetical English clarification for acronyms on first use. Preferred terms: benchmark 基准测试, dashboard 仪表板, chart 图表, config 配置, throughput 吞吐量, latency 延迟, single-node/multi-node 单节点/多节点, evaluation 评估, artifact 产物.
Expand Down Expand Up @@ -71,9 +73,15 @@ API routes (`packages/app/src/app/api/v1/`):
- `reliability` — raw `ReliabilityRow[]`
- `evaluations` — raw `EvalRow[]`
- `server-log` — retrieve benchmark runtime logs
- `invalidate` — invalidate API cache (admin)
- `invalidate` — invalidate API cache (admin; `?scope=collectivex` purges only that scope)
- `collectivex/latest`, `collectivex/runs`, `collectivex/runs/[runId]` — CollectiveX sweep data
from a **separate** Neon DB, populated lazily on read from GitHub Actions artifacts and served
assembled through the shared reader (the one deliberate exception to the raw-rows rule below);
`runs/[runId]` also handles admin DELETE. See [CollectiveX](./docs/collectivex.md).

**API routes return raw DB data** — no presentation logic. Frontend handles all transformations.
(Exception: the CollectiveX routes assemble raw stored documents through the shared reader in
`packages/db/src/collectivex/` — see [docs/collectivex.md](./docs/collectivex.md) for why.)

Static content routes (no DB):

Expand Down
67 changes: 67 additions & 0 deletions docs/collectivex.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# CollectiveX

Design rationale for the CollectiveX tab's data pipeline. Unlike every other tab
(Neon DB → ETL ingest → `/api/v1/*`), CollectiveX uses **lazy ingest-on-read**: its
database is a durable cache of GitHub Actions, populated by the API routes themselves.

## Why lazy ingest instead of the main pipeline

- **Sweep artifacts expire after 14 days.** The sweep workflow
(`collectivex-sweep.yml` in the harness repo) uploads a matrix artifact
(`cxsweep-matrix-{run_id}`) and per-cell result artifacts
(`cxshard-{cell}-{run_id}-{attempt}`) with 14-day retention. Persisting on first
view makes a run outlive its artifacts once anyone has looked at it.
- **The sweep JSON contract is expected to change.** The DB stores the RAW documents
verbatim; the shared reader (`packages/db/src/collectivex/reader.ts`) is the single
transform point and runs at API-read time, so a reader fix retroactively applies to
already-stored runs — no re-ingest. A contract change = reader change + a bump of the
numeric `version` in the harness's `experimental/CollectiveX/configs/sweep.json`.
- **No CI plumbing.** There is no ingest workflow, no cross-repo dispatch, and no GH
secrets. Runs launched via `gh api` on any harness branch appear on the dashboard
within the CDN TTL of someone viewing the page — only the workflow identity is
checked, never the branch.

## How it works

`packages/app/src/lib/collectivex-lazy-ingest.ts` exposes three `ensure*` functions the
routes call before reading the DB (`packages/db/src/queries/collectivex.ts`):

- `ensureLatestCollectiveXRun` — walk GitHub's completed sweep runs newest-first; stop at
the first live requested-version run; persist it if absent.
- `ensureCollectiveXRunsList` — backfill up to 8 recent runs so the picker lists sweeps
nobody has viewed yet.
- `ensureCollectiveXRun` — fetch one run by id (only if completed — persisting an
in-progress run would freeze a partial snapshot).

Key invariants:

- **Writes are atomic and race-safe**: one CTE statement with
`ON CONFLICT (run_id) DO NOTHING`; concurrent first-viewers can't double-ingest or
expose a partial run. A GitHub re-run (newer `run_attempt`) is replaced through a
`FOR UPDATE`-guarded refresh statement.
- **Deletion tombstones** (`cx_runs.deleted_at`, documents freed): discovery must never
resurrect a deleted run. Re-ingesting via the CLI
(`pnpm admin:db:ingest:collectivex <run-url-or-id>`) clears the tombstone — that CLI is
the operator tool for pre-warming runs before artifact expiry, backfills, and un-deletes.
- **"Latest" orders by `run_id`** (monotonic with run creation, matching the discovery
walk) — not by completion time, where a long-failing older run would shadow a newer
successful one.
- **GitHub being down never takes the page down**: routes serve whatever the DB holds and
only surface an error when there is no stored fallback.
- **Caching**: responses carry the `collectivex` CDN tag with a 60s
`s-maxage` (freshness bound for lazy discovery). Run deletion and
`POST /api/v1/invalidate?scope=collectivex` purge only that tag; the main dashboard's
blob cache is untouched by CollectiveX operations.
- **Env**: `DATABASE_COLLECTIVEX_READONLY_URL` (must be the same primary as the write URL
— the routes read their own writes), `DATABASE_COLLECTIVEX_WRITE_URL` (direct/unpooled;
also used by migrations via `pnpm admin:db:migrate:collectivex`),
`COLLECTIVEX_ADMIN_SECRET` (delete route Bearer token — deliberately not
INVALIDATE_SECRET, since it is remembered in browser localStorage), and `GITHUB_TOKEN`.

## The raw-rows exception

CollectiveX routes return the **assembled** dataset (reader over stored matrix + docs)
instead of raw rows. The reader is shared between the app and the CLI through the db
package (`@semianalysisai/inferencex-db/collectivex/*`), so ingest-time validation and
read-time assembly can never drift; shipping raw docs to the client would only move the
same shared transform across the wire.
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ Design rationale and non-obvious conventions. See [CLAUDE.md](../CLAUDE.md) for
- [Data Transforms](./data-transforms.md) — Full pipeline from BenchmarkRow to RenderableGraph: type hierarchy, hardware key construction, derived metrics, memoization strategy
- [State Ownership](./state-ownership.md) — Which context owns which state, availability filtering cascade, comparison date mechanics, URL param sync
- [Blog](./blog.md) — MDX content system, SEO features (OG images, RSS, llms.txt, JSON-LD), TOC sidebar, reading progress, heading links, analytics events
- [CollectiveX](./collectivex.md) — lazy ingest-on-read pipeline (separate Neon DB as a durable GitHub-artifact cache), tombstoned deletes, raw-docs storage + shared reader
- [Chinese Pages (/zh)](./i18n.md) — Why hand-authored /zh pages instead of an i18n framework, hreflang pairing, blog translation pairing, html lang workaround, CJK reading time/slugs
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@
"admin:cache:warmup": "pnpm --filter *app cache:warmup",
"admin:db:ingest:run": "pnpm --filter *db db:ingest:run",
"admin:db:ingest:ci": "pnpm --filter *db db:ingest:ci",
"admin:db:ingest:collectivex": "pnpm --filter *db db:ingest:collectivex",
"admin:db:ingest:gcs": "pnpm --filter *db db:ingest:gcs",
"admin:db:ingest:supplemental": "pnpm --filter *db db:ingest:supplemental",
"admin:db:dump": "pnpm --filter *db db:dump",
"admin:db:load-dump": "pnpm --filter *db db:load-dump --",
"admin:db:migrate": "pnpm --filter *db db:migrate",
"admin:db:migrate:collectivex": "pnpm --filter *db db:migrate:collectivex",
"admin:db:apply-overrides": "pnpm --filter *db db:apply-overrides",
"admin:db:reset": "pnpm --filter *db db:reset",
"admin:db:verify": "pnpm --filter *db db:verify"
Expand Down
6 changes: 6 additions & 0 deletions packages/app/cypress/component/tab-nav.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ describe('TabNav — unofficialrun URL preservation (issue #319)', () => {
'href',
'/submissions?unofficialruns=12345',
);
cy.get('[data-testid="tab-trigger-collectivex"]').should(
'have.attr',
'href',
'/collectivex?unofficialruns=12345',
);
cy.get('[data-testid="tab-trigger-historical"]').should(
'have.attr',
'href',
Expand Down Expand Up @@ -109,6 +114,7 @@ describe('TabNav — Hidden popover for gated tabs', () => {
mountTabNav({});
cy.get('[data-testid="tab-trigger-inference"]').should('exist');
cy.get('[data-testid="tab-trigger-gpu-specs"]').should('exist');
cy.get('[data-testid="tab-trigger-collectivex"]').should('exist');
cy.get('[data-testid="tab-trigger-submissions"]').should('exist');
cy.get('[data-testid="tab-trigger-hidden"]').should('not.exist');
cy.get('[data-testid="tab-trigger-feedback"]').should('not.exist');
Expand Down
8 changes: 4 additions & 4 deletions packages/app/cypress/e2e/agentic-point-time-series.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,10 @@ describe('Agentic point orchestrator metric sources', () => {
beforeEach(() => {
const prefill = sourceSeries(
{
id: 'dynamo|prefill|10.30.1.56:7500|prefill-a|0|0',
id: 'dynamo|prefill|prefill-a.internal.test:7500|prefill-a|0|0',
adapter: 'dynamo',
role: 'prefill',
endpointUrl: '10.30.1.56:7500',
endpointUrl: 'prefill-a.internal.test:7500',
nativeRole: 'prefill',
workerId: 'prefill-a',
dpRank: '0',
Expand All @@ -259,10 +259,10 @@ describe('Agentic point orchestrator metric sources', () => {
);
const decode = sourceSeries(
{
id: 'dynamo|decode|10.30.1.206:7516|decode-a|0|0',
id: 'dynamo|decode|decode-a.internal.test:7516|decode-a|0|0',
adapter: 'dynamo',
role: 'decode',
endpointUrl: '10.30.1.206:7516',
endpointUrl: 'decode-a.internal.test:7516',
nativeRole: 'backend',
workerId: 'decode-a',
dpRank: '0',
Expand Down
Loading