Repository navigation
Send the sweep strip as a bitmap rather than a list of positions - #365
Conversation
A branch's completed-candidate set was serialized as one JSON integer per swept candidate, so the overview's cost grew with the swept fraction of the vocabulary rather than with the vocabulary. One bit per candidate makes the cost constant: 2,476 bytes per branch at 14,855 candidates, whatever the sweep has reached. Measured on the production overview, 412,016 bytes to 34,917. Both renderers decode it. The client tests bits in place instead of building a Set of every swept position on each redraw. SCHEMA_VERSION goes to 4: the key is new and the old one is gone, so a client from before this change must not read the payload as if the strip were simply empty. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PpacbZRqT46b4Duhxq5QNQ
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 27dff10891
ℹ️ 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".
The browser tests set the sweep strip on a report payload from inside the page, so they construct the wire format by hand rather than reading a fixture file. Six such sites still wrote a list of positions, which the client no longer reads, and a strip that decodes to nothing renders as a strip nobody has swept. `SWEEP_BITMAP_JS` builds the bitset once and every site calls it, so a test states the two numbers the format needs -- how many candidates the branch holds, and how many of them are swept -- rather than restating the packing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PpacbZRqT46b4Duhxq5QNQ
|
@codex review again |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
A branch's sweep strip — which candidates have been evaluated — was serialized as
completed_candidate_indexes, one JSON integer per swept candidate. Its cost therefore grew with the swept fraction of the vocabulary, so the payload was smallest when a branch was least interesting and largest when it was nearly done.completed_candidate_bitmapreplaces it: one bit per candidate, base64-encoded, sized by the vocabulary rather than by progress. At 14,855 candidates that is a flat 2,476 bytes per branch regardless of how far the sweep has reached. Measured on the production overview, the whole report went from 412,016 bytes to 34,917.Run-length encoding was considered first and rejected on measurement: six workers claim scattered ranges, so runs are short, and on the worst live branch an RLE strip was still 64.7% of the raw list. A bitset has no fragmented case to degrade into.
The strip keeps full per-position resolution rather than being pre-aggregated into buckets, because the two renderers disagree on resolution — the browser draws up to 50 cells, the terminal 10 to 40 — so any fixed bucketing would be lossy for one of them.
Changes:
report_model.encode_candidate_bitmap/decode_candidate_bitmap, with both emission sites rewired (overview branch rows, branch report).report_client.htmldecodes withatoband testsdone[index>>3] & (1<<(index&7))in place, instead of building aSetof every swept position on each redraw.report_terminal.pydecodes at its call site.SCHEMA_VERSION3 → 4 in both the model and the client. The key is new and the old one is gone, so a client from before this change must not read the payload as though the strip were simply empty.Five codec tests cover round-tripping, the empty set, out-of-range positions, and a corrupt bitmap. Each was proven to fail against a deliberate break: bounds check removed, bitmap sized by highest index rather than by vocabulary, and corruption tolerance removed.
🤖 Generated with Claude Code
https://claude.ai/code/session_01PpacbZRqT46b4Duhxq5QNQ