fix(code-index): shrink text builds to available memory headroom - #1782
Merged
Merged
Conversation
The host-scaled text build budget was treated as an all-or-nothing minimum. With a live 18-22 GiB serving graph under the 26 GiB cgroup allowance, the supported 1.5 GiB builder floor fit but the preferred 3.25 GiB ceiling did not, so the replacement that could release the old graph retried forever. Reserve any budget between the established floor and preferred ceiling, derive batch widths from the admitted amount, and keep fixed reader/clone reservations exact. Reservation failures now retain their typed detail instead of collapsing into BudgetExceeded.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This was referenced Sep 18, 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.
Live deadlock after #1777
The cgroup authority is now correctly 26 GiB, but text projection still retried
BudgetExceeded~1–2 times/sec:26 GiB / 8= 3.25 GiB,At 21 GiB RSS, ~2.4 GiB is available below the watermark: enough for the supported builder, not the preferred ceiling.
open_published_head_or_begin_buildnevertheless reserved the preferred figure all-or-nothing, so the stale graph prevented the replacement build that would release it.Checked existing open PRs first: none implement flexible resident admission; #1577 is codec/decode work.
Fix
reserve_resident_memory_up_to(preferred, minimum)computes available growth from the same modeled + observed + watermark ledger the atomic reservation uses and admitsmin(preferred, available)when it remains above the established 1.5 GiB floor.minimum == preferred) and are unchanged.AuthorityUnavailablenaming minimum/available; if the atomic reserve loses a race, preserve its exact admission failure. Only real control deadlines remainBudgetExceeded.Evidence
Concrete 26 GiB/21 GiB case returns the available 2.4 GiB; 22 GiB case stays unavailable below floor. Flexible-budget + existing watermark/reservation/subdivision tests 4/4; all text-artifact tests 20/20; rustfmt and IDE lints clean.