Repository navigation
perf(qa-lab): avoid quadratic lane exclusions - #128072
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 22, 2026, 9:19 PM ET / August 23, 2026, 01:19 UTC. ClawSweeper reviewWhat this changesThe PR changes QA Lab runtime-pair lane exclusion derivation from repeated array membership scans to a Set lookup, reducing planning work for large scenario catalogs. Merge readinessKeep this maintainer-authored, protected PR open: current main still performs the quadratic membership scan, while the proposed Set preserves identity membership and exclusion order with a small, owner-local change. No blocking findings. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherQA Lab turns catalog scenarios and runtime-pair lane options into a resolved suite plan for CLI and dashboard runs. This selector identifies eligible scenarios and reports exclusions before execution begins. flowchart LR
A[Scenario catalog] --> B[Runtime-pair lane selector]
C[Runtime-pair lane request] --> B
B --> D[Provider and channel eligibility]
D --> E[Selected scenarios]
D --> F[Ordered exclusions]
E --> G[CLI suite run]
F --> H[Dashboard and CLI diagnostics]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +1. Total +1 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Merge the canonical-selector optimization after normal exact-head CI and maintainer review; retain the existing output-contract tests rather than adding an implementation-coupled complexity assertion. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main performs Array.includes inside a filter over the same compatible-scenario collection, establishing the quadratic planning path without needing a live provider. Is this the best way to solve the issue? Yes. Replacing only the internal membership representation at the canonical selector preserves the caller-visible IDs and exclusion order while removing repeated linear scans. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d75164c46d43. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready evidence for exact head
No implementation-call-count test was added because it would couple the suite to Ready for repository-native merge. |
|
Merged via squash.
|
Co-authored-by: Amp <[email protected]>
What Problem This Solves
Large QA Lab runtime-pair lane plans repeatedly scanned the full selected-scenario array for every compatible scenario while deriving lane exclusions. This made that owner-local planning step quadratic as scenario catalogs grew.
Why This Change Was Made
The canonical runtime-pair lane selector now builds one identity-preserving
Setfrom selected scenarios and uses constant-time membership checks when deriving the ordered exclusion list.Set.hasand the previousArray.includesboth use SameValueZero, so scenario identity semantics and exclusion ordering are unchanged. Provider behavior, run plans, artifacts, configuration, and errors are unchanged.The quadratic scan originated with the runtime-pair lane selector introduced in #112838. This change was AI-assisted. I reviewed the selector owner, CLI and run-plan callers, catalog behavior, proof harness, and benchmark and understand the resulting behavior.
User Impact
QA Lab developers and operators should see faster runtime-pair suite planning for large scenario catalogs. Current catalog selections and exclusions remain byte-for-byte equivalent.
Evidence
d06cbd3778fb3efb2edb491383cf6418cb361557; parent/current-main proof baseline:fc80a1d2998d00650b346290bbb71c4a0f0398f3.mock-openaiand live-frontier core lanes matched exactly (2,276-byte canonical JSON; SHA-256869ae0db46ee5e267a56f010dd408cbbe04972b0762ee88c6c8419839fa6cc6a).node scripts/check-changed.mjs -- extensions/qa-lab/src/runtime-pair-lane-selection.ts: passed formatting, boundaries, dead exports, production/test typechecks, Oxlint, storage/media/runtime guards, and import-cycle checks.OPENCLAW_BUILD_PRIVATE_QA=1 pnpm build: passed all build phases.runtime-tool-fs-readcompleted with 1 scenario / 1 pass / 0 failures usingmock-openai/gpt-5.6-luna.