Repository navigation
Mutations tab: one round of statements, bounded driver reads, no duplicate lollipop - #504
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…icate lollipop A cold Mutations tab ran its table in four rounds of statements, computed the lollipop twice and read 139-162M warehouse rows per load (43-54M on the pre-parity baseline 140c923). Five changes: - The chip check shares the lollipop card's request. With one gene the chips' "which genes are empty" view is the card's own view, and nothing deduplicated it. api.analysis now shares one in-flight request among callers sending the same path and body (each gets a clone; a caller's abort only abandons its own wait), and the check asks with ?oncoprint=spec like the card, so it also shares the card's cached answer. - The lollipop's driver test reads only its genes and study. hotspotKeysSql filtered mutation_derived by studyId, which is not in its sort key, so it read all 19M rows of every study; it now also filters by the study's profile prefix, as the lollipop's own rows do. The OncoKB driver set is limited to the lollipop's genes (6.9M rows read before). The same keys are read by the OncoPrint's and OQL's driver filters. - The mutations view runs its statements at once. Without a search the default columns reach no statement (they matter only for the columns a search reads), so the facts, counts, page and the clinical Freq no longer wait for each other. With a search the facts still come first. - runRows asks for one database's page beside its counts (any table view). An offset at or past the total still keeps no rows. Several databases, or a located patient, keep the sequential walk. A table whose count is 0 now also sends its page statement. - The default columns' facts come from the counts statement. countsSql takes columns to summarise over every row of each part (a range, or up to VALUES_MAX distinct values); runRows merges them across parts by column; the mutations view reads Allele Freq (T) and Cancer Type Detailed's facts from them instead of two more statements over the row source. A backend whose counts carry no summaries falls back to the values statements. Verified: the mutations table (500 rows; and with a search) and the lollipop return the same answers as master for msk_chord_2024 TP53/ALK/TMPRSS2/KRAS, coadread KRAS/APC, msk_impact_2017 EGFR and msk_impact_50k_2026 TP53/KRAS (the lollipop's `types` order aside, which master varies between its own runs). The hotspots, mutcompare, mutations and timeline snapshots were recorded again against the warehouse: their outputs are unchanged, only the statements moved. Tests were written from the rules' table by a separate agent and failed on master where behaviour changed; the summaries and driver reads are run on the fixture study. Seven planted bugs (scripts/mutants/mutations/tab-rounds.ts) are all caught. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q3ezTZkR7ALApvELw1R6WL
alisman
force-pushed
the
session/mutation-perf
branch
from
November 25, 2026 01:40
1ca99a8 to
aff6c35
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A cold Mutations tab took 7.5s to draw on msk_chord_2024 TP53 and 9.7s on msk_impact_50k_2026 TP53, against about 3.5s on the pre-parity baseline (
140c9239). Each load read 139–162M warehouse rows; the baseline read 43–54M. This PR makes five changes, and the answers stay the same.What changed
api.analysisnow shares one in-flight request among callers that send the same path and body. Each caller gets a clone, and a caller's abort only abandons its own wait.?oncoprint=specnow, like the card, so it shares the card's cached answer.hotspotKeysSqlfilteredmutation_derivedbystudyId, which isn't in that table's sort key, so it read all 19M rows. It now also filters by the study's profile prefix, as the lollipop's own rows already do.runRowsasks for one database's page alongside its counts. This applies to every table view.countsSqltakes columns to summarise over every row: a range, or up toVALUES_MAXdistinct values.runRowsmerges the summaries across parts, by column. The mutations view reads Allele Freq (T)'s and Cancer Type Detailed's facts from them, instead of running two more statements over the row source.Rules table
nstill follows the query.valuesSql's range and value set for the same column.truncated. An unknown column throws. Nosummarizeleaves the statement unchanged.runRowswith one database asks for the page without waiting for the counts. An offset at the total gives no rows. Two databases, orlocate, are sequential. Errors propagate with no unhandled rejection. Summaries are present only when every part carried them.Verification
Same answers as master.
/api/analysiswas compared with the result cache off on nine study/gene pairs: msk_chord_2024 TP53, ALK, TMPRSS2 and KRAS; coadread KRAS and APC; msk_impact_2017 EGFR; msk_impact_50k_2026 TP53 and KRAS. Three things were checked:All are identical. The one exception is the order of the lollipop's per-codon
typesarray, which master also changes between two of its own runs.Snapshots. The
hotspots,mutcompare,mutationsandtimelinesnapshots were recorded again against the warehouse. Their.json,.svg,.txtand.htmloutputs are unchanged; only the statements changed.Tests. A separate agent wrote the tests from the table above, without the implementation in view. They fail on master where behaviour changed. The summaries and the driver reads are run on the fixture study.
npm test: 7,516 passed, 0 failed, including the fixture tests.scripts/mutants/mutations/tab-rounds.ts): all caught.Not run locally: the e2e gate. CI runs it on this PR.
Timings
Production builds, one page load at a time, a fresh server per round. Cold, fully drawn, median (min–max), n = 3:
140c9239Warm loads are unchanged, at 0.7–1.0s.
docs/PERFORMANCE.mdhas a new section with these numbers and with what was measured and did not help.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q3ezTZkR7ALApvELw1R6WL