Repository navigation
Conversation
This was referenced Oct 10, 2026
This was referenced Nov 1, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Keep directory read-ahead bounded and cancel work the traversal no longer needs, while reusing the command's existing workers. Cached siblings no longer hold execution slots needed for deeper traversal, and foreground work can run between speculative reads.
AG;DR
Scope and dependency
Draft follow-up stacked on PR #996, based on command-ownership head
2a0e3343d6be1e2e3a28327f1da9068774cf7a09. This isolates directory-frontier scheduling from useful-remaining-work admission and native allocation/timing experiments. No module, LLVM, linker, build default, benchmark driver, dataset selection, resource-accounting or platform-security settings change.Implementation commit:
769d9cc72a11213a2c73c605532b56e526821561; tree:0a3db67d5d703ad5d9782b0c2abea5ac95a6a826.Implementation and invariants
--jobs=Ncommand budget and at mostN-1persistent background threads. Directory/stat/content/comparison phases and nested mounted-filesystem walks reuse the same executor; workers remain leaf jobs and cannot submit/wait recursively in their own pool.Finish()is idempotent; destruction releases the remaining charges. Abseil mutexes guard shared accounting and dispatch state; result publication uses the existing Abseil completion protocol, not cancellation atomics.--jobsregistry entry, generatedXFF.md, parallel design and audit status in the same change. Add only narrow direct Cord/time dependencies required by storage accounting and controls.Correctness controls
Executor controls exercise shared slot/byte admission, concurrent retention, saturating rejection, ownership release, reservations moved across threads/outliving the executor, idempotent completion, minimum bookkeeping charges and deterministic queue-class alternation.
In-memory traversal controls cover:
Existing command-budget, eager-stat, matching, comparison, ordering, archive and in-flight-stop tests remain. Markers/rendezvous are correctness synchronization, not accepted timing measurements.
Validation
bazel test --config=clang --config=xff_docs //... --test_output=errors: all 241 targets, including documentation/notice drift tests. This final run executes 87 targets and reuses valid cache entries for the rest; the initial all-extras run executed all 241.command_workers_test,walk_test,walk_parallel_test,parallel_compare_test,parallel_match_test,rg_test,run_executor_test,run_test) passes under--config=clang --config=asan(ASan/UBSan) and--config=clang --config=msan.--config=clang --config=tsan --runs_per_test=10, including the expanded 60-mode/order/budget combinations, nested progress, cancellation and oversized error controls. Earlier narrower TSan repetitions also pass, but the final eight-suite run is the verification scope reported here../compile_commands-update.shcompletes with all 297 expected first-party sources present. The normal commit hook passes enforcing clang-tidy, formatting, repository policies and Trunk checks. Initial lint passes identified optional engagement and a redundant lambda parameter-list issue; explicit guards and checked access resolve those findings without disabling checks or weakening presence assertions. No hook is bypassed. The worktree is clean andgit diff --checkpasses.Portability and remaining acceptance work
The implementation uses portable C++/Abseil and the existing thread-safe VFS interface. It introduces no Linux-only runtime calls or macOS configuration changes. Linux tests and hosted macOS correctness checks do not establish native M5 Pro performance safety.
Inherited directory admission (64 independent siblings), eager-stat admission (512 entries / 128-entry chunks), content bounds and accumulated-past-work cold matcher policy are unchanged for isolation. Count alone is not remaining cost, and completed work must not justify starting workers. Remaining-cost admission and measured task sizing remain necessary follow-ups.
The caller participates in foreground stat/content/comparison drains, but still waits when its required directory listing is owned by a queued/running speculative read. Thus an admitted directory-only frontier under
--jobs=2can use only its one background reader while the caller waits; thread reuse and a participant ceiling do not prove full useful participation. Caller assistance during those waits needs a separate correctness/performance control and remains open.Separate draft PR #998 now implements caller-owned uncached reads and exactly-once claims of required queued reads. Its before-change control reproduces the one-reader gap, and its local all-extras suite plus ASan/UBSan, MSan and repeated TSan controls pass. That follow-up is not part of this PR's head; already-running required reads still require waiting, and useful-remaining-work admission, dispatch/grain costs and native performance acceptance remain open.
No native timing, allocation or RSS improvement is claimed. PR #995 retains unchanged-baseline provenance, allocation/counter controls and the isolated one-time Linux/x86 Abseil TSC calibration mechanism; this candidate does not disable that clock or attribute its 1 ms / 2 ms sleeps to each pthread creation. Required/ancestor listing lifetime is a separate memory finding, not solved by the speculative budget.
Keep this PR draft pending repeated/reordered complete prepared-grid A/B measurements with correct output hashes, metadata/stat-heavy and slow-storage controls, native allocation/RSS checks, and equivalent M5 Pro sampling, P/E-core accounting and A/B controls. Builds and instrumentation must not overlap accepted timing collection. This PR addresses bounded-frontier ownership/cancellation and job-boundary dispatch; it does not complete the original benchmark audit or establish that every worker now has enough useful remaining work.
Current qualification disposition (2026-11-07)
This proposal remains open as unqualified research; its branch and implementation are preserved. The successful checks above belong to its historical head/base context. They are not validation against current main, and this note changes no source, branch, base, CI policy or acceptance threshold.
PR #1125 has merged as
9bf1aad510d843d1d6338fbdf23107a30d339730. Its shared-stage-worker report rejects six separately implemented reuse designs, including a repeatable 15.55% Linux small-identical/1,000-pair/four-worker regression. That result does not establish that every unique mechanism in #992/#996/#997/#998 is rejected or superseded. Main retains specialized pools.Preserve the unique command-wide unfinished-read/represented-byte reservation mechanism, cancellation before/after VFS calls, and alternating foreground/read-ahead dispatch. Main's typed directory/stat pool and bounded per-frontier requests do not implement that complete combination. Dropping an unused main request releases its completed result, but is not equivalent to this proposal's queued-work filesystem-access cancellation or command-wide retained-byte accounting.
The executor/copy audit demonstrates about 69% lower peak RSS versus #996 in its 65,536-file metadata fixture on both platforms, while the marginal Linux nested-listing time costs 17.5%. Neither figure is a general main-relative bound or current-head result. This PR still consumes the unqualified #996/#992 infrastructure and caller-inclusive policy; historical green child CI cannot promote it to main readiness.
The concrete next qualification is an isolated adaptation onto main's current typed slots/frontier, without the rejected admission/aggregate-budget policies. Preserve byte-reservation lifetime, minimum/saturating charges, exact errors/order, cancellation/draining and independent nested allowances. Measure enqueue/allocation cost, oversized-result rereads, completed-versus-in-flight storage, heterogeneous/slow VFS behavior and native RSS/time on both platforms. A represented-storage budget is not a total RSS or required-listing bound. This remains a useful open mechanism, not a fully rejected or fully superseded PR.