Repository navigation
Conversation
|
Closing as rejected: the current remaining-cost admission model. This is a measured rejection of this implementation, not a claim that estimating remaining work can never help.
Keep main's existing matching scheduling. Preserve the counterexample workloads and requirements for exactly-once sampled results, ordered output, private concurrent matcher state, and genuine remaining-work evaluation. JC05/JC06/JC07 and the executor-admission qualification work in TODO.md remain open. Any replacement should be a new independently measured proposal, not merging this head because its correctness CI was green. Evidence and interpretation: complete cross-platform audit, raw samples, exact source patches and identities. Integration measurements use explicitly recorded synthetic ports onto clock-corrected main This closure does not delete the branch, rewrite any commit, merge experimental runtime code, or claim that all worker/queue research is finished. |
Content workers should start only when useful work still remaining can repay their overhead. This removes admission based on already-processed entries, keeps the command's bounded executor reusable, and preserves ordered results.
This is an experimental, separately scoped draft, not a completed traversal scheduler or a performance acceptance claim.
AG;DR
Scope and finding
Stacked on draft #998 (
perf/coordinator-directory-reads), whose head is416e45a39e1432aeed3f2aed64f8e3795bac19f1. The inherited stack supplies command-owned worker reuse, caller-inclusive budgeting, bounded directory read-ahead and caller participation. This change addresses matcher admission and chunk grain only.A before-change regression processes 8,192 entries in sixteen-entry batches and then a cheap 32-entry tail. The unchanged parent matcher starts one background worker for that tail because its completed-entry counter bypasses the cold probe. The regression fails against the parent and passes with this change. Already-paid work cannot repay startup on a cheap remaining tail.
No LLVM/module, linker, platform-security, benchmark driver, dataset, resource-accounting or default job-count changes are included.
Implementation
The provisional default allowances are 3.5 ms cold, 50 us per new background worker, 50 us dispatch, 100 us minimum saving and 32 us target chunk. The Linux/x86 diagnostic in #1000 informs the cold Abseil calibration cliff and cold/warm/grain distinction. It does not calibrate file costs, private matcher setup or native macOS. These are experimental planning allowances, not portable measured constants.
Controls and validation
Pure tests cover trimming one completed outlier, invalid and saturating samples, no independent remaining work, cold versus warm admission, growth benefit, dispatch/minimum-saving boundaries, few expensive items, grain/balancing bounds, maximum counts/durations and agreement with an exhaustive bounded cost model.
A controlled slow evaluator verifies actual caller plus two background identities, ordered match parity, exactly one evaluation per entry and reuse across two batches. Slow in-memory VFS controls cover actual content-worker participation, sixteen slow files with useful work left after sampling, a five-file caller-only batch, pool participation growth, short tails, metadata consumers, serial-equivalent output, errors and exact read counts.
Existing rg and whole-command controls rendezvoused on the caller's first read, before workers were admitted. Under trimmed sampling this produced a paid outlier or a pre-dispatch timeout rather than meaningful remaining work. Move their rendezvous after sampling and supply uniform simulated per-read latency. Keep their reader identities, caller participation, command cap, serial output and read-count assertions. The fixtures use annotated Abseil mutexes; no lock spans simulated latency. These controls are not physical slow-storage measurements.
bazel test --config=clang --config=xff_docs //...: all 242 targets pass, including documentation drift; 78 execute in the final recheck and 164 reuse valid cached results.--config=clang --config=tsan --runs_per_test=10.git diff --checkpass. The enforcing lint finding about long double was fixed, not suppressed. Final normal commit/push hook results and implementation identity are recorded below.Portability, limits and acceptance
Only portable C++/Abseil and existing VFS/executor interfaces are used. No OS-specific calls or macOS build configuration changes are introduced. Hosted macOS correctness/build checks still need to run for this head, and neither those checks nor Linux sanitizer results establish native M5 Pro performance acceptance.
The model forecasts only the owned matcher batch. It does not establish eligible work in an unvisited traversal frontier, predict future batches from completed counts, or individually calibrate private matcher setup, shared-pool contention, storage bandwidth or serial output. A warm executor is not proof that a new matcher's private state is prepared. A small trimmed prefix cannot prove uniform costs throughout a heterogeneous/cached batch; cheap bounded batches may remain serial even during a larger command.
Directory admission remains the inherited 64-sibling heuristic and eager-stat admission/chunks remain unchanged. Directory leaf tasks and nonpreemptive foreground drains need their own useful-grain, fairness and allocation measurements. Required/ancestor listing memory is not bounded by the speculative read-ahead allowance.
Keep this PR draft pending repeated/reordered full prepared-grid actual-workload A/B controls, eager-metadata and physical slow-storage cases, candidate allocation/native RSS evidence, and equivalent native M5 Pro sampling, P/E accounting and A/B measurements. All builds, sanitizers and lint must finish before accepted timing collection. No throughput, latency, memory improvement or completed audit is claimed.
Published implementation and local gates
Implementation commit:
da803fc50ada64ecd11715c3ffc6223d2a033c05. Current head:af967729eeaf9689367cf19c20ec66eed60ee2ec; tree:9b7a7aa5f35adfd39925360d0c4ce8dd64294152. The second commit updates the audit's allocation-control status to include the later evidence published separately in #995; it changes no runtime code.Both normal commits pass repository policy/format hooks and Trunk. The normal push passes the complete configured changed-file suite, including enforcing clang-tidy. No hooks are bypassed. The pushed worktree is clean. No accepted native timing collection has been performed for this candidate.
Hosted validation and native follow-up
All 30 hosted checks at
af967729eeaf9689367cf19c20ec66eed60ee2ecare complete and successful or intentionally skipped in workflow 38036045142, including Linux/macOS correctness, sanitizers/lint, benchmark shards and the combined comparison gate. These hosted results are not native M5 Pro performance acceptance.A separately frozen native Linux collection is in progress. It compares the original
772994ab7905be77915978f06ea90ae5934aaeefbaseline, parent416e45a39e1432aeed3f2aed64f8e3795bac19f1, and this head using unchanged historicalclang_releaseconfiguration and LLVM 23.1.2. Every published file-count anchor is included at 1/3/10 workers for both v2 layouts, with all published scenarios plus tree, collection and lazy/eager metadata controls. Three orderings, one warmup, nine samples/fastest seven, verified physical-core masks, tmpfs and losslessly retained stdout are declared in the frozen contract. No result or performance acceptance is claimed before terminal completion and independent verification. Physical slow-storage and native M5 Pro controls remain outstanding.