Repository navigation
fix(admission): derive conservative process-global heavyweight headroom - #11541
Closed
KaspaPulse wants to merge 2 commits into
Closed
KaspaPulse wants to merge 2 commits into
KaspaPulse wants to merge 2 commits into
Conversation
KaspaPulse
force-pushed
the
feat/admission-runtime-capacity-headroom-20260825
branch
2 times, most recently
from
August 25, 2026 18:33
1f322f4 to
335e522
Compare
KaspaPulse
force-pushed
the
feat/admission-runtime-capacity-headroom-20260825
branch
from
August 26, 2026 05:27
335e522 to
1d329dd
Compare
KaspaPulse
marked this pull request as ready for review
August 26, 2026 06:21
KaspaPulse
marked this pull request as draft
August 26, 2026 06:25
KaspaPulse
force-pushed
the
feat/admission-runtime-capacity-headroom-20260825
branch
from
August 26, 2026 08:30
1d329dd to
8cd5b3b
Compare
KaspaPulse
marked this pull request as ready for review
August 26, 2026 11:13
Collaborator
KaspaPulse
marked this pull request as draft
August 26, 2026 12:01
Contributor
Author
|
Thanks for the clarification. Understood — I have moved the PR back to Draft and will defer its rebase and scope reduction to a dedicated v3.8.52 session. I will not push further changes during the current cycle. |
KaspaPulse
deleted the
feat/admission-runtime-capacity-headroom-20260825
branch
August 31, 2026 11:12
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.
Summary
memory.max, or cgroup v2memory.highbudgetProduction rejection diagnosis
Primary evidence:
0b68c753-2fbc-47ee-909c-34f334e012b0queue_timeoutactiveHeavy=1,waiting=0,queuedBytes=0,lane=key_3185d5107cab13ba11, effective healthy headroom10, available slots11,shedTotal=1This was not adaptive weighted saturation. The
queue_timeoutandactiveHeavyfields come from the earlier byte/structure gate, before adaptive weighted provider admission. Source inspection found that structure-only admission tried the primary reservation and then healthy headroom, while the byte-heavy reservation path calledacquireHeavyWithin()directly and therefore contended only for the single primary slot. The post-eventavailable slots=11includes release of the active request after the event; the old rejection log did not carry event-time headroom, so it could not distinguish pressure from this structural omission by itself.A focused TDD reproduction fixed that ambiguity: with the production-shaped
1 + 10 = 11structural budget, two independent byte-heavy requests were launched concurrently. Before the correction, the second request shed while onlyactiveHeavy=1; after the correction, it acquires one healthy-headroom reservation, reportsactiveHeavyTotal=2, leaves nine slots available, and releases exactly once. The byte-heavy path now checks live heap pressure, consumes bounded healthy headroom only while healthy, and otherwise retains the existing bounded queue/shed path.Every genuine structural rejection now records the full event-time scalar context:
activeHeavy,activeHealthyHeadroom,activeHeavyTotal, configured/effective headroom, calculated and memory-safe capacity, available slots, limiting budget, headroom reason, telemetry availability, waiting count, queued bytes, and the existing opaque HMAC lane. No credential, tenant key, request body, model, account identity, cgroup path, or queue item is emitted.Scheduler and lifecycle reconciliation
The branch is based on
release/v3.8.51ate0ea3f92e1403351686cb783764ba3da6bbddd75.The structural gate owns heavyweight request preparation through bounded ingestion,
parsing, policy, translation, and upstream-response preparation. It releases when the
handler yields a response. Adaptive admission then retains only its configured
streaming-generation charge. #11493's atomic global/provider/account semaphore remains
held through stream drain or cancellation and is unchanged by this PR.
Provider eligibility can lower an admission upper bound but cannot mint memory capacity
or duplicate scheduler authority.
Preserved safety invariants
Regression coverage
Coverage includes weighted preparation/generation accounting, queued-work promotion after
phase handoff, structural reservation release at handler response, concurrent independent
byte-heavy admission through healthy headroom, true saturation, event-time rejection
telemetry, HMAC-lane privacy, FIFO/round-robin fairness, queued-byte limits, cancellation,
exact-once release, SSE cancellation, cgroup v1/v2 discovery,
memory.highpressure abovethe soft ceiling, unlimited sentinels, V8/RSS/external/ArrayBuffer accounting, bare-metal
Windows/macOS fallback, invalid and contradictory telemetry, startup heap calibration,
monitoring projection, pressure contraction, stable recovery, override precedence, and
hard request limits.
Qualification
New correction:
git diff --check: passednpm run typecheck:core: passedPreviously completed and reused:
memory.highcorrection: 14/14 passednpm run test:vitest: passednpm run typecheck:noimplicit:core: onlyopen-sse/translator/response/openai-responses/pureHelpers.ts; the exact base reportsthe same errors and the file has the same blob
45dd8dea4f27ef77ae00c852f817a42ad6d39ac8npm run lint: 223 errors, 5 warnings, exactly reproduced on the base; nobranch-only full-lint error
npm run check:docs-all: stops on the inherited missingOMNIROUTE_CORPUS_CACHE_SIZEentry in.env.example, exactly reproduced on thebase; docs sync/counts, links, and fabricated-doc validation passed separately
npm run build: passed (591/591 static pages; postbuild and standaloneassembly completed)
(
docker compose --profile base build omniroute-base): passed(
docker compose --profile web build omniroute-web chatgpt-web-codex-browser):passed
Draft status
This PR remains Draft. This correction did not request review, merge, or deployment.
A historical pre-correction repo-wide unit-test attempt unexpectedly reached an external
OpenAI execution endpoint with its mock key and received
401; it was stopped and noprovider/model response was produced. This correction made no provider/model calls and no
production mutation.