Repository navigation
perf(screening): keep the counts Papers narrows by, and read a reviewer's papers by their cards - #1616
Conversation
…er's papers by their cards Step one of two (widen, migrate, narrow). Nothing reads the new counts yet: once the backfill has run and checked clean on shared dev, the tab counts and the overview's votes of the last days read them (the next PR). - screeningFacetCounts, an aggregate kept by triggers on papers and votes (convex/screening/facets.ts): each paper under its source, its check and its reason, each vote under its reviewer with where its paper stands, and each cast vote by when. A tab's count under one narrowing becomes a few counted reads. - migrations/screeningFacets counts every paper and vote from before, with `verify` to check none is missing. - One reviewer's papers on Papers are filtered by each paper's card, a few facts, rather than the paper with its abstract: 555 KB read for a page of Included at 5,000 papers before, 235 KB after. - A vote's trigger reads its paper once a mutation: a step of a reading deals 2,000 votes on 200 papers it just made, and read 2,000 times they passed a transaction's 4,096 index ranges (the size tests caught it). - convex/bench/screening-team.bench.ts measures what the pages read on a screening with two reviewers, and checks each count against the cards and votes. - The size tests move time a second a turn: jumped to every timer at once, the watch on a reading woke over and over while the counts were written in batches, and took the reading for one gone quiet.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d18d7b8771
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…settling takes as many papers as its votes fit From Codex's review of this PR and the cross-family review: - A paper moved from one reviewer to another (move, and a reviewer joining) changes only the vote's reviewer; its counts stayed with the first. The vote trigger now moves them. facets.test.ts checks each reviewer's counts against their votes and the cards, read whole, as papers are moved, voted on and settled. - The vote trigger reads every row written back twice, and settling may write a row twice. Thirty people on every paper, then "settled by the first vote", closed 1,450 rows in one batch and passed a transaction's 4,096 index ranges (a new size test; dev without the trigger passes it). Bookkeeping's batches and the steps after a save now take as many papers as 400 vote writes leave room for (VOTE_WRITES, measured: 800 passed, 1,000 didn't).
This is step one of two (widen, migrate, narrow) toward a fast Papers page when it's narrowed by a reviewer, source, check or reason.
Measured on a 5,000-paper screening with two reviewers (
convex/bench/screening-team.bench.ts). Each call reads every card and every vote of the reviewer, and the page runs it again on every vote anyone casts:The "when step two ships" figures come from the same benchmark with both steps applied. Each count matched what the cards and votes say.
In this PR (nothing reads the new counts yet):
screeningFacetCounts, an aggregate kept by triggers onscreeningResultsandscreeningVotes(convex/screening/facets.ts). It counts:migrations/screeningFacetsbackfills every paper and vote from before.verifyreturns how many entries are missing.After merging: push, run
npx convex run migrations/screeningFacets:run, wait formigrations/screeningFacets:verifyto return 0, then step two switches the reads.Write cost: one aggregate entry per paper per narrowing, and one or two per vote. They are queued once per mutation and applied in batches of 1,024. Ten people on 5,000 papers is about 50 batches in the background.
Checks:
tsc,check:convex-rules,check:module-weightandcheck:user-actionspass.convex/limits/maxSizeScreening.test.ts, ten reviewers on 5,000 papers) pass under Convex's limits. They take 687 s here against 366 s ondev. The last successful nightly runs took about 8 minutes of their 30. The 27 November nightly was cancelled at 30 minutes before this change.