Repository navigation
fix(blocking): the largest-block figure was n^2, and the UI called it "pairs" - #442
Merged
athvin merged 1 commit intoNov 5, 2026
Merged
Conversation
athvin
force-pushed
the
bm/profile-p6-blocking-pairs-honest
branch
from
November 3, 2026 05:01
9279779 to
53a07b9
Compare
athvin
force-pushed
the
bm/profile-p5-read-api
branch
from
November 3, 2026 05:04
e0dba23 to
d009c8e
Compare
athvin
force-pushed
the
bm/profile-p6-blocking-pairs-honest
branch
from
November 3, 2026 05:04
53a07b9 to
5fc3b9c
Compare
This was referenced Nov 3, 2026
athvin
force-pushed
the
bm/profile-p5-read-api
branch
from
November 3, 2026 07:04
d009c8e to
634a940
Compare
athvin
force-pushed
the
bm/profile-p6-blocking-pairs-honest
branch
from
November 3, 2026 07:04
5fc3b9c to
cca440e
Compare
athvin
force-pushed
the
bm/profile-p5-read-api
branch
from
November 3, 2026 07:23
634a940 to
08701a7
Compare
athvin
force-pushed
the
bm/profile-p6-blocking-pairs-honest
branch
from
November 3, 2026 07:23
cca440e to
1668755
Compare
athvin
force-pushed
the
bm/profile-p5-read-api
branch
from
November 5, 2026 00:18
08701a7 to
a8a1496
Compare
athvin
force-pushed
the
bm/profile-p6-blocking-pairs-honest
branch
from
November 5, 2026 00:18
1668755 to
fe0c9c5
Compare
athvin
force-pushed
the
bm/profile-p5-read-api
branch
from
November 5, 2026 01:18
a8a1496 to
5a3fc94
Compare
athvin
force-pushed
the
bm/profile-p6-blocking-pairs-honest
branch
from
November 5, 2026 01:18
fe0c9c5 to
d9ba7c9
Compare
athvin
force-pushed
the
bm/profile-p5-read-api
branch
from
November 5, 2026 01:56
5a3fc94 to
c742876
Compare
athvin
force-pushed
the
bm/profile-p6-blocking-pairs-honest
branch
from
November 5, 2026 01:56
d9ba7c9 to
5674356
Compare
… "pairs" `GET /blocking-estimate` reported `count_l * count_r` for every block. That is right for `link_only`, where two disjoint sides mean every ordered pair is scored, and WRONG for a dedupe, which compares one table with itself under `uid_l < uid_r` and therefore scores `C(n, 2)`. base_10 is `dedupe_only`, so every block came back roughly twice its real size — 4095 against 253 for fake_1000's largest surname. The number was not buried. `run-cost.tsx` rendered it as "N pairs" in the same panel as the rule's genuine marginal count, so a user comparing the two saw "Adds 1,526 pairs" beside "Jones — 4,095 pairs" when Jones contributes 253. Two figures, one panel, inconsistent by 16x. `LargestBlock::scored_pairs(link_type)` now returns what the run actually scores: the raw product for `link_only`, `C(n, 2)` for dedupe and `link_and_dedupe` (which scores within sources as well as across them, so the same filter applies and the block is one population rather than two). `block_count` keeps its name and meaning and stays pinned by the golden — it is not wrong, it was being asked the wrong question. **Every rule is broken down now, not just the first.** `n_largest` is PER RULE, which is what makes the list comparable across rules instead of a view of whichever happened to be first; the e2e assertion that encoded the old per-estimate meaning is updated rather than loosened. A rule carrying a filter has no breakdown at all, and that now reaches the wire as `has_block_breakdown` — without it, "cannot be enumerated" and "examined, none found" are indistinguishable, and the second reads as reassurance about a rule nobody measured. The UI renders it as "not countable" and says so in prose. `rows` ships beside `pairs` because pairs are QUADRATIC in rows, which is the whole reason one shared value can dominate a run; showing only the derived figure hides the mechanism. The panel now says that too. **The invariant that catches it, which did not exist before:** a block cannot hold more pairs than the rule it belongs to generates, and a dedupe block's pairs are exactly `C(rows, 2)`. Verified by injection — restoring `b.block_count` fails with "a dedupe block's pairs are C(rows, 2); got 4 for 2 rows". The Playwright mock mirrored the server's bad number, so both agreed on a value neither should have produced — the mock-asserts-the-frontend's-belief class again. It now sends `C(rows, 2)` with `rows` and `match_key`, and `mock-fabrication` plus `wire-contract` pass against the corrected shape. Found while writing PR A's `dedupe_block_pairs`, deferred then because it is a response-shape change, and fixed here. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
athvin
force-pushed
the
bm/profile-p5-read-api
branch
from
November 5, 2026 02:26
c742876 to
8165b83
Compare
athvin
force-pushed
the
bm/profile-p6-blocking-pairs-honest
branch
from
November 5, 2026 02:26
5674356 to
e95b978
Compare
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.
Stacked on #426 so the diff is only this fix; GitHub retargets to
mainwhen that merges.The bug
GET /blocking-estimatereportedcount_l * count_rfor every block. That is right forlink_only— two disjoint sides, every ordered pair scored — and wrong for a dedupe, which compares one table with itself underuid_l < uid_rand therefore scoresC(n, 2). base_10 isdedupe_only, so every block came back at roughly twice its real size: 4095 against 253 for fake_1000's largest surname.It was not buried in a payload.
run-cost.tsxrendered it as "N pairs" in the same panel as the rule's genuine marginal count:Two figures, one view, inconsistent by 16×.
The fix
LargestBlock::scored_pairs(link_type)returns what a run actually scores: the raw product forlink_only,C(n, 2)for dedupe andlink_and_dedupe(which scores within sources as well as across them, so the same filter applies and the block is one population rather than two).block_countkeeps its name, meaning and golden. It was never wrong — it was being asked the wrong question.Every rule is broken down now, not just the first
n_largestis per rule, which is what makes the list comparable across rules instead of a view of whichever happened to be first. The e2e assertion that encoded the old per-estimate meaning is updated rather than loosened.A rule carrying a filter condition has no breakdown at all, and that now reaches the wire as
has_block_breakdown. Without it, "cannot be enumerated" and "examined, none found" are indistinguishable — and the second reads as reassurance about a rule nobody measured. The UI shows "not countable" and says in prose that it is a limitation of the estimate, not a clean bill of health.rowsships besidepairsbecause pairs are quadratic in rows. That is the entire mechanism by which one shared value dominates a run, and showing only the derived figure hides it. The panel now explains that too.The invariant that catches it — which did not exist before
A block cannot hold more pairs than the rule it belongs to generates, and a dedupe block's pairs are exactly
C(rows, 2).Verified by injection: restoring
b.block_countfails witha dedupe block's pairs are C(rows, 2); got 4 for 2 rows.The mock was mirroring the bad number
largest_blocksin the Playwright mock sentrows * rowstoo, so mock and server agreed on a value neither should have produced — the mock-asserts-the-frontend's-belief class again, caught here only because the fix forced me to look at it. It now sendsC(rows, 2)withrowsandmatch_key, andmock-fabrication+wire-contractpass against the corrected shape.Verification
the_blocking_estimate_matches_what_a_run_actually_scoresgreen, with the new reconciliation assertions, and observed failing on the injected old behaviour.cargo clippy -p dedupe-core -p er-cli --all-targets -- -D warningsclean.tsc --noEmitclean (0 errors);wire-contract+mock-fabricationpass. I typechecked by symlinking the main checkout'snode_modules— gitignored, and this branch touches no frontend deps — rather than ship unverified TS from a worktree with no install.Found while writing PR A's
dedupe_block_pairs, deferred then because it is a response-shape change, and fixed here.🤖 Generated with Claude Code