Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
"audit-ci": "^7.1.0",
"is-ci": "^4.1.0",
"lefthook": "^2.1.9",
"oxfmt": "^0.52.0",
"oxlint": "^1.67.0",
"oxfmt": "^0.54.0",
"oxlint": "^1.69.0",
"rimraf": "^6.1.3",
"typescript": "^6.0.3"
},
"engines": {
"node": ">=18.0.0",
"pnpm": ">=10.0.0"
},
"packageManager": "pnpm@11.5.0"
"packageManager": "pnpm@11.5.2"
}
2 changes: 1 addition & 1 deletion packages/app/cypress/e2e/url-params.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const assertNoHydrationMismatch = () => {
cy.get('@consoleError').then((spy) => {
const calls = (spy as unknown as { args: unknown[][] }).args;
const hydration = calls.filter((args) =>
args.some((a) => typeof a === 'string' && /hydrat(ion|ed) (mismatch|failed)/iu.test(a)),
args.some((a) => typeof a === 'string' && /hydrat(?:ion|ed) (?:mismatch|failed)/iu.test(a)),
);
expect(hydration, JSON.stringify(hydration)).to.have.length(0);
});
Expand Down
48 changes: 24 additions & 24 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,42 +32,42 @@
"@chenglou/pretext": "^0.0.7",
"@jpinsonneau/html-to-image": "^1.11.13",
"@noble/ciphers": "^2.2.0",
"@posthog/nextjs-config": "^1.9.37",
"@radix-ui/react-accordion": "^1.2.12",
"@radix-ui/react-dialog": "^1.1.15",
"@radix-ui/react-label": "^2.1.8",
"@radix-ui/react-popover": "^1.1.15",
"@radix-ui/react-select": "^2.2.6",
"@radix-ui/react-slot": "^1.2.4",
"@radix-ui/react-switch": "^1.2.6",
"@radix-ui/react-tabs": "^1.1.13",
"@radix-ui/react-tooltip": "^1.2.8",
"@posthog/nextjs-config": "^1.9.54",
"@radix-ui/react-accordion": "^1.2.13",
"@radix-ui/react-dialog": "^1.1.16",
"@radix-ui/react-label": "^2.1.9",
"@radix-ui/react-popover": "^1.1.16",
"@radix-ui/react-select": "^2.3.0",
"@radix-ui/react-slot": "^1.2.5",
"@radix-ui/react-switch": "^1.3.0",
"@radix-ui/react-tabs": "^1.1.14",
"@radix-ui/react-tooltip": "^1.2.9",
"@react-three/fiber": "^9.6.1",
"@semianalysisai/inferencex-constants": "workspace:*",
"@semianalysisai/inferencex-db": "workspace:*",
"@shikijs/rehype": "^4.1.0",
"@tailwindcss/typography": "^0.5.19",
"@tanstack/react-query": "^5.100.14",
"@shikijs/rehype": "^4.2.0",
"@tailwindcss/typography": "^0.5.20",
"@tanstack/react-query": "^5.101.0",
"@vercel/analytics": "^2.0.1",
"@vercel/blob": "^2.4.0",
"@vercel/speed-insights": "^2.0.0",
"adm-zip": "^0.5.17",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"d3": "^7.9.0",
"dompurify": "^3.4.7",
"dompurify": "^3.4.8",
"gray-matter": "^4.0.3",
"iwanthue": "^2.0.0",
"lucide-react": "^1.17.0",
"mp4-muxer": "^5.2.2",
"next": "^16.2.6",
"next": "^16.2.7",
"next-mdx-remote": "^6.0.0",
"next-themes": "^0.4.6",
"posthog-js": "^1.376.3",
"react": "^19.2.6",
"react-dom": "^19.2.6",
"posthog-js": "^1.383.1",
"react": "^19.2.7",
"react-dom": "^19.2.7",
"remark-gfm": "^4.0.1",
"shiki": "^4.1.0",
"shiki": "^4.2.0",
"tailwind-merge": "^3.6.0",
"three": "^0.184.0"
},
Expand All @@ -77,11 +77,11 @@
"@types/adm-zip": "^0.5.8",
"@types/d3": "^7.4.3",
"@types/mdast": "^4.0.4",
"@types/node": "^25.9.1",
"@types/react": "^19.2.15",
"@types/node": "^25.9.2",
"@types/react": "^19.2.17",
"@types/react-dom": "^19.2.3",
"@types/three": "^0.184.1",
"@vitest/coverage-v8": "^4.1.7",
"@vitest/coverage-v8": "^4.1.8",
"cypress": "^15.16.0",
"cypress-split": "^1.24.31",
"dotenv": "^17.4.2",
Expand All @@ -90,10 +90,10 @@
"fake-indexeddb": "^6.2.5",
"jsdom": "^29.1.1",
"tailwindcss": "^4.3.0",
"tsx": "^4.22.3",
"tsx": "^4.22.4",
"tw-animate-css": "^1.4.0",
"typescript": "^6.0.3",
"vitest": "^4.1.7"
"vitest": "^4.1.8"
},
"engines": {
"node": ">=18.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/evaluation/ui/BarChartD3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export default function EvalBarChartD3({ caption }: { caption?: ReactNode }) {
if (url) {
const direct = runIndexByUrl[url];
if (direct !== undefined) return unofficialRunInfos[direct]?.branch;
const idMatch = url.match(/\/runs\/(\d+)/u);
const idMatch = url.match(/\/runs\/(?<runId>\d+)/u);
if (idMatch) {
const viaId = runIndexByUrl[idMatch[1]];
if (viaId !== undefined) return unofficialRunInfos[viaId]?.branch;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ interface FilterChipProps {
*/
function extractRunIdFromUrl(url: string | undefined): string | null {
if (!url) return null;
const m = url.match(/\/actions\/runs\/(\d+)/u);
return m ? m[1] : null;
const m = url.match(/\/actions\/runs\/(?<runId>\d+)/u);
return m?.groups?.runId ?? null;
}

function FilterChip({ label, count, active, onClick, tone }: FilterChipProps) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ interface ExportOptions {
signal?: AbortSignal;
}

const CSS_VAR_RE = /var\(--([^)]+)\)/u;
const CSS_VAR_RE = /var\(--(?<varName>[^)]+)\)/u;
const WATERMARK_HEIGHT = 48;
const WATERMARK_TEXT = 'InferenceX — github.com/SemiAnalysisAI/InferenceX';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export default function ChartDisplay() {
const info = unofficialRunInfos[runIndexByUrl[url]];
return info ? { branch: info.branch, url: info.url } : undefined;
}
const idMatch = url.match(/\/runs\/(\d+)/u);
const idMatch = url.match(/\/runs\/(?<runId>\d+)/u);
if (idMatch && idMatch[1] in runIndexByUrl) {
const info = unofficialRunInfos[runIndexByUrl[idMatch[1]]];
return info ? { branch: info.branch, url: info.url } : undefined;
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/components/inference/utils/paretoLabels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export const parseLabelComponents = (label: string): string[] => {
const parts = label.split('+');
return parts.map((p) => {
// Strip the leading "NxNNN" multiplier (e.g., "1x" or "3x")
const match = p.match(/^\d+x(.+)$/u);
return match ? match[1] : p;
const match = p.match(/^\d+x(?<strategy>.+)$/u);
return match?.groups?.strategy ?? p;
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ const runLinkHTML = (runUrl?: string) =>
const tooltipLine = (label: string, value: string | number) =>
`<div style="color: var(--muted-foreground); font-size: 11px; margin-bottom: 4px;"><strong>${label}:</strong> ${value}</div>`;

const shortenSha = (image: string) => image.replaceAll(/(sha256:[a-f0-9]{7})[a-f0-9]+/giu, '$1…');
const shortenSha = (image: string) =>
image.replaceAll(/(?<shaPrefix>sha256:[a-f0-9]{7})[a-f0-9]+/giu, '$<shaPrefix>…');

const imageTooltipLine = (image: string) =>
`<div style="color: var(--muted-foreground); font-size: 11px; margin-bottom: 4px;">
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/json-ld.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function render(data: object): string {
}

function scriptBody(html: string): string {
const match = html.match(/<script[^>]*>([\s\S]*?)<\/script[^>]*>/iu);
const match = html.match(/<script[^>]*>(?<body>[\s\S]*?)<\/script[^>]*>/iu);
if (!match) throw new Error(`no <script> in: ${html}`);
return match[1];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ import {
isOutdated,
} from './latest-image-utils';

const lightnessOf = (s: string) => Number(s.match(/oklch\(([\d.]+)/u)?.[1] ?? Number.NaN);
const alphaOf = (s: string) => Number(s.match(/\/ ([\d.]+)\)/u)?.[1] ?? Number.NaN);
const lightnessOf = (s: string) =>
Number(s.match(/oklch\((?<lightness>[\d.]+)/u)?.groups?.lightness ?? Number.NaN);
const alphaOf = (s: string) =>
Number(s.match(/\/ (?<alpha>[\d.]+)\)/u)?.groups?.alpha ?? Number.NaN);

describe('daysSince', () => {
it('returns 0 for today', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/components/quotes/quote-utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export function CompanyLogo({ org, logo }: { org: string; logo?: string }) {
}

export function highlightBrand(text: string) {
const parts = text.split(/(InferenceMAX™?|InferenceX™?|InferenceMAX|InferenceX)/giu);
const parts = text.split(/(?<brand>InferenceMAX™?|InferenceX™?|InferenceMAX|InferenceX)/giu);
return parts.map((part, i) =>
/^inference(max|x)/iu.test(part) ? (
/^inference(?:max|x)/iu.test(part) ? (
<span key={i} className="text-brand font-semibold">
{part}
</span>
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/components/unofficial-run-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@ export function UnofficialRunProvider({ children }: { children: ReactNode }) {
const belongsToDismissed = (rowUrl?: string | null) => {
if (!rowUrl) return false;
if (rowUrl === target.url) return true;
const m = rowUrl.match(/\/runs\/(\d+)/u);
return m !== null && m[1] === runId;
const m = rowUrl.match(/\/runs\/(?<runId>\d+)/u);
return m?.groups?.runId === runId;
};

// Compute the filtered chart data BEFORE any setState so we can pass the
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/hooks/useChartExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function applyStyles(el: HTMLElement | null, styles: Partial<CSSStyleDeclaration
}
}

const CSS_VAR_RE = /var\(--([^)]+)\)/u;
const CSS_VAR_RE = /var\(--(?<varName>[^)]+)\)/u;

export function getExportFontFamily(): string {
const isMinecraftTheme =
Expand Down
6 changes: 3 additions & 3 deletions packages/app/src/lib/ai-providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import type { AiProvider } from '@/components/ai-chart/types';

interface ProviderDef {
label: string;
buildRequest(
buildRequest: (
systemPrompt: string,
userPrompt: string,
apiKey: string,
): { url: string; init: RequestInit };
parseResponse(json: any): string;
) => { url: string; init: RequestInit };
parseResponse: (json: any) => string;
}

const PROVIDERS: Record<AiProvider, ProviderDef> = {
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/lib/blog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export interface TocHeading {

export function extractHeadings(rawMdx: string): TocHeading[] {
const stripped = rawMdx.replaceAll(/```[\s\S]*?```/gu, '');
const headingRegex = /^(#{1,3})\s+(.+)$/gmu;
const headingRegex = /^(?<hashes>#{1,3})\s+(?<title>.+)$/gmu;
const headings: TocHeading[] = [];
const seen = new Set<string>();
const parents: string[] = []; // parents[level] = slug of most recent heading at that level
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/lib/chart-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@ describe('buildAvailabilityHwKey', () => {

/** Parse a hex (#rrggbb) or rgb() color into [r, g, b]. */
function parseRgb(color: string): [number, number, number] {
const hex = color.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/iu);
const hex = color.match(/^#(?<r>[0-9a-f]{2})(?<g>[0-9a-f]{2})(?<b>[0-9a-f]{2})$/iu);
if (hex) return [parseInt(hex[1], 16), parseInt(hex[2], 16), parseInt(hex[3], 16)];
const rgb = color.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/u);
const rgb = color.match(/rgb\((?<r>\d+),\s*(?<g>\d+),\s*(?<b>\d+)\)/u);
if (rgb) return [Number(rgb[1]), Number(rgb[2]), Number(rgb[3])];
throw new Error(`Cannot parse color: ${color}`);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/lib/chart-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export function normalizeEvalHardwareKey(

// Strip additional qualifiers not relevant to GPU identification
// e.g., "b200 nb" -> "b200", "h200 cw" -> "h200"
hwName = hwName.replace(/\s+(nb|cw|nv|dgxc|amds|cr|amd)$/iu, '');
hwName = hwName.replace(/\s+(?:nb|cw|nv|dgxc|amds|cr|amd)$/iu, '');

// Try to find a more specific hardware config that includes framework
if (framework) {
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/lib/chunk-load-recovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const RELOAD_GATE_KEY = 'chunk_reload';
* the literal `ChunkLoadError` substring.
*/
const CHUNK_ERROR_RE =
/Loading chunk |Failed to (load|fetch)(?: dynamically imported)? (?:module|chunk)|ChunkLoadError/iu;
/Loading chunk |Failed to (?:load|fetch)(?: dynamically imported)? (?:module|chunk)|ChunkLoadError/iu;

let installed = false;

Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/lib/client-navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import type { MouseEvent } from 'react';

interface RouterLike {
push(href: string): void;
push: (href: string) => void;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/lib/d3-chart/axis-labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function splitLabel(label: string, mode: LabelSplitMode): [string, string
return [label.slice(0, idx), label.slice(idx + 1).replaceAll('\n', ' ')];
}
if (mode === 'parens') {
const match = label.match(/^(.+?)(\s*\(.+\))$/u);
const match = label.match(/^(?<base>.+?)(?<suffix>\s*\(.+\))$/u);
if (!match) return [label, null];
return [match[1], match[2].trim()];
}
Expand Down
44 changes: 22 additions & 22 deletions packages/app/src/lib/d3-chart/layers/test-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,32 +46,32 @@ export interface MockSelection<Datum = unknown> {
/** @internal */ _parent?: MockElement;
/** @internal */ _selector?: string;

attr(
attr: (
name: string,
value: string | number | ((d: Datum, i: number) => string | number),
): MockSelection<Datum>;
style(
) => MockSelection<Datum>;
style: (
name: string,
value: string | number | ((d: Datum, i: number) => string | number),
): MockSelection<Datum>;
text(value: string | ((d: Datum, i: number) => string)): MockSelection<Datum>;
selectAll<D = Datum>(selector: string): MockSelection<D>;
select(selector: string): MockSelection<Datum>;
data<D>(data: D[], keyFn?: (d: D) => string): MockSelection<D>;
join(tag: string): MockSelection<Datum>;
enter(): MockSelection<Datum>;
exit(): MockSelection<Datum>;
append(tag: string): MockSelection<Datum>;
remove(): MockSelection<Datum>;
merge(other: MockSelection<Datum>): MockSelection<Datum>;
each(fn: (this: unknown, d: Datum, i: number) => void): MockSelection<Datum>;
datum<D>(d: D): MockSelection<D>;
empty(): boolean;
nodes(): MockElement[];
node(): MockElement | null;
size(): number;
transition(): MockSelection<Datum>;
duration(ms: number): MockSelection<Datum>;
) => MockSelection<Datum>;
text: (value: string | ((d: Datum, i: number) => string)) => MockSelection<Datum>;
selectAll: <D = Datum>(selector: string) => MockSelection<D>;
select: (selector: string) => MockSelection<Datum>;
data: <D>(data: D[], keyFn?: (d: D) => string) => MockSelection<D>;
join: (tag: string) => MockSelection<Datum>;
enter: () => MockSelection<Datum>;
exit: () => MockSelection<Datum>;
append: (tag: string) => MockSelection<Datum>;
remove: () => MockSelection<Datum>;
merge: (other: MockSelection<Datum>) => MockSelection<Datum>;
each: (fn: (this: unknown, d: Datum, i: number) => void) => MockSelection<Datum>;
datum: <D>(d: D) => MockSelection<D>;
empty: () => boolean;
nodes: () => MockElement[];
node: () => MockElement | null;
size: () => number;
transition: () => MockSelection<Datum>;
duration: (ms: number) => MockSelection<Datum>;
}

// ─── Entry point ─────────────────────────────────────────────────────
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/lib/eval-samples-live.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export interface EvalArtifactConfig {
* single zip; non-disagg artifacts encode a single conc value.
*/
function artifactConcMatches(artifactName: string, targetConc: number): boolean {
const m = artifactName.match(/_conc(\d+(?:x\d+)*)_/u);
const m = artifactName.match(/_conc(?<concList>\d+(?:x\d+)*)_/u);
if (!m) return false;
return m[1].split('x').includes(String(targetConc));
}
Expand Down Expand Up @@ -125,7 +125,7 @@ export async function fetchAndParseSamples(
// lm-eval names samples files `samples_<task>_<timestamp>.jsonl`. There's
// typically one per task; we filter by the requested task name only.
extractZipEntries(buffer, '.jsonl', (entryName, contents) => {
const m = entryName.match(/(?:^|\/)samples_(.+?)_[^_]+\.jsonl$/u);
const m = entryName.match(/(?:^|\/)samples_(?<task>.+?)_[^_]+\.jsonl$/u);
if (!m) return [];
if (m[1].toLowerCase() !== task.toLowerCase()) return [];
collected.push(...mapEvalSamples(contents, tracker));
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/lib/exclusion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ export interface ExclusionSpec {
/** Compiled resolvers for a model's exclusion specs. */
export interface Exclusion {
/** Literal engine family of a participating key (for display), else null. */
familyOf(hwKey: string): string | null;
familyOf: (hwKey: string) => string | null;
/** Comparability-group id of a participating key (for exclusion), else null. */
groupOf(hwKey: string): string | null;
groupOf: (hwKey: string) => string | null;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/lib/gpu-specs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ describe('GPU_SPECS', () => {
const nvidiaGpus = GPU_SPECS.filter((s) => s.vendor === 'nvidia');
expect(nvidiaGpus.length).toBe(6);
for (const gpu of nvidiaGpus) {
expect(gpu.name).toMatch(/^(H|B|GB)/u);
expect(gpu.name).toMatch(/^(?:H|B|GB)/u);
}
});

Expand Down
Loading
Loading