Repository navigation
perf(ci): reuse relative declaration path resolution - #198774
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. What this changesThis PR caches ordinary relative declaration paths while preserving fresh filesystem validation and excluding Windows drive-relative paths. Example: Repeatedly validate generated/value.d.ts within /repo.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this maintainer-authored PR open: it makes a focused optimization using the existing cache owner, with no actionable correctness or security findings. Priority: P3 Before merge
FindingsNone. Agent review detailsHow this fits togetherDeclaration tooling passes compiler and receipt paths through a checkout boundary that resolves lexical paths and rejects physical filesystem escapes. flowchart LR
A[Declaration tooling] --> B[Compiler and receipt paths]
B --> C[Bounded lexical cache]
C --> D[Fresh filesystem checks]
D --> E[Checkout containment]
E --> F[Accepted path or error]
Technical reviewBest possible solution: Retain the minimal eligibility change and existing safety fixture, and land only if the recorded performance acceptance rule is met. Do we have a high-confidence way to reproduce the issue? Current-main source shows repeated relative receipt paths bypassing the lexical cache; this read-only review executed no target code and establishes no measured speedup. Is this the best way to solve the issue? The patch is the smallest complete implementation: reuse the existing boundary-scoped cache for stable relative inputs while retaining fresh physical checks and Windows drive-relative handling. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 896cc0cc44d7. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +4, Other 0. Total +4 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 14, 2026, 4:05 AM ET / 09:05 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
Revert PR #198661 on the release candidate as explicitly requested by Dallin before the next FRV. Preserve the later #198774 relative-path optimization and all other release repairs. This reverts commit 5a7d171. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Warm extension-boundary checks repeatedly resolve the same relative declaration inputs even though their lexical checkout root is fixed.
User Impact
The measured full warm boundary check uses 10.3% less wall time and CPU. Filesystem and symlink validation behavior is preserved; no user-facing configuration or migration changes.
Why This Change Was Made
Reuse the boundary's existing bounded lexical-path cache for ordinary relative paths. Keep Windows drive-relative inputs uncached because their resolution can depend on drive working directories. The existing symlink-replacement test now covers both absolute and relative spellings.
Follow-up to #198708. This reuses the existing cache owner, lifetime, and size bound. The production change is one line; the test extends the existing fixture.
Evidence
Correctness and review
5e1ffd7eb1e2445a1a829a444502bd03b8002c6d..9a376435c9242a5255a051c352f88e0b8b37ec4ewith high reasoning effort. That review was read-only; runtime proof is separate.Performance acceptance rule
Recorded in this PR before qualification: run the committed full workload
OPENCLAW_CI_EXTENSION_BOUNDARY_FULL=1 node scripts/check-extension-package-tsc-boundary.mts --mode=compileon one isolated Linux host with 4 CPUs and approximately 8 GiB RAM.Use a baseline prime and one warmup per variant, then five serial interleaved baseline/candidate pairs. Keep the physical generator identity fixed and load the exact baseline/candidate boundary module in every Node process, including children. Every warm sample must reuse all 146 compiled plugin receipts.
Accept only if median compilation-validation time improves by at least 5%, median wall time and total CPU do not increase, and no median or nearest-rank p95 wall, compilation-validation, CPU, or peak RSS metric regresses by 20% or more. Report the full spread and host load. Instrument both variants separately to count filesystem and lexical path operations; verify receipt bytes remain unchanged. Profile the accepted candidate and complete a separate full candidate cold compilation. Cold execution is a correctness check, not a claimed cold speedup.
Five-pair result: passed
Measured on Boat, 4 available CPUs, 8,131,944 KiB RAM. All 10 timed samples reused all 146 compiled plugins. CPU is user + system time including children. With five samples, nearest-rank p95 is the maximum.
Wall-time ranges: baseline 64.899–71.463 s, candidate 57.499–64.731 s. Compilation-validation ranges: baseline 57.440–62.628 s, candidate 50.390–56.637 s. CPU ranges: baseline 67.930–75.330 s, candidate 60.470–68.350 s. Peak RSS ranges: baseline 1,184,892–1,196,588 KiB, candidate 1,170,180–1,202,660 KiB. Preparation ranges: baseline 7.212–8.544 s, candidate 6.730–7.782 s. Recorded one-minute host load across timed samples was 1.01–1.30.
Median wall time improved 10.3%, compilation-validation 10.0%, and CPU 10.3%. Median RSS fell 0.2%; p95 RSS increased 0.5%, within the declared threshold. No metric crossed the 20% regression limit.
path.resolvepath.relativeexistsSyncreadFileSyncstatSyncreaddirSyncThe patch removes 17.45 million lexical resolutions per warm full check while keeping the measured filesystem work identical. All 438 receipt files retained the same digest before and after both variants. The candidate CPU profile still shows realpath and existence checks as the largest costs; this patch leaves those checks intact.
A prior attempt was interrupted before paired measurements; its timings are excluded. Allocation failures before this successful run are not performance samples.
CI attribution
Exact-head CI run 43615505015 completed with one failed test job: three preparation CLI cases cannot import
src/infra/directory-walk.tsfrom their copied fixture. Scheduled main has the identical failures. The tests, fixture helper, emitter, directory walker, and preparation CLI are byte-identical between the CI baseline and tested merge; module loading fails before this cache is called. The automated table says unknown because compact job names differ. All other test/build jobs andsecurity-fastpassed; the aggregate CI gate failed from this test job. Landing uses the native pre-existing-failure exception; CI remains recorded as failed.