Repository navigation
perf: cap the cost stage, log what it left, and let continuity run on a split - #177
Merged
Merged
Conversation
The continuity candidate is the model plus a start variable per step under a bound on the cost it just optimized, the harder problem of the two. Where the incumbent took longer than the second this stage may spend, the candidate hits the cap with nothing to show. Production measured it over five days: 14 % of joint solves ran the stage, half of those sat on the cap, p90 went from 0.68 s to 1.32 s in the deploy hour and the replica average rose 18 %. The incumbent's own clock names those requests before the second is spent, so skip them. The stage was also invisible: no timer and no outcome, so this had to be found by subtracting the timed stages from the total. It now leaves stage_seconds 'continuity' and a continuity_stage string the way the tie break does, and the request log carries both. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> (cherry picked from commit 02a839e)
The cost stage is anytime branch and bound and spends whatever the reserve leaves of the limit. On the production 10 s limit that is 5.4 s, and with the tie break seated in the rest, 17 percent of the split solves ended past the limit. An absolute cap of 3 s brings a split to about 7.5 s. Whether the seconds past 3 bought money is unknown, so the request log now carries the cost stage value and the gap CBC reported between its schedule and its bound, in currency, zero when proven. (cherry picked from commit c07ab08)
The helper pushed _solve_continuity past the return and statement limits once the rollup's stage reporting is merged in. (cherry picked from commit f73bdb1)
With the cost stage capped nothing exhausts the time limit any more, so the slow request dump stopped filling. A request now also lands in it when the cost stage gap is above one currency unit, and the dump line carries that gap, so the replay corpus holds exactly the requests where a longer clock might have bought money. (cherry picked from commit 4c32a65)
The skip gate summed probe and cost time. On the split path the probe alone is PROBE_SHARE of the time limit, so every split request skipped the stage. Gate on the cost stage the candidate extends, keep the probe for the joint path. A cost stage without a solver log reports no gap. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Oct 4, 2026
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.
fixes #170
Ports what the deployed rollup branch still had over main: #154 (cost stage capped at 3 s, CBC gap read from the log as
cost_stage_gap,continuity_stagein the request log), #155 (requests with more than one currency unit unproven are dumped too), and the inlinec_activeread. Cherry-picked with-x, conflicts against #160 resolved by keeping both.The continuity skip gate from #154 is changed while porting it. It summed probe and cost time, and on the split path the probe alone is
PROBE_SHAREof the time limit, so every split request skipped the stage. Replaying the request from #170 under production limits: gate on probe + cost skips at 2.8 s and leaves 5 charge starts, gate on the cost stage runs 1.1 s and merges both cars to one start each at the same cost and peak. The joint path keeps its gate, there the probe is the whole solve. A cost stage faked without a solver log, as in the #160 tests, reports no gap instead of raising._solve_continuitywas over ruff's return and statement limits on the rollup already, the clock gate moved into_continuity_clockto get under them.The late import placement and the missing
circuitsfrom the same issue are separate changes.🤖 Generated with Claude Code