[Perf-SS] Skip unused accessibility summary walks - #13559
Conversation
📝 WalkthroughWalkthroughThe Linux and Windows accessibility renderers now restrict generic text summaries to unnamed, valueless containers with sufficient plain-text snippets. New platform-specific tests use fake accessibility and UI Automation objects to validate rendering, traversal failures, wrapper elision, and node or depth limits. Native verification now runs the Linux test and enables the Windows PowerShell test on Windows. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 2a5033f5-9b1d-4b61-a63c-7ce2f62b7138
📒 Files selected for processing (5)
config/scripts/verify-computer-native.mjsnative/computer-use-linux/runtime.pynative/computer-use-linux/runtime_render_test.pynative/computer-use-windows/runtime-render.test.ps1native/computer-use-windows/runtime.ps1
Summary
Linux and Windows accessibility snapshots used to perform a depth-four descendant text scan for every node, even though the result can only be published for an unnamed, value-empty generic container. This moves that scan behind the existing eligibility predicate while keeping the row/list-specific summary path unchanged.
ELI5: every item used to ask its descendants for a detailed summary, then most items threw the answer away. Now only the few container items that can show that summary ask for it.
The PR also adds direct Linux and Windows renderer harnesses to the native verification gate. They cover the optimized paths plus anonymous summaries, row summaries, wrapper elision, fail-soft child reads, and node/depth limits.
Performance proof
A controlled harness loaded the exact parent and candidate
runtime.pysources, rendered the same counter-backed accessibility trees, and canonicalized the outputs. Each timing used 5 warmups and 101 alternating parent/candidate pairs, with GC outside the timed region.The grid's child-enumeration calls fell from 7,782 to 4,578 (-41.2%); balanced rows fell from 14,778 to 7,748 (-47.6%).
A source-faithful Windows model showed the same deleted work without making an unverified wall-time claim:
FindAllFindAllCaveat: the timing harness uses in-process fake accessibility objects, so these are controlled renderer costs, not live AT-SPI/UIA device timings. The deterministic reduction in accessibility getter/child calls is the primary proof; real providers make those calls cross process.
No-regression proof
Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm test— direct full Vitest passed 4,582 files / 49,200 tests. The local Node 24node-ptymismatch failed two unrelated fd tests; one renderer test timed out under full-suite contention and passed focused; the cross-version checkout harness independently reproduces a missing staging-directory failure.pnpm buildpnpm verify:computer-native— 72 macOS tests, 8 Linux renderer tests, syntax/guardrails, and signed helper verification passedAI Review Report
Three independent final reviews found no P0/P1/P2 issues across Linux semantic equivalence, PowerShell 5.1/UIA behavior, failure/mutation handling, resource bounds, platform/SSH/folder behavior, remote-wire compatibility, packaging, and performance-claim accuracy.
Review caught an initial test-harness fidelity bug before commit: a PowerShell
PSCustomObjectcollection would not enumerate likeAutomationElementCollection. The harness was replaced with a CLRIEnumerable/Count/Item collection, expanded with failure and boundary cases, and re-reviewed clean.The readiness audit also checked crash/retry/growth, data loss, mobile backward compatibility, macOS/Linux/Windows paths and shells, and Electron packaging. No release-blocking or acceptance-required finding remains.
Security Audit
No production input handling, command execution, auth, secret, network, IPC, dependency, lockfile, or binary surface changes. The optimization removes read-only accessibility calls and introduces no persistent data. Test-only PowerShell compiles fixed local fake types; its GUID-scoped handshake file is created under the system temp directory and removed in
finally. Native tests are not copied into the packaged runtime.Notes