Repository navigation
bench: stop starting ops that cannot finish before the window ends - #20
Merged
Merged
Conversation
Member
Author
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit a281030. Configure here.
Agents keep a per-op latency estimate that rises at once and decays slowly, and stop issuing pushes/clones expected to overrun the level window. In-flight ops get drainGrace (30s) before the hard cancel, so a queueing server no longer sees a burst of cancelled requests at every level end. tokenCovers accounts for the drain. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Paulo Gomes <paulo@entire.io> Entire-Checkpoint: 1ad957e18cb8
RunLevel returned as soon as every agent stopped early, closing the server's live series before the window ended while summarize still divided by the full duration. It now waits until end or cancellation. The fits check ran before building the commit, so a slow commit could start the push after end and count it as in-window. Agents recheck right before pushing, in the branch and session loops. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Paulo Gomes <paulo@entire.io> Entire-Checkpoint: b9123b0e9124
pjbgf
force-pushed
the
drain-level-end
branch
from
October 20, 2026 11:22
96c07cb to
1a58e75
Compare
Ops that overran the window finished during the drain and were recorded after measEnd. Periodic ticks stop there, so the forced tail flush put every drain completion into a bucket whose dt stops at the window end, spiking the live and persisted rate. Such ops still run to completion, so the server sees no cancellation, but go unrecorded, matching what summarize counted before the drain existed. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Paulo Gomes <paulo@entire.io> Entire-Checkpoint: ad4bd90faeef
Dropping ops that finished during the drain hid real work and tail latency exactly when the server slows down. They are recorded again and summarize attributes them by start offset. The live collector instead skips samples completing after the window end, so they no longer pile into the tail bucket whose duration stops there. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Paulo Gomes <paulo@entire.io> Entire-Checkpoint: 98b9390e1b08
The drain exists to avoid cancelling in-flight requests at the window end, but nothing measured how many still were. Agents now count ops cut off by ctx (the drain deadline or a cancelled run), and LevelResult carries the total as cancelled, printed in the CLI row. They remain excluded from samples. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Paulo Gomes <paulo@entire.io> Entire-Checkpoint: 73bcbf0d656c
pjbgf
force-pushed
the
drain-level-end
branch
from
October 20, 2026 11:23
1a58e75 to
eb9105e
Compare
Member
Author
|
The changes now report the number of cancelled operations, while trying to reduce them. Reporting only: Avoiding creating new pushes that won't be finished before the end of the session: |
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.

https://entire.io/gh/entireio/forgemark/trails/9
Agents keep a per-op latency estimate that rises at once and decays slowly, and stop issuing pushes/clones expected to overrun the level window. In-flight ops get drainGrace (30s) before the hard cancel, so a queueing server no longer sees a burst of cancelled requests at every level end. tokenCovers accounts for the drain.
Note
Medium Risk
Changes benchmark timing, cancellation, and JWT token budgeting; behavior under load and long runs shifts, but scope is limited to the forgemark bench harness rather than production forge paths.
Overview
Benchmark agents now track a per-op-kind latency estimate (fast rise on slow samples, slow decay) and refuse to start clones/pushes that are unlikely to finish before the level window ends.
Runner.RunLevelpasses an explicitendalongside the existingstart, extends the level context bydrainGrace(30s) only for ops that overrun that estimate, andtokenCoversbudgets that drain per remaining level.Clone, session, and default push loops all gate on
fits()for the relevantOpKind.internal/server/runmgr.gocomments are updated so live bucket emission still accounts for post-window drain (and session ref cleanup). Newagent_test.gocovers estimate behavior,fits, and an integration check that the window close does not cancel in-flight HTTP requests.Reviewed by Cursor Bugbot for commit a281030. Configure here.