Repository navigation
test: benchmark independent list discovery costs - #116
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2d0c527a79
ℹ️ 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".
| const paddingRecord = padding => `${JSON.stringify({ type: "benchmark_padding", payload: padding })}\n`; | ||
| const overheadBytes = paddingRecord("").length + record.length; | ||
| for (let index = 0; index < config.t; index += 1) { | ||
| const tree = index < config.n || index % 2 === 0 ? "sessions" : "archived_sessions"; |
There was a problem hiding this comment.
Distribute matching transcripts across both roots
When discovery of archived-only transcripts regresses, this benchmark still passes because index < config.n forces every transcript corresponding to a listed lock into sessions; only unrelated noise reaches archived_sessions. This leaves the documented cross-root coverage untested, so alternate the N matching transcripts between both roots while continuing to distribute the remaining T−N noise.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in the new commit: matching and noise transcripts alternate across both roots, and each listed result must resolve to its expected root/path. All 218 tests, package smoke, and corrected standard/quick benchmark pass locally; the report now records corrected measurements and variation. No runtime optimization was introduced.
Measure the bounded current list implementation before changing independent transcript discovery.
Closes #102.
The repository-only harness varies N locks and T transcript files independently, including sparse/nested roots, small/64-KiB transcripts, real versus fixed diagnostic children, and default versus internal zero-window controls. Three fresh-process repetitions report elapsed variation, traversal/read/spawn counts, directory/FD/resource peaks, and cleanup. Real native guards/flock remain enabled. It asserts complete sorted results, four-worker bounds, fixture file invariance, whole-command refusal for injected discovery failure, and unknown/unsafe sessions when a native coordinator is missing.
The corrected cross-root Darwin arm64 / Node 24.16 measurement takes 7.159 seconds for the standard suite. Baseline N=4/T=512 is 19.294 ms; N=32 is 89.136 ms; T=2048 is 35.196 ms; actual ps/lsof is 305.679 ms; the default 1000-ms window is 1024.320 ms. Matching transcripts alternate across sessions and archived_sessions, and every result must resolve to the expected path; this addresses the automatic review finding on the initial fixture. The document records min/max variation and follow-up requirements for larger fixtures and per-call shared discovery. The decision remains to retain fresh bounded observations; these small fixtures do not justify a persistent stale cache.
This is not a cold-cache claim: fixtures are hashed before timing, and OS caches are not flushed. macOS reports tracked directory handles rather than total FDs; Linux FD sampling may miss short peaks. CPU/RSS exclude diagnostic subprocesses. The 15-second quick / 60-second standard budgets bound verification, and dedicated Linux/macOS Node 22/24 CI jobs retain quick measurements.
Validation:
npm ci, type checking, lint, all 218 tests, package smoke, standard/quick measurement, andgit diff --checkpassed locally. No runtime behavior, package surface, user Codex home, live session, release, or publication is changed. This is the fourth independent PR in the requested #99 → #101 → #100 → #102 development order; CI-file changes should be reconciled in that order before merging. No merge is requested.Current head
5cd9db03b10aec8f5d4083d219253c25ceb08220passed all 27 reported checks, including CI run 37864310247 and all four Linux/macOS Node 22/24 quick measurement jobs. The visible Codex review summary names initial head2d0c527; its coverage is not claimed for this corrected head. Its cross-root fixture finding was addressed with path assertions, local reruns, and the current-head CI. PR creation triggers Codex review automatically; no further reviewer mentions will be posted. This PR remains open for human review.