Skip to content

perf(dashboard): scope Model routing run evidence before expensive queries - #19012

Closed
pelikhan wants to merge 1 commit into
mainfrom
pelikhan-routing-run-detail-performance
Closed

pelikhan wants to merge 1 commit into
mainfrom
pelikhan-routing-run-detail-performance

Conversation

@pelikhan

Copy link
Copy Markdown
Collaborator

Result

Optimizes only Model routing run detail (routing-run), not the overview. Five alternating pairs on the same fully ingested deployed dataset reduced populated-run median readiness 10.438 s → 0.464 s (95.6% lower, 22.5× faster). Readiness waits for all five views and worker responses, cleared pending requests, and settled rendering—not just the shell.

Declarative change and necessary generic support

Routing selection, latest-attempt windows, accounting, correlation, ordering, route bindings and bounds remain in Dashboard Language JSON. The JSON now preserves routing-run-key in correlated accounting, joins on run key + event, and explicitly bounds the one-row accounting view.

The generic compiler honors those declarations by propagating constraints only through preserved window partition keys and mandatory equality join keys. Computed/shadowed fields, limits, nonpartition windows and cross-run baselines remain barriers. The generic native planner evaluates authored run-derived expressions on canonical run identities, then reads evidence through the existing byRun index. It does not parse/invert route keys, recognize routing IDs, create indexes or add a cross-view cache. Matching null-extended orphan identities force fallback.

Remove the app's imperative source-query safety-cap injection and obsolete rewrite helper. Its unrequested limit:100000 ran before route scope and blocked legal pushdown. Authored root/dependency limits retain their semantics. Canonical pagination and fail-closed output budgets remain authoritative; oversized selected scopes still fail rather than truncate. Browser-capacity diagnostics remain.

This complements #19005's exact raw tuple-key seek and #19007's shared page/DAG execution. Neither mechanism is reimplemented; their shared-engine patches apply cleanly. Regenerate catalog JSON from composed declarations when combining branches.

Repeated paired measurements

Baseline checkout: 2de03249512f65fc0eb7ca2a438eac647205f2e2. Both variants use the same hash-verified deployed snapshot, manifest SHA-256 cce19a1f7237786b47a363678ea51e6a685e93a2eca21dd1bd80aac82b605808. Retention pinned to 2026-10-19T18:09:55Z: 575,582 records, 4,073 runs, 138,032 audits throughout. Each variant opens a fresh page against the fully ingested database; alternating pair order accounts for concurrent shared-host work. These are local paired results, not a direct comparison to the historical public 8.77 s measurement.

Populated run: githubnext/gh-aw-cao:39042396467.

Pair Order Before After
1 Before / after 9.931 s 0.475 s
2 After / before 10.299 s 0.464 s
3 Before / after 10.438 s 0.409 s
4 After / before 11.587 s 0.446 s
5 Before / after 12.029 s 0.551 s
Representative Median before Median after Before range After range
Populated 10.438 s 0.464 s 9.931–12.029 s 0.409–0.551 s
Retained evidence-free run (github/gh-aw:37668208348) 10.478 s 0.413 s 9.960–10.514 s 0.379–0.520 s

All 50 view comparisons matched rows/order and availability/completeness/freshness/as-of metadata. Populated outputs remain 1 / 0 / 2 / 32 / 0 rows; the evidence-free run remains empty in all five views. No browser errors.

A separate untimed production-worker storage diagnostic confirms each detail view reads exactly one audits.byRun partition of 99 records, not all 138,032 audits. Identity reads remain: two 4,073-run reads and one 695-workflow read per view. Native reads are omitted by the existing debug recordsRead counter; zero there is not claimed as zero actual work.

Correctness and validation

Regressions cover production-worker parity, exact/correlated ownership, complete/partial/unknown/zero costs, phase separation, resolution roles, missing/malformed/filtered runs, latest-attempt refresh, orphan fallback, cross-run baselines, authored limits and one indexed Audit read per view. Browser coverage checks filtering, missing-run/back navigation on desktop/mobile with IndexedDB and SQLite.

Passed: 371 dashboard unit suites (3,600 tests and one skipped before deleting obsolete cap-helper expectations), final cleanup-focused suites (30 tests), dashboard lint/document validation/typecheck, eight routing browser tests, Overview worker-memory gate, 71 workflow compilations, file-size/diff checks and 36 generated catalog contract tests.

Limitation: the general Lighthouse run scored 99–100 on empty scenarios, but populated-data ingestion timed out after 900 seconds. The complete Lighthouse suite is not claimed as passing. The routing-specific paired benchmark above completed against all original canonical records.

Populated desktop/mobile screenshots will be attached in a PR comment; no screenshots are committed.

Honor declarative run partitions across safe windows and equality joins, evaluate run-derived constraints with existing byRun reads, and remove synthesized source limits that block scope while preserving authored caps and fail-closed budgets.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan

Copy link
Copy Markdown
Collaborator Author

Populated full-site Model routing run detail after all five views settled, using the pinned deployed dataset. Desktop (1440 px) and mobile (390 px); screenshots are not committed.

Populated Model routing run detail at desktop width

Populated Model routing run detail at mobile width

@github-actions

Copy link
Copy Markdown
Contributor
Dashboard dead views

Dead element views (0):
Dead dashboard pages (0):
Analyzed 8 element renderers and 66 dashboard pages across 1 dashboard.json file(s) from dashboard/site/src/components/ui-elements.js.

⚠️ This reachability report is informational and does not block the pull request.
🔎 View the workflow run and report artifact.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Superseded by the single consolidated draft PR #19015 at f0b769c. The reviewed source changes and preservation corrections are collected there, with regenerated catalogs and combined validation. Closing without merging or deleting the source branch; history and original evidence remain available.

@pelikhan pelikhan closed this Oct 19, 2026
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.

1 participant