Repository navigation
perf(ci): shard UI checks and reuse SDK compiler inputs - #134528
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 7:38 PM ET / 23:38 UTC. ClawSweeper reviewWhat this changesThe branch splits Control UI CI tests into three Vitest shards and records compiler-consumed files so plugin SDK declaration caches avoid invalidation from unrelated source changes. Merge readinessKeep open: this maintainer-authored CI/build-tooling change remains active and is not on current main. No concrete introduced defect was proven, but exact-head native CI and the dependency-backed cache contract remain incomplete review gates. Priority: P2 Review scores
Verification
How this fits togetherThe CI workflow runs the Control UI test suite before the final CI gate. Separate build tooling stages and restores plugin SDK declarations, so its cache signature controls whether CI recompiles those declarations. flowchart LR
A[CI preflight] --> B[Control UI shard matrix]
B --> C[Final CI gate]
D[SDK declaration writer] --> E[Compiler input receipts]
E --> F[Cache validation]
F --> G[Staged declaration publish]
G --> C
Before merge
Agent review detailsSecurityNone. PR surfaceTests +204, Docs +12, Config +7, Other +269. Total +492 across 13 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep the shared staged-declaration owner and the bounded three-shard UI design, then complete exact-head native CI and verify the pinned compiler-hook contract and required status contexts. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR changes CI and build-tooling performance rather than reporting an end-user failure. Is this the best way to solve the issue? Unclear: the owner-boundary design and focused regression tests are coherent, but direct verification of the dependency contract and exact-head native behavior remains unavailable. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 43f76f312682. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
The standalone UI job and unnecessarily invalidated SDK declarations are two remaining CI bottlenecks. The latest successful native UI run spent 230.26s in Vitest and 289s in the job, before preflight and final-gate time. SDK declaration cache keys previously included every ordinary source/test/UI/workflow byte, even when neither compiler consumed it.
Current UI runs now use three native Vitest shards through the existing argument/execution owner. All four projects retain their isolation and cleanup policies, with three root Node workers per runner and the unchanged Chromium default. The aggregate job id remains
checks-ui; lint runs once. Both frozen-target shapes retain their original singleton, unsharded commands. The first native run executed disjoint 285/284/284-file partitions covering all 853 files and 13,176 passed cases plus one skip, with exact baseline file/case identity and outcome equality. Jobs took 165/204/146 seconds; all UI work finished 246 seconds after workflow creation. Each retained its three-worker limit and closed its browser provider. This is a measured UI improvement, not a whole-workflow five-minute result.The SDK writer records each successful compiler's actual TypeScript Program membership in its existing private stage. The shared content snapshot policy now serves both native build-info and SDK declarations, replacing broad SDK byte hashing while retaining inherited configuration, generator/package metadata, installed compiler identity and resolution-topology validation. Both successful group receipts and an input mutation check are required before publication. Cache hits restore the entire generation into fresh staging and validate every canonical entry and relative declaration edge through the existing publication/lock owner. Direct/watch builds do not read or overwrite ordinary repository metadata; disabled caching creates no receipt. Old cache records without membership miss normally. Filesystem reads use the same canonical parent that namespace discovery enumerated, preserving logical path identities across Windows junctions. The cache identity also retains the current plugin-selection environment contract from main and normalizes TypeScript’s forward-slash config paths before making them checkout-relative on Windows. There is no new cache writer, dependency, product option, runtime storage or schema change.
The full real repository writer passed locally: 321 canonical entries, 712 declaration files and 5,880,440 bytes. Cold wall was 44.78s with two serial compilers; unchanged warm wall was 2.43s, with zero compiler invocations. A byte-only edit to an existing unconsumed UI test still reused identical output in 2.54s. All output hashes, mtimes and stamp bytes matched. The actual 10,995-file membership contains no test or UI files. This is local macOS proof, not a native Linux/Windows speedup claim.
Validation: 154 SDK/cache/config/lifecycle cases and 32 selected workflow/shard/UI-config cases passed. Pre-fix regressions cover unrelated-byte recompilation, mutation after emission, direct-build metadata overwrite in the initial candidate, and singleton UI admission. The full changed gate passed core/UI/core-test/plugin/script types; its first root-test pass found a redundant optional-value assertion, which was removed. The affected three envelope cases and root-test types then passed, followed by the remaining canonical coercion/deprecation checks, complete lint and import-cycle check. Workflow actionlint, zizmor, generated Git-owner, composite-input and formatting checks passed. Final configured Codex review of the corrected diff is scoped-clean at P0. All three Testboxes passed on the initial head. Native CI exposed a Windows namespace read through a junction alias and an independent Doctor public-import child heap exhaustion; both are retained in the run below. The Windows owner correction passed 31 local SDK/boundary cases, and the merged plugin-selection checks passed. The same 256 MiB Doctor batch/deep/public reproduction passed locally; investigation is tracking plugin-doctor initialization memory without raising the heap limit. The second native run passed Doctor and all three Testboxes, then exposed the remaining Windows relocation identity defect and a stale Teams inline-code expected value inherited from the shared Markdown whitespace fix. Both are corrected: the existing local declaration lifecycle case passes, and 80 Teams/shared Markdown cases pass. Type-aware lint passed after the concurrently running fixture processes were joined; the earlier invocation correctly rejected a changing resolution topology. The final two-file correction is scoped-clean in configured Codex review at P0. Head 84981aa passed native CI33452235578 and all three Testboxes (ARM33452235529/build33452235555/check33452235543). Native CI completed with216 successful jobs and9 intentional skips in7m59s; Docker finished last. Windows rows passed in339s/369s; all11 real declaration cases passed, including warm relocation, direct metadata preservation, plugin-selection changes and all negative inputs. Linux built both SDK groups in27.2s/28.1s, with the complete writer taking58.2s. This remains cold Linux evidence, not a native full-repository warm speedup.
Pinned contract inspected directly: tsdown 0.22.14 calls
build:doneafter compilation; rolldown-plugin-dts 0.28.2 exposes retained Programs through its publictsc-contextexport with the current serial/default context settings; TypeScript 6.0.3 supplies consumed source membership. Real compiler probes, complete-graph execution, relocation, private-QA separation, input-mutation rejection and nested process cleanup validate the boundary.Tradeoffs and follow-ups: three UI rows duplicate setup and add two Blacksmith registrations on applicable non-frozen routes; hosted/frozen/skipped paths add none. The conservative burst envelope becomes 3,708 registrations against the live 10,000 bucket and 6,000 operating target. Script/config/generator and namespace changes still invalidate conservatively. A controlled store-layout probe added about 0.294s locally, but actual hosted-store transport/topology cost remains unproved. The existing namespace walker can follow ambient pnpm project links into unrelated checkouts; that shared-owner coupling is a named follow-up, and the proof did not traverse those projects. A fresh CI store and native warm consumer must be observed before claiming operational savings.
Judged delta: product runtime 0; CI/build tooling +279, tests/support +204, docs +12. About 250 existing snapshot lines moved into the shared owner. The added tooling implements successful compiler membership, its private-stage boundary and integration with the complete cached generation; the old broad SDK byte policy is removed. Changelog is unnecessary for CI/build/test infrastructure.
Initial native evidence: CI 33449014227 executed merge d802e9b97a24 (head 1dbf080 into main 6598e54). Linux ran both real SDK compiler groups in 26.9s and 28.6s, with the complete writer taking 58.1s; its protected seed did not contain this new generation. Windows reached the existing real declaration fixture and exposed the namespace defect before compilation. Its unchanged cold/warm/relocation/negative cases remain the regression proof for the corrected head. Native full-repository warm-cache speedup remains unclaimed. The final exact-head results above complete the current native proof.
Latest ClawSweeper rank-up response: the pinned dependency hook/export contract was directly inspected and exercised above. Live effective main rules require only
openclaw/ci-gate, with non-strict status checking; they do not require the former literalchecks-uicontext. The compact failure was the stale Teams expected value described above, not a production formatter regression. Exact-head validation is CI 33452235578; it completed successfully at the reviewed head. The prior corrected run is CI 33450811446, with both failed-case logs retained. Compiler membership is rebuildable build-cache metadata, not OpenClaw runtime state; old records safely cold-miss without a runtime migration.