Repository navigation
Split equal-sibling buckets by shape once comparisons keep failing - #191
Conversation
The isEqualNode pass bucketed candidates by text content, so siblings with the same text but different markup, like 1000 empty icons whose attributes all change, were compared pair by pair (128ms). Once the failed comparisons in a bucket outnumber its candidates, the bucket is now split by shape, and equal nodes always share a shape, so a target only looks at candidates it could equal, in the same order. A bucket of many also skips its taken prefix, so identical siblings aren't scanned again for each target. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VJNvudrTrB2rfJaLWKRMsc
Codex Review SummaryThis 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. |
|
The Fuzz jobs fail in all three browsers on the same form-state seed, 37653248352 ( This failure isn't from this PR. The seed fails the same way on current main (2e4a5d1) in Chromium locally: There's no fix for it yet, so I haven't ported one. I haven't re-run the jobs either, because the seeds come from the run id and a re-run would hit the same seed. I'm raising the main bug in the project. Generated by Claude Code |
With preserveChanges, a typed textarea with default text and an untouched one of the same name lost the typed one when the target had a single textarea: its default text gave it another outline than the target's, so it couldn't take the target ahead of the untouched one. A textarea's text is only its default value, so the outline now leaves it out. Found by the form-state fuzzer (seed 37653248352). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VJNvudrTrB2rfJaLWKRMsc (cherry picked from commit 95ca297)
|
I ported the fix from #192 into this branch (5da1da2) so the Fuzz jobs can go green. That commit is a no-op here once #192 merges. Generated by Claude Code |
Requested by Joel · project thread
Before: when 1000 empty icons all changed their attributes, the morph took 128ms. The isEqualNode pass groups candidates by text content, so siblings with the same text but different markup were all compared pair by pair. Lists of identical items also rescanned the already-taken candidates for every target.
After: the icon case takes 19ms. 1000 identical items under a changed parent and 1000 icons with one changed are both about 40% faster. Plain lists stay within noise (up to 3%, with one 9% reading on a 3ms case).
The matching result doesn't change. Equal nodes always have the same shape, so splitting a bucket by shape keeps every candidate a target could equal, in the same order.
How: candidates are still grouped by text. Once the failed comparisons in a group outnumber its candidates,
EqualBucketssplits that group by shape, using the shapes the sibling list already caches. A group of more than one candidate also skips the candidates already taken at its start. The identical-sibling ordering uses the same buckets.Tests:
test/new/equal-buckets.browser.test.tspasses on both main and this branch. Coverage is 100%.🤖 Generated with Claude Code
https://claude.ai/code/session_01VJNvudrTrB2rfJaLWKRMsc
Generated by Claude Code