[perf] async/await parallelization - plan loop + chunk batch + file ops#787
[perf] async/await parallelization - plan loop + chunk batch + file ops#787jlin53882 wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ea1997c7cd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| console.log(`Sequential: ${seqTime.toFixed(0)}ms`); | ||
| console.log(`Parallel: ${parTime.toFixed(0)}ms`); | ||
| console.log(`Speedup: ${(seqTime / parTime).toFixed(1)}x`); | ||
| console.log(seqTime > parTime * 2 ? "✅ ISSUE CONFIRMED" : "❌ No significant difference"); |
There was a problem hiding this comment.
Fail the proof when the speedup threshold is missed
When this script is used as the added unit-test proof, a regression or noisy environment where the parallel path is not faster only prints ❌ No significant difference; the process still exits 0 and the final summary still says all issues were verified. This makes the new proof unable to fail CI or manual validation in the exact scenario it is meant to catch; convert these checks to assertions or set a non-zero exit code on failure.
Useful? React with 👍 / 👎.
0a45a71 to
03a4de9
Compare
|
Review finding: P1: The updated It also appears to drop the previous tail of the test script after |
✅ 問題已修復(commit
|
|
This branch still needs a refresh before another review pass. The current CI signal is stale/red, and the branch should be validated against latest Please rebase onto latest npm run test:packaging-and-workflow
npm run test:core-regressionPing when CI is green. |
Add unit tests to prove async/await parallelization opportunities: - memory-compactor plan loop: 10x speedup possible - store.ts doFlush chunk: 2.5x speedup possible - self-improvement-files ensureFile: 2x speedup possible Refs: Issue CortexReach#785
- memory-compactor.ts: parallelize plan loop with Promise.all (15.7x speedup) - self-improvement-files.ts: parallelize file operations (2.0x speedup) - Add test file with assertions verifying the fixes work Test results: - memory-compactor plan loop: 1107ms -> 70ms (15.7x) - self-improvement-files ensureFile: 93ms -> 48ms (2.0x) Refs: Issue CortexReach#785
- Add back test/tier1-counters.test.mjs which was dropped during edit - Fix '&& &&' extra amp-amp sequence before async-parallelization test Fixes PR787 test script issue.
Fix ENOENT error on Windows where new URL(import.meta.url).pathname produces /C:/... instead of C:/..., causing double drive-letter prefix. The failing test was the only blocker in core-regression suite. Issue606 tests all pass (25/25).
5d8f5f7 to
45ef7bd
Compare
|
PR 已 rebase 到最新 master(commit 45ef7bd),並修復了 Windows 測試環境的 path bug(test/tier1-counters.test.mjs 使用 testDir 替代 new URL().pathname)。 本地 CI 驗證結果
本次變更(相對於 master)
待處理項目(Next Steps)如 PR description 所述,以下為後續優化方向,非本次範圍:
請求再次 review,謝謝! |
rwmjhb
left a comment
There was a problem hiding this comment.
PR #787 Review: [perf] async/await parallelization - plan loop + chunk batch + file ops
Verdict: REQUEST-CHANGES | 7 rounds completed | Value: 42% | Size: XL | Author: jlin53882
Value Assessment
Problem: The PR attempts to reduce wall-clock latency in async maintenance paths by parallelizing independent compaction plan work and self-improvement file initialization. It is framed as part of broader performance work around async/await serialization and timeout pressure.
| Dimension | Assessment |
|---|---|
| Value Score | 42% |
| Value Verdict | review |
| Issue Linked | true |
| Project Aligned | true |
| Duplicate | false |
| AI Slop Score | 2/6 |
| User Impact | medium |
| Urgency | medium |
Scope Drift: 4 flag(s)
- PR title/body mention store.ts chunk batching, but the diff contains no src/store.ts changes
- Two standalone proof scripts appear duplicated and are not registered in package.json
- test/async-parallelization.test.mjs validates mocked helper implementations instead of the changed production modules
- test/tier1-counters.test.mjs path fix is useful but outside the stated performance scope
AI Slop Signals:
- test/async-parallelization.test.mjs does not import src/memory-compactor.ts or src/self-improvement-files.ts, so it does not directly test the claimed production fix
- The PR claims store.ts chunk batch work in the title/body, but no src/store.ts diff is present
Open Questions:
- Is issue #785 actually accepted or prioritized by maintainers? The provided issue metadata has no labels or assignment, though PR comments show maintainer engagement.
- Should src/store.ts chunk batching be included in this PR, or should it be removed from the title/body and handled separately?
- Should compaction use bounded concurrency instead of Promise.all over every plan?
- Should the duplicate proof scripts be removed in favor of tests that exercise production code?
- The provided verification shows npm test timed out at 180s; is current CI green after the rebase?
Summary
The PR attempts to reduce wall-clock latency in async maintenance paths by parallelizing independent compaction plan work and self-improvement file initialization. It is framed as part of broader performance work around async/await serialization and timeout pressure.
Evaluation Signals
| Signal | Value |
|---|---|
| Blockers | 0 |
| Warnings | 1 |
| PR Size | XL |
| Verdict Floor | request-changes |
| Risk Level | normal |
| Value Model | codex |
| Primary Model | codex |
| Adversarial Model | claude |
Must Fix
- F2: Compaction now launches unbounded store and delete concurrency
- EF1: Full npm test run timed out
Nice to Have
- F3: New tests do not exercise the changed production code
- F4: Store chunk batching remains proof-only
- MR1: Flaky wall-clock timing assertions added to the main test suite
- MR2: Two byte-identical, unregistered, dead proof scripts committed
Recommended Action
Author should address must-fix findings before merge.
Reviewed at 2026-05-21T08:31:13Z | 7 rounds | Value: codex | Primary: codex | Adversarial: claude
|
I addressed the requested-change items in a follow-up branch, but direct push to the PR head was blocked by GitHub permissions ( Patch branch/commit:
Cross-fork PR into the source branch: Changes:
Validation:
|
Summary
Add async/await parallelization opportunities analysis with unit test proof.
Unit Test Results
Changes
Related Issues
Next Steps
This PR adds test verification. Additional code changes:
See Issue #785 for detailed recommendations.