Skip to content

The KV pool is read back, and a computed one needs a log line beside it - #10440

Merged
briansrls merged 5 commits into
mainfrom
session/eager-pike-541-vllm-pool-observed
Sep 4, 2026
Merged

briansrls merged 5 commits into
mainfrom
session/eager-pike-541-vllm-pool-observed

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

What this lands

Two extdeps/vllm/ modules and one witness module, for the pool-as-observed parse.

extdeps.vllm.log_lines cites three vLLM startup lines by prefix, not by position, each carrying the revision it was read at. extdeps.vllm.kv_cache carries the KV pool as an observation, refuses both arithmetic reconstructions of it, and binds the pool to the line class it is read from.

Why the pool is observed and never computed

The pool is a residual of large numbers — the memory budget minus the weights minus a profiled activation peak minus a cudagraph reservation. Every term but the first is measured by the engine after it loads, so small argument changes move the result by multiples rather than percentages: a utilization step of a few points moved it several-fold, and adding one batching argument cut it by two thirds. A quantity with that shape cannot be predicted from the arguments.

So VllmPoolReconstruction has two arms — BlockCountTimesBlockSize and UtilizationTimesTotalMemory — and vllm_pool_reconstruction_is_authoritative answers false for both. num_gpu_blocks * block_size is wrong under MLA with the DeepSeek fp8 layout by roughly an order of magnitude, in the direction that looks plausible. It is a typed refusal rather than a warning because it was computed twice, the second time by someone who knew better: the failure isn't ignorance of the rule, it's that the arithmetic is available and reads like a derivation.

There is no interpolation function anywhere. Two points do not establish a shape.

The line class is bound by construction

An earlier head of this PR had a real defect, found by exact-head review 5117692079: VllmObservedKvPool required a captured_line, but it was any NonEmptyStr, and a separate zero-argument helper returned GpuKvCacheSize. The two never met, so this typechecked:

vllm_observed_kv_pool(tokens: …, captured_line: "Maximum concurrency for 262,144 tokens: 9.81x")

The pool carried a line without carrying the KV-cache-size line — and the witness that appeared to cover it proved only that the disconnected helper returned the enum value it was written to return. Permanently green, and cited as coverage.

Pool construction now consumes a typed reading:

vllm_observed_kv_pool_from_reading(tokens, reading: VllmStartupReading) -> VllmKvPoolAdmission

  GpuKvCacheSize        -> KvPoolAdmitted, carrying the reading's own captured_text and revision
  MaximumConcurrency    -> KvPoolRefused { ReadingIsNotTheKvCacheSizeLine { line } }
  ResolvedKvCacheFormat -> KvPoolRefused { ReadingIsNotTheKvCacheSizeLine { line } }

The revision travels from the reading rather than being re-stamped at the call, because re-stamping would launder a stale observation as current. Both older functions are deleted, not kept beside this one — an unchecked constructor next to a checking one makes the refusal satisfiable by calling the other function.

What is guaranteed, and what is not

STRUCTURAL   no pool without a VllmStartupReading, and none from either non-KV line class
MITIGATABLE  agreement between the authored TokenCount and the count the captured text reports

A genuine KV-cache-size line paired with a wrong number is admitted and this module does not detect it. That is stated in the module itself rather than softened, because no row in the battery goes red for a mismatched number. The next-rung trigger is named: a parser under gunbc.spark.serving_readback_parse producing both halves, so neither is authorable independently.

Evidence, executed

8 property rows plus the aggregate — 9/9 PASS. Two of the rows could not exist against the previous shape:

w_the_concurrency_line_refuses_rather_than_becoming_a_pool     the case that used to typecheck
w_the_resolved_format_line_refuses_rather_than_becoming_a_pool  so admission is keyed on BEING the
                                                                kv-cache-size line, not on not being
                                                                the concurrency line

The positive row asserts the reading's text survives into the pool; without that conjunct it would be satisfied by a constructor that accepted the reading and dropped it, which is what the deleted one effectively did. The cap/pool row consumes an admitted pool and returns false on Absent rather than substituting a placeholder.

🤖 Generated with Claude Code

https://claude.ai/code/session_01U397y4s3dSBof7vGPAX87G

gunbc-ci-auto-heal and others added 2 commits September 4, 2026 16:41
SECOND OF THE SPARK SEQUENCE. Independent of the engine axis (#10439): a
pool reading is an upstream fact and needs no policy carrier to exist.

extdeps.vllm.log_lines -- the three startup lines this repository reads,
cited by STABLE PREFIX rather than by position, because a line number is a
position in a stream that reorders whenever logging changes. A reading
carries the revision it was taken at, since a log prefix is an upstream
surface.

extdeps.vllm.kv_cache -- the pool as an OBSERVED carrier.

WHY THE POOL CANNOT BE COMPUTED. It is a residual of large numbers: budget
minus weights minus a PROFILED activation peak minus a cudagraph
reservation. Every term but the first is measured by the engine after it
loads, so small argument changes move it by multiples -- a few points of
utilization moved it several-fold, and adding one batching argument cut it
by two thirds. There is no formula on this side of the boundary that
reproduces it.

SO THE CONSTRUCTOR TAKES THE CAPTURED LINE, NOT JUST A NUMBER. To write a
pool figure you must carry the engine text it came from, so a fabricated
pool must fabricate a log line beside it and is visible in review. Claimed
as MECHANICALLY PREVENTABLE and no higher: nothing stops an author typing
both halves. What it removes is the ACCIDENT -- arithmetic that looks like a
derivation and answers a different question. Next-rung trigger named in the
carrier: a parser over captured stdout, which is
gunbc.spark.serving_readback_parse's job and does not read this line yet.

BLOCK ARITHMETIC IS A DIFFERENT QUANTITY WEARING THE SAME UNITS.
num_gpu_blocks * block_size is the obvious reconstruction and under MLA with
the DeepSeek fp8 layout it reports a small fraction of the logged figure. It
is a typed refusal subject and not a warning because it was computed twice,
the second time by someone who knew better: the failure is not ignorance of
the rule, it is that the arithmetic is available and reads like a
derivation.

CAP AND POOL ARE MEASURED PAIRS AND THERE IS DELIBERATELY NO INTERPOLATION.
A larger cap gave a LARGER pool on this checkpoint, reproduced at two
utilizations -- the opposite of the intuition a formula would have encoded.
Two points do not establish a shape, and a fitted curve would fabricate an
answer for every cap nobody measured.

EVIDENCE. 6 property rows plus the aggregate PASS. Mutation: declaring
block arithmetic authoritative reds w_block_arithmetic_is_not_the_pool
ALONE -- the utilization arm stays green, which is why the two are separate
rows rather than one conjunction that would let either flip unnoticed.

WHAT IS DELIBERATELY NOT CHECKED, recorded in the witness so its absence is
not read as an oversight: there is no row asserting a pool cannot exist
without a captured line. That state has NO CONSTRUCTOR -- the carrier is
sole_constructor with the field required -- so the RED is unauthorable even
in a fixture, and a permanently green check would be cited as coverage
while carrying no information. The construction is the guarantee; these
rows cover what construction does not decide.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U397y4s3dSBof7vGPAX87G

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REQUEST_CHANGES on exact head a11eb53.

The central cut is accepted. VllmObservedKvPool requires a token count, captured text, and revision; both arithmetic reconstructions are explicitly non-authoritative; the two reconstruction arms are witnessed separately; cap/pool observations carry utilization and expose no interpolation function; and the startup vocabulary is keyed by stable prefixes rather than stream positions. Exact-head run 33913757864 is terminal success, all required lanes are green, and GitHub reports the PR mergeable/clean.

One structural connection is missing, and the current witness overclaims it. VllmObservedKvPool carries only captured_line: NonEmptyStr; neither the carrier nor vllm_observed_kv_pool carries/consumes a VllmStartupLine or VllmStartupReading. vllm_observed_kv_pool_line() is a free zero-argument helper returning GpuKvCacheSize, disconnected from every pool construction. Therefore a caller can construct a pool from the MaximumConcurrency or resolved-format captured text and the program still typechecks. w_the_pool_is_read_from_the_kv_cache_size_line proves only that the free helper returns the desired enum; it remains green if every real pool is built from the wrong startup line. Its annotation's claim that a future parser cannot bind the concurrency line and still typecheck is false on this head.

The final property row has the same seam in miniature: w_a_cap_pool_pair_carries_its_utilization_and_its_source_line checks only utilization and max_model_len; it never inspects the pool's captured text or source-line class.

Repair at the source/observation seam, not by strengthening prose. Acceptable narrow shapes include: (1) make the pool consume a typed VllmStartupReading and narrow/refuse unless its line is GpuKvCacheSize; or (2) introduce a specialized KV-cache-size reading minted by that narrowing and make the pool consume it. Then make the witnesses construct a pool, prove a KV-cache-size reading admits, prove the other startup-line classes refuse, and inspect the source carried by the cap/pool observation. The token/text agreement may honestly remain authorable until the named stdout parser exists; this finding is only that the line class currently is not connected at all.

No objection to the observed-not-derived policy, reconstruction refusals, absence of interpolation, three-file scope, or current CI. No merge authorization on this head.

… by construction

Side chat's exact-head review 5117692079 found the claim this module makes about itself to be true of
its prose and false of its executable graph, and it is right.

WHAT WAS WRONG. VllmObservedKvPool required a captured_line, and a separate zero-argument
vllm_observed_kv_pool_line() returned GpuKvCacheSize. Those two never met. The carrier accepted ANY
NonEmptyStr, so this typechecked:

  vllm_observed_kv_pool(tokens: ..., captured_line: "Maximum concurrency for 262,144 tokens: 9.81x")

The pool then carried a line without carrying THE kv-cache-size line. Both witnesses that appeared to
cover this were hollow: w_the_pool_is_read_from_the_kv_cache_size_line proved only that the
disconnected helper returned the enum value it was written to return, and would have stayed green if
every pool in the corpus were built from the concurrency line. That is rung inflation -- a check
cited as coverage that cannot go red for the failure it names.

THE REPAIR IS CONSTRUCTION, NOT A CHECK. vllm_observed_kv_pool_from_reading takes a
VllmStartupReading and returns VllmKvPoolAdmission: the GpuKvCacheSize arm admits and carries the
reading's own captured_text and revision; the other two arms refuse with
ReadingIsNotTheKvCacheSizeLine naming the line handed in. The revision travels FROM the reading
rather than being re-stamped here, because re-stamping would launder a stale observation as current.

BOTH OLD FUNCTIONS ARE DELETED RATHER THAN KEPT BESIDE THE NEW ONE. An unchecked constructor
surviving next to a checking one is the escape hatch section 5 forbids -- the refusal would be
satisfiable by calling the other function.

WHAT IS STILL NOT CLAIMED, written into the module so the rung is not read as higher than it is: the
TOKEN COUNT is authored beside the reading rather than parsed out of it, so an author can still pair
a real kv-cache-size line with a wrong number. The line CLASS is structural; the number is
mitigatable. Same next-rung trigger as before -- a stdout parser producing both halves.

Witnesses 9/9. Two are new and neither could exist against the old shape:
  w_the_concurrency_line_refuses_rather_than_becoming_a_pool -- the case that used to typecheck
  w_the_resolved_format_line_refuses_rather_than_becoming_a_pool -- so admission is keyed on BEING
    the kv-cache-size line, not on not being the concurrency line
The retargeted positive row now asserts the reading's text SURVIVES into the pool; without that
conjunct it would be satisfied by a constructor that accepted the reading and dropped it, which is
what the deleted one effectively did.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U397y4s3dSBof7vGPAX87G
@briansrls
briansrls dismissed their stale review September 4, 2026 21:06

Superseded by source and witness changes on exact head c3a9dc0; replacing with an exact-head review.

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REQUEST_CHANGES on exact head c3a9dc0.

The implementation blocker from review 5117692079 is discharged. vllm_observed_kv_pool_from_reading now consumes VllmStartupReading, admits only GpuKvCacheSize, and returns a typed refusal carrying the supplied line class for both MaximumConcurrency and ResolvedKvCacheFormat. The admitted arm carries the reading's own captured_text and observed_at_revision; it does not re-stamp the revision at pool conversion. Both former escape hatches—the free (TokenCount, NonEmptyStr) constructor and the disconnected zero-argument line helper—are gone. The positive witness inspects the surviving source text, both non-KV line classes have refusing rows, the cap/pool row follows the admitted arm rather than fabricating an Absent placeholder, and the explicit aggregate calls all eight property rows. No behavioral change remains requested.

Two evidence-prose blockers remain.

  1. The source still opens this section with THE POOL IS OBSERVED, AND THE CARRIER IS SHAPED SO THAT A COMPUTED ONE CANNOT BE WRITTEN, and the following paragraph calls that MECHANICALLY PREVENTABLE. That is broader than the graph. The constructor still accepts an independently authored TokenCount, and the same file correctly says an author can pair a real KV-cache-size reading with a wrong number. What is mechanically prevented here is construction from no typed reading or from a reading classified as either non-KV line; numerical agreement between tokens and captured_text remains mitigatable until the named stdout parser exists. Narrow the heading/rung sentence to that exact line-class guarantee. No parser or logic expansion is requested.

  2. The canonical PR body still reports 6 property rows plus the aggregate PASS. This head carries eight property rows plus the aggregate, 9/9 in the reported local run, including the two new non-KV-line refusals. Update the body to describe the typed-reading admission and the current 8+aggregate evidence; once CI terminates, bind the exact-head result to this SHA/run rather than retaining the prior head's evidence count.

Exact-head run 33918777721 names c3a9dc0 and is nonterminal. GitHub currently reports the PR open and mergeable. No merge authorization until the source claim is scoped truthfully, the body is current, a replacement exact-head review is filed, and terminal exact-head CI succeeds.

gunbc-ci-auto-heal and others added 2 commits September 4, 2026 21:20
Side chat's exact-head review 5117851597 accepted the structural repair and found the section
heading still claiming more than the construction provides. It is right, and it is the rung-honesty
rule applied to my own prose rather than to a check.

The heading said the carrier is shaped so that A COMPUTED POOL CANNOT BE WRITTEN, and the paragraph
under it called that MECHANICALLY PREVENTABLE. But the admission function still takes an
independently authored TokenCount, so a genuine kv-cache-size reading paired with the number 1 is
admitted and nothing here detects it. Two paragraphs of the same file already said so; the heading
contradicted them, and a heading is what gets read.

Heading narrowed to what is actually bound -- the source LINE CLASS -- and the guarantee split
explicitly:

  STRUCTURAL   no pool without a VllmStartupReading, and none from either non-KV line class
  MITIGATABLE  agreement between the authored TokenCount and the count the captured text reports

The mitigatable half is stated in full rather than softened, because no row in the battery goes red
for a mismatched number, and a module's reported rung must equal the one its executed evidence
establishes.

Annotation only. No declaration, type, or rule changes. Witnesses re-run: 9/9.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U397y4s3dSBof7vGPAX87G
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U397y4s3dSBof7vGPAX87G
@briansrls
briansrls merged commit e114fed into main Sep 4, 2026
4 checks passed
@briansrls
briansrls deleted the session/eager-pike-541-vllm-pool-observed branch September 4, 2026 22:43
@briansrls
briansrls restored the session/eager-pike-541-vllm-pool-observed branch September 4, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant