perf(lane): fold at admission and allow byte-equal --locked folds - #313
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: b86e9de The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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. |
The lane took its head, waited the batch window, folded compatible pending requests, then parked the head at the admission gate and on the permit semaphore. Under a saturated pool that park lasts tens of minutes, and every compatible request that joined the lane meanwhile stayed pending, ran after the head on its own, and waited out a permit of its own. The fold now runs once the head holds its permit, uninterruptibly so a racing kill settles a fully folded composite. The fold predicates are unchanged. Live evidence on a 12-permit, 27-lane queue: cc-1626 (`test -p tracedecay-agent-hosts --lib -- …`) was submitted 0.4 s after cc-1625 (`test -p tracedecay-mcp --lib -- …`), missed the 150 ms window, and queued behind a head that waited over 15 minutes for a permit. Replaying the last day's ledger, 5 runs would have folded, avoiding 139 minutes of wait.
Any unmodeled cargo flag kept a request out of every compile batch and test composite, and `--locked` is the most common one: 335 of the 1,319 brokered leaders in the last day carried it. The three flags assert lockfile and network state for the whole invocation and never select or shape a package's units, so participants that make the same assertions can share the leader's argv. A one-sided flag still refuses the fold: the composite would forbid a follower's lockfile update or apply one it forbade. Replaying the last day's ledger with admission-time folding, this lifts the folds from 5 to 9 runs and the wait they avoid from 139 to 282 minutes.
ScriptedAlchemy
force-pushed
the
perf/fold-at-admission
branch
from
September 26, 2026 01:06
4e0d6d5 to
b86e9de
Compare
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.
Two folding fixes found while diagnosing a 62-deep queue on a 96-core host.
lane-exec.ts: the batch fold ran when a lane picked its next job, before that job waited (often ~30 min) for an admission permit. Compatible jobs arriving during the wait ran separately and each waited for their own permit. The fold now runs once the job holds its permit; it is uninterruptible so a concurrent kill still settles cleanly.batch.ts:--locked,--frozenand--offlinewere unmodelled flags that disqualified folding. Byte-equal sets now fold; a mismatch on either side still refuses.Replaying the last 24 h of this host's history: +9 folds/day, ~282 min/day less agent waiting. New tests fail on the old code and pass with the change;
pnpm run checkpasses (1,324 unit/integration, 50 route, 3 browser). Changeset and README note included.