Skip to content

Fix llama2 weight loader - #1317

Merged
merrymercy merged 2 commits into
mainfrom
fix-llama2
Sep 3, 2024
Merged

merrymercy merged 2 commits into
mainfrom
fix-llama2

Conversation

@merrymercy

@merrymercy merrymercy commented Sep 3, 2024 •

Copy link
Copy Markdown
Collaborator

CI States

Latest PR Test (Base): ❌ Missing run-ci label -- add it to run CI tests.
Latest PR Test (Extra): ❌ Blocked -- run-ci is required first.

@merrymercy
merrymercy merged commit 12cb115 into main Sep 3, 2024
@merrymercy
merrymercy deleted the fix-llama2 branch September 3, 2024 12:32
timethink pushed a commit to timethink/sglang that referenced this pull request Mar 9, 2025
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 10, 2026
…tead of a 413 (W68)

HALF 1 of 2 (front only; D's X gate follows in its own commit so a
half-applied change can never reach a boot).

THE DEFECT, boot weg2sn5t under a fleet-shape load with a shared ~12.7k-token
agent prefix: 15 of 24 requests returned HTTP 413 `W52 Weg2NoServiceableRoute`,
and EVERY ONE carried `src=exact` -- not one `src=estimate`:

    verdict=none uncached=11116 src=exact chars=130197   x7
    verdict=none uncached=17493 src=exact chars=190197   x3
    verdict=none uncached=19741 src=exact chars=210197   x2
    verdict=none uncached=38839 src=exact chars=250197   x2
    verdict=none uncached=43304 src=exact chars=250197   x1

That is the `carrier_exact` gate: a FIRST-TIME prompt is routed
(`carrier_single`), and only the REPEAT -- after `_note_exact` learned the
exact count -- terminates. A cache hit therefore makes the request WORSE than
a cold one, which is a routing rule, not physics.

TWO PREMISES VERIFIED BEFORE THE EDIT (two earlier premises in this ticket
failed exactly by not being):
1. X IS THE ECONOMIC BREAK-EVEN, NOT A CAPACITY LIMIT -- the launcher's own
   provenance line: `X* = 2*flip_s/(1/r_D - 1/r_P)`, flip_s=2.90,
   r_D=1138 tok/s, r_P=4628 tok/s, floor=4096.
2. D DEMONSTRABLY PREFILLS FAR ABOVE X -- boot weg2sn5n rid weg2-6-9:
   `WEG2-SERVED group=D leg=2 status=200 prompt_tokens=50732 cached_tokens=0`
   with `freed_by=leg2_finished` (no requeue, no P leg 1). 50732 tokens
   direct, 5.8x above X=8742.
So sgl-project#1290's invariant ("never routed to a D single prefill") is about D
REFUSING at its gate and the requeue loop that followed, not about D being
unable. With no carrier route, the slow D-direct path beats a 413.

CHANGE (front): `serviceable_route` gains `per_request_cap` and returns the new
`forced_direct` where it used to return `none`; only a total above the
per-request cap stays terminal, because that is a real capacity wall. The
caller logs `W68 Weg2ForcedDirectPrefill` with total / carrier_max / X /
uncached / reason and an est_ttft derived from r_D (labelled an ESTIMATE), sets
`weg2_no_carrier_route` on the payload for D's gate, and then follows the
existing carrier_single path unchanged. W68 was chosen by ENUMERATING the used
set (`grep -ohE '\bW[0-9]{2} Weg2[A-Za-z]+'`); W59 and W65 came back non-zero.
`--max-kv-per-request` is plumbed front-side with default 0 = NON-terminal, so
an un-plumbed front is strictly more permissive rather than accidentally
terminal, and the launcher passes it at both call sites (dry-run and live).

DEVIATION, NAMED: a soft-rule exception to law 4 (operator 2026-09-10, `Regeln
WEICH, abweichen mit Grund`), counted under its own W-code so the user can veto
it from the census. Everything with a carrier route keeps today's behaviour.

Tests: 13 cases, RED-first (13 failed before the edit). The specimen and all
five 413 shapes of that boot now route; above the cap stays `none`; and the
first-time, carrier-exceeds-but-D-fits, short, long and disabled-bounds
directions are each pinned unchanged. 43 pass with the messages-pricing file.
ruff: unchanged against the baseline tree.

THREE EDITS CAUGHT BY READING BACK, recorded because the discipline is what
found them, not luck: `self.max_kv_per_request` did not exist on the Front;
`max_kv_per_request` was not a parameter of `front_argv_for` (NameError); and a
second `str.replace` matched the text the first one had just inserted, giving a
duplicated keyword argument and a SyntaxError, then left the LIVE call site
un-plumbed while the dry-run one was done twice.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 10, 2026
…e; strip the dead front flag

HALF 2 of 2. D already carried the CARRIER-EXCEEDS exemption and its comment
states the rule this obeys: "derived here rather than carried on the request
... no marker has to survive an HTTP hop to get here."

THE GAP the existing arm left. It fires on `uncached > carry` (the RAW host
pool size, 30518) -- which is why boot weg2sn5n served 50732 tokens DIRECT
(`prompt_tokens=50732 cached_tokens=0`, `freed_by=leg2_finished`, no W50). But
the front's bound is `carrier_max = 0.9 x pool` = 27466, so a band exists where
the front can prove NO carrier route while `uncached` is still BELOW `carry`
and the arm stays silent. Measured on weg2sn5t, every one 413'd:

    uncached=11116 total=32549 | 17493 / 47549 | 19741 / 52549
    carry=30518   carrier_max=27466

Each side was individually consistent; the two were jointly wrong.

FIX: a second arm, `verdict=exempt_no_carrier_route`, exempting when
`total_prompt > carrier_limit and uncached > x`. The limit is READ from
`cache_controller.prefetch_capacity_limit` -- the same live property the
`sgl-project#915 PREFETCH LIMIT` line prints and the launcher reads to set the front's
`--carrier-max-tokens` -- so the two sides agree BY CONSTRUCTION. Retyping the
0.9 here would be a second bookkeeping of the fraction, and the band between
two copies is exactly this defect again. `total_prompt` is the same term
`weg2_uncached_extent` calls `total`. Resolved defensively: no helper or no
host tier -> 0 -> the arm is DISABLED and the pre-sgl-project#1317 verdict stands, the
safe direction.

FRONT, same commit: the dead payload flag is STRIPPED. It could never have
worked -- `AnthropicMessagesRequest` and `ChatCompletionRequest` set no
`model_config`, so pydantic's `extra="ignore"` silently drops an undeclared
field, the hazard `anthropic/protocol.py:456` warns about in its own words
("SILENTLY DROPPED ... and nothing says so"). Making it work would have meant
declaring it across both protocol models plus four more hops through upstream
code, to carry information D can derive locally. The front's W68 line stays as
a COUNT, not a channel.

W68 Weg2ForcedDirectPrefill is used on BOTH sides deliberately: one code for
one deviation, countable end to end from a single census key, so the user can
veto it. The TTFT estimate stays on the front's line, which owns `r_D`; a
second copy of that rate on D would be the very thing these comments are about.

DEVIATION, NAMED: soft-rule exception to law 4 (operator 2026-09-10, `Regeln
WEICH, abweichen mit Grund`). Unchanged for everything the carrier can serve.

Tests: 8 D cases + 13 front cases. RED-first on D (3 band cases refused where
they must not, plus the absent helper); 53 pass with the pre-existing X-gate
suite. 4 mutants killed with an unmutated control: band -> 'none' again; cap
ignored; new arm disabled; gate always exempts (law 4 broken). ruff unchanged
against baseline.

FIFTH EDIT CAUGHT BY READING BACK: `total_prompt` was referenced twice and
defined nowhere (NameError inside the gate), and the first fix broke an
existing X-gate test whose stub binds only the methods the gate used to need.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 10, 2026
…, which MOVED by operator decision

Operator decision 2026-09-10, sgl-project#1317, law-4 NAMED DEVIATION, with sign-off to
re-point these guards rather than leave them asserting the old shape.

WHY THE RULE MOVED, and the arithmetic every edit is annotated with: sb5f
measured uncached 22200 > X 12944 AND total 28000 > carrier_max 27466. The
front now routes that carrier_single (counted W68 Weg2ForcedDirectPrefill) and
D's X gate answers `verdict=exempt_no_carrier_route`, so it is PREFILLED DIRECT
with no W50 and no requeue. The terminal moved to the per-request cap (262144),
which is a real capacity wall rather than an economic one.

sgl-project#1290's measured harm was never the 413 -- it was the CYCLE: front offers, D
refuses by name, front requeues, flip, store read refused, whole prompt
uncached, W50 again; 93 of 93 ending in HTTP 503 after a median 22.0 s with
ZERO tokens streamed. That loop stays closed, by a different mechanism, and the
guards now assert THAT rather than the 413 it used to be closed with.

  1. `test_red_first_the_sb5f_long_prompt_has_no_route` ->
     `test_the_sb5f_long_prompt_is_exempted_not_refused`, same numbers,
     verdict `forced_direct`.
  2. `test_a_no_route_request_gets_413_and_never_touches_the_queue` ->
     `test_only_above_the_per_request_cap_does_a_413_survive`: re-pointed at
     the surviving terminal, still pinning that the refusal RETURNS rather than
     parking and is counted exactly once.
  3. the three `test_mutant_*` keep their intent -- both bounds asked on their
     own base -- with the new verdict. Mutant 1's assertion is sharpened: the
     mutant's error is still caught, because it offers D a prefill D will
     REFUSE, while the fix offers the same prompt as a forced, EXEMPTED one.
  4. `test_a_long_request_is_queued_for_p_and_counted_as_long`: unchanged.
  5. `test_a_terminal_refusal_may_not_rest_on_an_estimate`: the round-2 rule
     STANDS and is now stronger -- neither figure terminates below the cap --
     and the two still differ, which is what the rule is about.
  6. NEW, the anti-loop guard, in two halves because the loop has two: the
     front asserts the band is ROUTED and never counted as a refusal
     (`test_the_band_is_routed_and_never_counted_as_a_refusal`), and the W50
     half is asserted where W50 lives, on D
     (`test_the_sb5f_band_is_exempt_so_no_w50_requeue_cycle_can_start`) -- the
     cycle can only START if D refuses, and it does not.

HARNESS GAP FOUND AND FIXED: `_front()` never set `max_kv_per_request`, so
`handle_generate` raised AttributeError inside the async body and surfaced as
"retry() exceed maximum number of retries" on all seven tests -- an
infrastructure symptom that looked nothing like a routing assertion. Set to 0
(= nothing terminal on that axis, the front's own default); the cap test sets
it explicitly. The front-side anti-loop guard is asserted at the verdict rather
than through `handle_generate`, because the forced path continues into the
D-seat machinery (`_batch_gate`) this harness deliberately does not build.

44 pass across the three touched files. ruff clean.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 10, 2026
USER VERBATIM 2026-09-10 ~04:4xZ: "das ist nicht akzeptabel und widerspricht
dem design." The forced route was an operator-sanctioned soft-rule deviation
from law 4; the user has vetoed it. Reverted in full.

EXACT REVERT, verified rather than asserted: `git diff 1c29ac3 --stat` over
the working tree is EMPTY, i.e. every file the three sgl-project#1317 commits touched is
byte-identical to the pre-sgl-project#1317 tip. Reverts:
  2154f9e  front: forced_direct + W68 + --max-kv-per-request plumbing
  bd451fa  D: exempt_no_carrier_route arm (and its strip of the dead flag,
              which had itself only existed inside this deviation)
  9b0430c  the sgl-project#1290 guards re-pointed at the moved rule

NET STATE, each property checked in the same commit rather than assumed:
  * front `serviceable_route` returns "none" for the band again -> 413 W52;
    no `forced_direct`, no W68, no `--max-kv-per-request` plumbing (its only
    purpose was that route's terminal, so it goes with it -- keeping it would
    have left an unreachable branch and a dead flag on the front and the
    launcher);
  * D's `exempt_no_carrier_route` arm and `_weg2_carrier_limit_tokens` are
    GONE;
  * D's PRE-EXISTING carrier-exceeds exemption (`uncached > carry`, sgl-project#1290
    R-3) is UNTOUCHED -- it is not part of this deviation, it fired 42x on
    boot weg2sn5u for the fleet's cold long prompts, and the user is being
    asked about it separately;
  * the Q0 give-back (`release_admission_acquired_mamba_slot`, 3 call sites)
    is UNTOUCHED -- a different ticket, still fixed;
  * `test_weg2_no_route_1290.py` is back to its ORIGINAL assertions and the
    band guard I added to it is deleted, so the suite guards the rule as
    written;
  * both sgl-project#1317 test files are deleted.

THE FLEET-FACING COST RETURNS, and it should be stated plainly rather than
discovered again: an exact-count REPEAT whose total exceeds carrier_max
(27466) and whose uncached extent exceeds X gets HTTP 413 `W52
Weg2NoServiceableRoute`. Measured on boot weg2sn5t, that was 15 of 24
fleet-shape requests -- a cache hit makes the request worse than a cold one.
That is now the expected, design-conformant verdict until the CARRIER itself
is fixed. The design-conformant fix is pending a user decision; the registered
direction is sgl-project#1236's staging knob after the VRAM exchange (unfundable today at
+10.24 GiB, because the host rings scale with s_gb).
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 10, 2026
…windows 2..n

DESIGN A (user ruling 2026-09-10 'A, und M auf den sn5w-Wert pinnen').
The X gate priced 'uncached' against the TREE only -- device rows plus
host-tier rows. Under the phase law group P prefills the whole backlog and
writes it through to L3, so on group D a long prompt's prefix is in NEITHER
tier and 'total - group_match' priced the WHOLE prompt as uncached work:
W50, re-route, P prefills a store-resident prompt AGAIN. L3 is the carrier,
so a token the carrier holds is CACHED, and uncached now means 'not in the
tree AND not in the store'.

The store depth rides a THIRD ARM of the packed MIN reduce that
_update_uniform_pool_budget already takes -- no new collective (verified:
2 all_reduce sites on branch and parent alike), same canonical head as the
ORDER and COMPLETION arms, MIN in the conservative direction. Its input is
store_presence_pages, which is legal as a group input for a stated reason:
it answers BY CONTENT KEY and under sgl-project#706 the key is a function of the
content, not of any rank's layout or residency.

THE PHASE LAW HOLDS, PROVEN NOT ASSUMED. The credited depth is
anchor-capped (#869b), so by the sgl-project#939 one-chunk law what survives as
genuinely uncached is at most one chunk C. And X >= C on every path:
derive_x_star returns max(int(floor_tokens), ...), the override path
applies max(floor_tokens, int(override)), and floor_tokens is
CHUNKED_PREFILL_TOKENS at the only call site. So D prefills at most a
chunk and never above X, with no launch refusal needed.

C4/C6, reachable ONLY because of A: before A the request was refused in
the waiting-queue pass and never became chunked_req, which is the ordering
refutation of the 0907 spec recorded in section 1bl. Now it is admitted, a
round exists, and the round seam issues the next window. The gate carries
no rank-local term (AST-checked on the executable body): admission
identity plus a mark armed from the GROUP-agreed 'issued:truncated_group'
verdict. No new offset field -- the re-matched tree IS the cursor. The
mark's lifecycle table names its two writers, its reader and the cutover as
the separating event.

--pin-ledger-arm-m pins the ledger arm's M. The pinned arm is still PRICED
by the same price() the ladder uses and REFUSED by name (W39) when it does
not fund at both moments: a pin selects among arms the ledger would fund,
never a way past its verdict. Verified: M=600 funds (launch +5.17, run
+14.19), M=2400 refuses.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 10, 2026
Red-first on the DANGER DIRECTION of this build, which is admission: design
A admits work the old gate refused, so each mutant makes the suite red by
admitting something unservable rather than by moving a number.

M1 a rank-divergent store vote must not become a group credit (MIN, not
MAX -- the blind rank's depth wins). M2 a store-resident prompt must price
as cached (60,000 -> 1, with the old 60,000 asserted beside it). M3 the
surviving remainder must stay bounded by one chunk, swept over prompt
lengths, AND X must stay floored at C on every path -- if a future change
unfloors X, design A's phase-law argument breaks in that test rather than
on a boot. M4 a missing store arm must degrade to the OLD extent, never to
a free admission. M5 the window mark must arm only off the group-agreed
verdict, never off the rank-local truncation key.

Plus the structural guards: the window gate executes no rank-local term
(AST over the executable body, because the docstring names those terms in
prose to forbid them), the mark has exactly the two writers its lifecycle
table claims, the store arm's slice width is checked before it is priced
(W38 -- this arm ADMITS, so a foreign number admits an unservable prefill),
and scheduler.py keeps exactly the parent's two all_reduce sites (MUST
NOT 6). The reduce arm is exercised for real through the pure builder and
a MIN over the payloads -- no collective, no GPU.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 10, 2026
… body, not the text

Measured false positive, caught by the guard failing on its own subject:
weg2_uncached_extent's docstring says 'Deliberately NOT here:
available_size(), free slot counts, time.monotonic()' -- so a source-text
grep for those terms reports the PROHIBITION as a violation. The check now
walks the AST with the docstring excluded, and the shared helper says why
in its own docstring so the next author does not reintroduce the grep. Same
class as the two reverted sgl-project#1318 pins: check the thing, not the prose about
the thing.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 10, 2026
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 10, 2026
…ht a real collision

The W-code uniqueness suite (test_weg2_wcode_uniqueness_1263) failed on my
numbers, and it was right twice over: W38 is ALREADY TAKEN by the retired
'sgl-project#1234 W38 Weg2CarrierlessPpStoreRead', which is still in the census, and
W39 is one of the four numbers that suite asserts are free.

Renumbered by the registry's own rule -- the first free number above the
highest assigned code (W67 here) -- with one extra step: the in-flight xchg
candidate recorded in BOOT_QUEUE.md claims the W69-W85 band on its own
branch, so W86/W87 are the first pair that collide with neither census when
the two lines meet. W86 Weg2XStoreLayoutStop, W87 Weg2PinnedArmRefused,
both named exceptions so the census can see them and a boot log can be
grepped by name rather than by number.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 10, 2026
…rough choose() with one rung -- Q6 boot-killer

Boot weg2sn6a (Q6, 2026-09-10 07:33Z) died in choose_host_ledger:
  TypeError: price() got an unexpected keyword argument 'ring_provenance'
The --pin-ledger-arm-m path priced the pinned arm with a hand-copied
host_ledger.price(...) call that carried choose()'s keywords
(ring_provenance, slab_reclaimable_bytes, cg_ceiling_source, cg_oom_kill),
none of which price() accepts. No test exercised the call; the desk gate was
green (NEW=0) and the union tests too.

Fix: ONE ledger_kw block for the ladder and the pin; the pin calls
host_ledger.choose(..., arms=[(1, M)]) so the pinned arm is scored by the
identical model (slab term, reap bound, W20/W21), and a refusal is re-raised
as W87 with the ladder's own reason. ARM PINNED line kept.

Tests: the source-literal pin test (asserted 'host_ledger.price(' in the
launcher text -- assert-on-a-literal, it passed on the broken code) is
replaced by (1) an AST signature-conformance ratchet over EVERY
host_ledger.<fn>( call in the launcher (red on the broken code: unknown
['ring_provenance', 'slab_reclaimable_bytes', 'cg_ceiling_source',
'cg_oom_kill']) and (2) a behavioural test that records choose()'s arms
through the real choose_host_ledger with a synthetic meminfo/cgroup.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 10, 2026
USER RULING 2026-09-10. carrier_max was 'what can move through D's host
staging pool AS ONE PIECE'. The whole of sgl-project#1317 exists to end that: design A
prices D's uncached extent against STORE presence and the window loop
streams the store-backed span through the pool in W-sized windows, so the
pool is TRANSIT, not a ceiling. The carrier bound therefore no longer
terminates a route.

SPECIMEN, boot weg2sn6c, rid weg2-2-4: 'W52 Weg2NoServiceableRoute
uncached=18453 exceeds X=8742 ... carrier_est=48011 exceeds
carrier_max=27466' -- a 413 at admission for a prompt the rig can serve. W52
appeared 1x in the front log and 0x in D's, so design A, which lives on D's
X gate, could not possibly rescue it. That reachability coupling is what
this closes. The user's prompts are 50-100k tokens; that is the population.

ONE BRANCH, because the fallback needs no front plumbing: if the store
cannot vouch when D prices the prefix (a cold pass whose write-through has
not landed, a failed backup), D's extent stays large and D's OWN
exempt_carrier_exceeds arm -- deliberately untouched -- admits it as a
single prefill. Chain: store vouches -> A credits -> D decodes with a
remainder <= one chunk; store silent -> D's named exemption single-prefills
it. Never a 413 for a servable prompt, and no hand-priced guess at the
front: it stops deciding what D can do and lets D's own admission verdict
decide, which is what the ruling asked for.

PHASE LAW, stated rather than glossed: on the credited path D prefills at
most one chunk (anchor-capped store depth + the sgl-project#939 law, X >= C on every
path), so the law holds. On the FALLBACK path D prefills above X -- the
pre-existing exemption, the ONLY path on which it happens, retained by
explicit ruling. Not introduced here and not hidden here.

The invariant docstring is amended, not left standing: its 'no route exists'
half was true while the pool was a cap and is not any more. An instrument
text that outlives its behaviour is the class this function's own sgl-project#1290
comment is named for.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 10, 2026
USER RULING 2026-09-10. carrier_max was 'what can move through D's host
staging pool AS ONE PIECE'. The whole of sgl-project#1317 exists to end that: design A
prices D's uncached extent against STORE presence and the window loop
streams the store-backed span through the pool in W-sized windows, so the
pool is TRANSIT, not a ceiling. The carrier bound therefore no longer
terminates a route.

SPECIMEN, boot weg2sn6c, rid weg2-2-4: 'W52 Weg2NoServiceableRoute
uncached=18453 exceeds X=8742 ... carrier_est=48011 exceeds
carrier_max=27466' -- a 413 at admission for a prompt the rig can serve. W52
appeared 1x in the front log and 0x in D's, so design A, which lives on D's
X gate, could not possibly rescue it. That reachability coupling is what
this closes. The user's prompts are 50-100k tokens; that is the population.

ONE BRANCH, because the fallback needs no front plumbing: if the store
cannot vouch when D prices the prefix (a cold pass whose write-through has
not landed, a failed backup), D's extent stays large and D's OWN
exempt_carrier_exceeds arm -- deliberately untouched -- admits it as a
single prefill. Chain: store vouches -> A credits -> D decodes with a
remainder <= one chunk; store silent -> D's named exemption single-prefills
it. Never a 413 for a servable prompt, and no hand-priced guess at the
front: it stops deciding what D can do and lets D's own admission verdict
decide, which is what the ruling asked for.

PHASE LAW, stated rather than glossed: on the credited path D prefills at
most one chunk (anchor-capped store depth + the sgl-project#939 law, X >= C on every
path), so the law holds. On the FALLBACK path D prefills above X -- the
pre-existing exemption, the ONLY path on which it happens, retained by
explicit ruling. Not introduced here and not hidden here.

The invariant docstring is amended, not left standing: its 'no route exists'
half was true while the pool was a cap and is not any more. An instrument
text that outlives its behaviour is the class this function's own sgl-project#1290
comment is named for.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 10, 2026
`test_weg2_draftkv_admission_1233.py` asserted the exact string
`WEG2 DRAFT-WARM rid=warm pages=9000 miss=0` -- so it pinned `miss=0` as a
LITERAL and passed whatever the read had actually done. That is the same
defect as the emitter it was guarding, one layer up, and it is why boot
weg2sn6k's acceptance (vi) could read `pages=28671 miss=0` as evidence that
no draft page was missing.

The stand-in controller now carries distinct non-zero draft L3 counters
(hits=8993, misses=7) and the assertions read BOTH of them out of the line,
so a re-literalised emitter fails here instead of passing. `assertNotIn
("miss=0")` keeps the old spelling from coming back by accident.

Found by running the neighbouring sgl-project#1317 files locally before the gate came
back, which is the only reason it is in this cycle rather than in the gate's
NEW column.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 16, 2026
…to the card out of the store releases its host rows

Boot xsn152 (three ~80k prompts): two served from the store with
79126/79128 and 79806/79808 cached; the third got a 503 -- D's host pool
(109,863 slots) kept the first loaded 79k prefix (occupied 38,695) and
the next two 79k reads found available=0 ("sgl-project#915 PREFETCH REFUSED
reason=vote_negative ... host_pool_shortfall", W88 after 64 passes,
"W28 Weg2Leg2Unpriced").

The load-back ack (ack_load_queue drain) now releases the host rows of a
node marked l3_present (its pages came out of the store, sgl-project#1317 C2
writer 2) once it is on the card, under the same transit rule as the
write side: the arena is the L2, the host pool is the DMA transit for
both directions.

Tests: 937, 843, 1157, 869b, retired_966: 62 passed. Metal: xsn153.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 26, 2026
…ess drift, one host-state leak)

Pre-existing reds on desk/27b-unified-0926 @ 61d9241 (also on TK
e5a52d8..7f0c72d). Each was traced to the commit that changed the
pinned surface; none is a runtime defect. Test files only.

- revoke_reissue_1479 x4: NF fnFL2x38 ba5847a (23.09.) made
  _weg2_refetch_one read the class constant WEG2_TAIL_RECOMPUTE_TOKENS; the
  SimpleNamespace holder lacked it (AttributeError, swallowed as "not due" in
  the hold loop). Holder now carries Scheduler's constant, as the NF x36 test
  already does. Red on NF line + unified since the base, green on 27B line.
- wake_kv_first_xsn314: sgl-project#1490 f3fded4 (20.09.) made the one late call read
  the refused-resume verdict (`_weg2_kv_ok = _weg2_kv_block() is not False`);
  the pin counted the bare statement. Now: exactly one call, at the late site
  (mutant: a second early call -> 2 -> red). Red on both lines.
- x36_settle_dormant: 27B xsn437 (unified S7a ae40f81) routes the too-short
  term through `_min_len` (= prefetch_threshold unless min_tokens); pin follows.
  Unified only (the NF line has no min_tokens).
- d_operating_points_1241: d3e9625 (17.09., --spec-form) spells "NEXTN" as
  a FORM name (default + choices); those two sites are removed by name and the
  algorithm literal must stand once. Red on both lines.
- xchg_manifest_1311: sgl-project#1378 c11cd2e (15.09.) put a per-leg cache in front of
  the adapter; the forwarding lives in _weg2_shadow_plan_uncached, the cache
  must pass both terms through (no literal). Red on both lines.
- first_chunk_dynamic_chunking x2: 27B 714aa3b (--p-layer-split dynamic,
  unified via S7f 71bf068) -> bind _p_layer_split_width. Red on 27B line.
- collective_family_siblings_610 x4: 6a9830b (sgl-project#1234 fix 7) and afe89c3
  (sgl-project#1317 A) added two votes to the budget reduce -> bind them and
  _weg2_store_read_is_pending (guard's next descent). Red on both lines.
- 1397_launcher_census_wiring: 27B e54ac95 (c-lane prewarm) is a third
  reader of the SAME published terms; count 3, the prewarm enumerated by its
  log line. Red on 27B line, green on NF.
- corridor_budget_1257 (unpriced floor): not hermetic -- it read the live
  ~/.cache/sglang/corridor_floor_digest.json and, under the runtime venv whose
  NVML fingerprint matches it, resolved MEASURED-D. Pointer aimed at a missing
  file for this case. Red on all three trees under /spinning/htsglang-gpu/.venv.
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