Skip to content

Add e5-mistral embedding model - step 3/3 - #988

Merged
Ying1123 merged 2 commits into
mainfrom
ying-e5-mistral
Aug 8, 2024
Merged

Ying1123 merged 2 commits into
mainfrom
ying-e5-mistral

Conversation

@Ying1123

@Ying1123 Ying1123 commented Aug 8, 2024 •

Copy link
Copy Markdown
Contributor

This is the last PR contains unit test after

Note: does not support input is a list of prompts

@Ying1123
Ying1123 force-pushed the ying-e5-mistral branch 2 times, most recently from 79e4bcd to c961031 Compare August 8, 2024 08:06
Comment thread python/sglang/srt/utils.py Resolved
Comment thread python/sglang/srt/managers/tp_worker.py Resolved
@Ying1123
Ying1123 requested a review from merrymercy August 8, 2024 08:12
@merrymercy

Copy link
Copy Markdown
Collaborator

This PR introduces too many if/else. Follow this principle to refactor them

  1. If there is a if/else branch, make sure the generation branch is the first one
  2. If possible, always use if is_generation instead of if not is_embedding

@Ying1123 Ying1123 mentioned this pull request Aug 8, 2024
15 of 29 tasks
@Ying1123
Ying1123 force-pushed the ying-e5-mistral branch 11 times, most recently from ead6e1f to 84306a9 Compare August 8, 2024 21:56
@Ying1123
Ying1123 force-pushed the ying-e5-mistral branch 2 times, most recently from 881fa81 to 189626c Compare August 8, 2024 23:12
@Ying1123
Ying1123 merged commit e040a24 into main Aug 8, 2024
@Ying1123
Ying1123 deleted the ying-e5-mistral branch August 8, 2024 23:31
@Ying1123 Ying1123 mentioned this pull request Aug 9, 2024
timethink pushed a commit to timethink/sglang that referenced this pull request Mar 9, 2025
hhhh1252023 pushed a commit to hhhh1252023/sglang_public that referenced this pull request Jul 13, 2026
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 31, 2026
…anchor, and measure the loss

KV is DIVISIBLE, the recurrent (mamba/GDN) state is POINTLIKE. Every
length-shifting operation in the load-back chain is KV-built, so the extent it
produces lands, for mamba, on a boundary with no state behind it -- and reusing
a KV prefix there resumes a scan from a state that consumed different tokens.
That is silently wrong, and today it is answered ALL-OR-NOTHING: the whole
load-back falls and the whole prompt re-prefills. The user's grant is the
opposite: re-prefill at most one HiCache chunk, from the KV position that
matches the most current GDN state.

WHAT THIS COMMIT DOES
* Publishes the anchor depth the match walk already computed but discarded.
  `MatchResult.state_anchor_depth` is the absolute depth of `best_match_node`,
  i.e. of the deepest node EVERY component accepted -- mamba's acceptor being
  `is_resume_candidate` itself. The predicate is REUSED, never re-derived; a
  second anchor rule would be the second bookkeeping the upstream-minimal law
  rejects, and sgl-project#747 records what two anchor lineages do to each other.
* `MatchResult.key_match_depth` beside it: how far the KEY matched with no
  validator asked. The PAIR is what separates "the prefix was never stored"
  from "the prefix is here and its anchor died with an evicted node" (sgl-project#1039).
  One hit number collapses them.
* `state_aligned_load_back_len()` -- ONE writer, called by BOTH PPAdmissionEntry
  constructors, rounds PP0's extent DOWN to the anchor and counts what it gave
  back. `None` (no state-bearing component) keeps upstream byte-for-byte; `0`
  (no anchor on this path) is the CORRECT "load back nothing" under leaf-only
  mamba data, never an error.
* `zero_match_result` zeroes the anchor depth too -- a refusal that reaches back
  to the root has no anchor left to point at. Same contract as sgl-project#1018 fixed for
  `cache_protected_len`.

THREE VERIFICATIONS THAT CHANGED THE BUILD (desk-proven at this tree)
* mamba_component.py's `best_depth` is NOT the number to plumb: its block needs
  `SGLANG_MAMBA_CKPT_STRICT_RESUME` (default False) AND `cache_controller is
  None` (false under HiCache), and it sums DEVICE value chunks, which diverge
  from the accepted-anchor depth exactly when `separate_device_match` is on.
* The extent is ALREADY state-aligned RANK-LOCALLY: `host_hit_length` is
  measured from `best_match_node` (full_component.py), and that node is only set
  where the mamba validator accepted. A rank-local rounding is therefore a
  no-op, and is not built as one.
* The real misalignment is CROSS-RANK, at the S1 clamp: PP0's extent is aligned
  in PP0's tree, the cut lands in the receiving rank's. That seam is MEASURED
  here (the FIX-3 refusal now prints the local anchor depth and whether it
  AGREEs with the told extent), not yet fixed -- the population decides the
  design.

INSTRUMENTS (each names its denominator)
* `sgl-project#1040 EXTENT STATE-ALIGN`: kv / extent / loss / anchor_depth / device_len /
  key_match_depth / class, with running totals. The round-down loss is kept
  APART from tokens forgone because no anchor existed -- pooling them inflated
  loss_max from 200 to 300 on the check fixture, which is how it was caught.
* `sgl-project#988 LOADBACK` gains the KV/MAMBA split: kv_applied vs mamba_restored vs
  kv_only. KV moved while the restore refused is a HALF SUCCESS with a named
  link, never a green one.
* `sgl-project#968 LOAD-BACK ROW APPLIED` gains `anchors=` and `retract_survivors=`.
* `reset_for_retract` stamps retraction survival -- the free pre-measurement for
  the lifecycle half (sgl-project#1039); monotone, never cleared, nothing stale behind it.

CHECK (speed mode: one matched check, not a battery)
devtools/check_1040_rounding.py -- hermetic, CUDA-free. Named failure class of
this edit: unit/coordinate error (absolute anchor depth vs the row's delta),
off-by-chunk at the boundary, empty candidate set treated as an error. Trips the
rounding on empty / below / exactly-at / above / pure-KV / no-hit, and walks
`_state_anchor_depth` over a stub chain to pin the unit. ALL PASS, after it
failed on the pooled loss denominator and that was fixed.
py_compile + import smoke on all seven files; ruff clean on the three
most-edited.

cell_1039_ingeneration.sh: stage (iii) moved off `sgl-project#968 LOAD-BACK PROMOTED`,
which the row collapse DELETED (0 live emitters, only a prose mention left --
the sgl-project#995 trap, it would have read 0 forever), onto `sgl-project#968 LOAD-BACK ROW APPLIED`.
Adds the KV/mamba split, the measured loss median/max, the anchor-absent
population, and a zombie test over the four abolished markers.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 31, 2026
…a dict the cut swallowed

TWO EMITTERS MADE HONEST, both instances of the sampling trap this campaign has
now hit four times.

`sgl-project#988 LOADBACK` printed the FIRST event and then every 64th, with no suppression
count. Three lines across three ranks were therefore indistinguishable from "one
application per rank" and from "sixty-three per rank that were never printed" --
and a reproducibility run on boot 15 read exactly that ambiguity and could
conclude NOTHING, in either direction. This is the quantity the whole slice is
judged on, so it is now unconditional.

`sgl-project#1042 EXTENT LIFECYCLE` sampled at n<=3 then every 256th. Boot 15's acceptance
window contained ZERO such lines while the log held nine: the window fell
between samples, and a reader would have concluded "the contract was never
exercised". `set` and `retract` are rare and now print unconditionally; only
`hitless_noop` is still sampled, and it prints how many it skipped.

RUFF CAUGHT A REAL BUG, not a style nit: `_SECOND_CONTINUATION_REFUSALS` (F821)
was swallowed by the sgl-project#1046 cut, which deleted the old `_pp_load_back_extent`
body by slicing to the next `def` -- and that module-level line sat inside the
span. The NameError would have fired only on the sgl-project#959 second-continuation
refusal path, i.e. under specific traffic and probably not on the next boot.
Restored with a note. This is the argument for keeping ruff in the loop even
under speed mode: it is not a suite, it is one pass that can fail on exactly the
class a text-slice deletion produces.

check_1042 and check_1045 re-run green; import smoke confirms the restored
ledger.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 31, 2026
…erted with the architecture

BOOT 15 CRASHED AT 10:59:42, all three schedulers, and the cause is the sgl-project#1046
cut -- reported as mine, not as a pre-existing condition.

    sgl-project#968 LOAD-BACK EXTENT UNREACHABLE for rid=c9d14e69...: PP0 published an
    extent of 4618 token(s) and this rank's load-back yielded only 0

1448 times on one rid, refusing the forwarded schedule on every rank every pass,
until the ring wedged (sgl-project#789 PROXY READINESS TIMEOUT) and the schedulers died.

ROOT: sgl-project#1042's "a hitless match must never clear" was CORRECT while the extent
was consumed A LAP LATER by the delivery row -- the fact had to outlive the
match that made it. sgl-project#1046 moved consumption into the SAME match and I carried
the old rule across unchanged. The extent then outlived its own validity: rid
c9d14e69 kept extent=4618 through a readmit whose match read `host_hit=0`, and
the clamp demanded 4618 from a tree that could serve 0.

THE LESSON IS THE LIFECYCLE LAW ITSELF: a table is valid for ONE architecture.
It must be RE-DERIVED when the consumer moves, never inherited. I built the
table, then broke it by moving the consumer without re-deriving it.

TWO FIXES, both following from the same inversion:

1. A hitless match now CLEARS (`hitless_clear`, was `hitless_noop`). Under local
   consumption the extent is only valid for the match that produced it.

2. `_applied < _lb_extent` is no longer a PPScheduleRefused. That raise existed
   because `_lb_extent` was PP0's PUBLISHED number, so a rank that could not
   reach it would diverge from peers who could. Since sgl-project#1046 the extent is this
   rank's own, so a shortfall means only that this rank's stamp went stale --
   local staleness, not divergence. It now takes what its own tree can serve
   and says so (`sgl-project#1048 EXTENT STALE`), which is uniform because every rank
   re-derives from its own tree. Leaving it a group refusal is what turned a
   stale number into a ring wedge.

ALSO REPORTED: the boot-15 reproducibility run is CONFOUNDED, not negative. Two
cell runs landed on a server that was dying and then dead (deadman CRASH
10:59:47); the repro window's `sgl-project#988 genuine=0` measures the death, not the
mechanism. It is not evidence either way and is not counted as such.

check_1042 updated to pin the INVERTED rule and re-run green; ruff clean apart
from pre-existing E402.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 31, 2026
… owns them

BOOT 19 CAUGHT THIS ON ITS FIRST REAL DROP, which is what the unconditional
refusal line is for:

  11:56:03 PP0  sgl-project#1050 CUTOVER ROW RECLAIM: reclaimed=False full_rows=0
                mamba_slots=0 (tree still held full=213 mamba=1,
                already_free=168) reason=%s

and the census one second later read unaccounted=45 -- exactly 213 - 168. The
differencing was right, the free was not: the filtered ids were rebuilt as a
plain CPU int64 tensor, and `TokenToKVPoolAllocator.free` does
`torch.cat((self.free_pages, free_index))` against DEVICE memory
(allocator/token.py). Cause read off the allocator, not inferred from the
exception name.

FIX: dtype and device come from the source row vector. Also: the refusal now
prints the exception MESSAGE, not just its type -- the first version named the
failure and not the cause, which is one boot of guessing for one f-string.

CHECK: check_1050_cutover_reclaim.py gains the case that fails on the old
version -- a source tensor of a distinctive dtype must arrive at `_free_full`
with that dtype. 19/19 pass. ruff clean.

Boot 19 is otherwise a clean result for everything else it could test:
ORPHANED events 0, sgl-project#988 LOADBACK genuine 3, health 200, and the reclaim was
REACHED at every drop -- the mechanism is wired, this was its argument type.
'full reclaim failed: RuntimeError'
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 31, 2026
…t waited for a chunk the gate refuses to build

BOOT-PROVEN EDGE (boot_855_1050dev_0840f82601_0831_115825, the boot 20
livelock). The open question of the handover was WHY the broken chunk never
completes before the 30 s abandon. It is not a race: inside the armed window
12:22:19-12:22:49 PP0 logged ZERO `Prefill batch` lines and 15 `Decode batch`
lines. The chunk was never attempted, and the re-arm is in the SAME SECOND as
the abandon (12:22:49), so no unarmed window existed in which it could be.
N9's remaining candidate (abandon deadline vs chunk completion time under
growing backlog) is therefore FALSIFIED.

THE BINDING TERM, with file:line. `prefill_blocked_here`
(phase_purity.py:1087-1095) grants the sgl-project#887 one-chunk exception only when BOTH
`prefill_allowed_in_tp_now(spent)` AND `tp_compute_fits_in_one_chunk` hold --
deliberately, so the gate and the sgl-project#838 detector permit the same batches
(REGISTER_OPEN_876 on sgl-project#887). `tp_compute_fits_in_one_chunk` is `0 < pending <
chunked_prefill_size`. The last grant was 12:22:11 with new_tokens=3392 against
a 4096 cap; the backlog then crossed the cap and never came back (12347 ->
48866 -> 101075 tok), so the gate refused on every later round, SILENTLY, at
its final `return not _relaxed(...)`.

The grant is spent AT the grant (`_spend_tp_compute_chunk`), so a refusal on
the `fits` term leaves the budget untouched. The hold
(`prefill_runnable_in_current_layout`, phase_flip_runtime.py:156) read ONLY
that budget, kept answering "TP can still make progress", and
`chunk_blocks_quiescence` kept the rank un-quiescent for ever: PP0 armed 29 /
committed 4 / abandoned 48, `this rank ready=0` in all 72 abandon lines,
backlog 4618 -> 101075 tok.

CLASS: a hold predicate that predicts another gate's decision in a different
currency. SIBLING SWEEP over the three consumers of the sgl-project#887 grant: the gate
itself reads both terms; `maybe_arm_phase_policy` (sgl-project#942, scheduler.py:13611-
13632) reads both terms and says so in its own comment; the flip hold read
one. The fix makes the third consistent with the two that were already right,
by passing the gate's OWN side-effect-free probe rather than a second copy of
it. FUTURE CHECK: a new reader of `tp_compute_budget_remaining` that makes a
runnability claim must also read `tp_compute_fits_in_one_chunk`.

AND THE OPERATOR'S CONDITION, which turns this from a deletion into a
replacement. Once the hold correctly reports "this layout cannot finish the
chunk", the cutover commits over the broken chunk. That is licensed by sgl-project#988
riding the prefix across (loss <= 1 chunk = the sgl-project#939 grant) ONLY while the
COMPLETED pages are settled in the store. The old strict arm blocked on
"incomplete"; it now blocks on the real hazard -- an unacked prefix -- read
from the EXISTING sgl-project#792/sgl-project#703 fence (`ongoing_write_through`, the same counter
sgl-project#1050's `reclaim_rows_for_drop` and `on_idle` gate on), never a second ledger.
Unknown is refusal, never permission. The hold is bounded by the ack
(milliseconds), with the 30 s park deadline still the outer backstop; no
second clock.

UNTOUCHED AND PINNED BY TEST: mid-admission (no pool row -> still blocks),
non-strict (residual, still filed not solved), and pp_to_tp drain-and-flip
(runnable HERE -> still blocks, which is what keeps all prefill in PP).
The PP-microbatch-in-flight half has its own predicate and is not read here.

DETECTION: `_why_not` returned one string for three different holds. It now
names which term is holding, including the new unacked-prefix case.

DESK CHECK (matched to the error class of this edit -- a control-flow
inversion in a restructured predicate, which py_compile and import smoke are
structurally blind to): devtools/check_1033_quiescence_edge.py, 24 cases,
hermetic CUDA_VISIBLE_DEVICES="", all pass. Includes a RED-FIRST arm that
evaluates the PRE-FIX expressions on the measured boot-20 state (budget 2,
pending 48866, cap 4096) and asserts they produce the wedge, and the POST-FIX
expressions on the same state and asserts they commit only against an acked
prefix. Plus compile + import + an order proof that both probes are assigned
before either read inside get_next_batch_to_run.

NOT YET BOOT-PROVEN. This is DESK-PROVEN at the predicate; the metal proof is
boot 21.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 31, 2026
…ch build) and its width-blindness

The old message claimed 'the PP stages are out of step' (a pairing/wire
fault). Boot 1065sets refuted that reading at the log: PP0 and PP1 admitted
the SAME rids at the same slot/fwd_ct and BUILT different batches (extend
902 vs 522) because a HiCache prefetch completed on PP1 between the two
builds and moved that rank's prefix (sgl-project#988 LOADBACK 32768->33148, delta 380
= exactly the row difference). Same class with flip off on 08-28
(boot_863noflip: PP0 ADMIT / PP1 DECLINE). The message now points the next
reader at the ADMISSION, not the wire, and states the guard's width
blindness explicitly: sgl-project#631==0 never proves rank agreement.

Desk check: py_compile green. Text-only change, no control flow touched.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 15, 2026
…tore read: partial hit = admit

Boot xsn121 (991e1ea), rid 06089842 (Q1 prefix + 6.8k appendix): the
told carrier now lands (PP0 told=4095, PP1 ABSORBED/WAITED, 'sgl-project#988 LOADBACK
prefix moved to 4095', no mismatch), but PP0 then went through the sgl-project#1324
'STORE READ INCOMPLETE delivered=4095 deliverable=11126 shortfall=7031'
arm (A12.2 store_prefix_short deferral), re-issued the 7031-token remainder
every pass ('sgl-project#1035 PREFETCH DROPPED host anchor pool exhausted avail=0
size=4', 'sgl-project#915 PREFETCH REFUSED alloc_failed_post_vote'), sat
'ADMISSION-WEDGE: 1 queued, 0 running' for 120 s and died on
'sgl-project#973 RING COMMIT TIMEOUT' -- while PP1 had admitted (extent 4095..8191).

The arm was built for the single-stage CONSUMER (group D, leg 2: P's
write-through still in flight, boot weg2sn6s). On a PP prefill group the
store has no producer to wait for -- the group itself prefills the rest --
so a read that terminated short is a partial hit to admit.
`_weg2_note_store_shortfall` returns None on `ps.pp_size > 1`; the
single-stage form is byte-identical (no ps on the harness doubles -> 1).
Tests: test_weg2_store_consistency_1324 (+1: PP group admits the partial
hit) + test_weg2_store_told_1400: 39 passed.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 18, 2026
…sion and the in-flight park on P

- chunk_admit_active/park_active (group P, SGLANG_WEG2_PARK / SGLANG_WEG2_CHUNK_ADMIT; chunk admission rides with the park)
- chunk_admit_tokens (next chunk + anchor gap), park_verdict (youngest running, never alone, never in-flight-protected, only under pressure), resume_ok, head_of_queue, Weg2ParkReq ring object
- NOT WIRED YET: adder gate, ring dispatch, head-of-step teardown follow (PLAN_P_CHUNK_PARK_0918.md BAUPLAN)

Tests: test_weg2_park_xsn303 (6) + retract_retain xsn302 (7) green
Metal (xsn302, d242699): Punkt 3 PROVEN -- 4 retracts on D (WEG2-RETRACT-RETAIN span 96336-96487), re-admission #cached-token 96255 via sgl-project#988 LOADBACK, all 6 x 20480 tokens completed, 302 tok/s aggregate at bs6/84k context
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 18, 2026
…legs

Flip tail (user priority 2, 18.09.): xsn368/374 measured 1.3 s from
FLIP done to the first decode token, 1.1 s of it the first extend
pass's init_new -- five sgl-project#988 loadbacks (four of ~3.2 GB, host arena ->
device at ~12 GB/s) issued only AFTER the wake, because the kv pool came
back after the last weight leg (on the 5090 it cannot come first: the
sleeper's bands must be paused before 12.3 GB fit).

Now the wake loop checks after every tag's resume (wake_kv.kv_mid_ok):
free - floor - margin >= kv + the next tag's need -> the kv pool is
resumed right there (the resume half, idempotent; the clear half stays
at the late site), and _weg2_preload_hold() runs the adder's own
match_prefix_for_req + init_load_back for every held request on the
same thread, so their pages load while the remaining legs run and the
first extend pass finds them on the device. SGLANG_WEG2_WAKE_KV_MID=0
keeps the old order. Lines: WEG2-WAKE-KV-MID, WEG2-PRELOAD.
Gate: 170 passed, 5 pre-existing failures.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 24, 2026
… Token (fnFL2 H18)

E1 aus H17 (fnFL2x132, rid weg2-0-4, N=97841): D nahm bei 97792 wieder auf
und rechnete 49 Token durch alle 48 Layer (expert-major Sweep 0,20 GiB/Layer,
840-968 ms, kritischer Pfad des Flips).

Gebaut (Schalter SGLANG_WEG2_TAIL_HANDOFF, EnvBool, Default an; 0 = heutige Form):
- P, Schnitt: _weg2_end_anchor_grain gibt unter QSA die Kompressionsrate
  (4) statt der Seite -> c = floor4(N-1) (97840), Restblock 1-4 Token; der
  Baumknoten und sein GDN-Anker bleiben bei floor64(c) (Upstream-Fall
  'unaligned -> retrieve from h').
- P, Aufnahme (weg2/tail_handoff.py): Scheduler.stash_chunked_request nimmt
  nach dem Block [X, c) den GDN-Arbeitsslot (translate_mamba_indices, alle
  lokalen GDN-Layer, temporal + conv) auf dem FORWARD-STREAM in gepinnten
  Host-Speicher (nach dessen Forward, vor dem letzten Block; Event);
  cache_finished_req liest vor 'Free unaligned tail' die KV-Zeilen und die
  QSA-komprimierten Zeilen der Teilseite [floor64(c), c) und schreibt je
  Rang eine Teildatei <arena>/handoff/<rid>.tail.pp<r>-<pid>.{pt,json}
  (Nutzlast zuerst, Kopf zuletzt, atomar, Hintergrund-Thread). Schluessel =
  sha256(extra_key, ids[0:c]) tokengenau; Digest je Abschnitt (SEAM-Stil).
  Zeile 'WEG2-TAIL-PUBLISH rid= page_prefix= tail_rows= state_at= ...'.
  Aufbewahrung: die Teile der 2 neuesten rids.
- D, Probe am sgl-project#988-Load-back: Schluessel, Praefix, Layer-Abdeckung und
  Zeilenformen gegen die eigenen Pools; Zeile 'WEG2-TAIL-READY ... verdict=
  ready|<Grund> adopt=not_wired'.

NICHT gebaut (Codestellen im Bericht): die Uebernahme auf D (Seite am
Commit-Punkt von add_one_req, 48 Zeilen H2D, prefix_indices, extend [c, N),
Zustand nach dem Deferred-COW in model_runner nach _wait_for_mamba_layer,
MIN-Urteil im gepackten Vektor von check_prefetch_progress). Bis dahin
aendert der Schalter die Flipzeit nicht.

Tests: test_weg2_tail_handoff_h18.py (Schnitt fuer N%64==0 / N%4==0,
Schluessel, MIN, Auswahl der Zeilen und des Slots, Digest, Abdeckung,
Probe-Urteile), test_weg2_zero_remainder_1233.py x14 fuer an/aus,
test_scheduler_chunked_req_gate.py Stub traegt page_size/forward_stream.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 26, 2026
…e nur zu zaehlen -- rc9l-Nachlauf dkrnfbar1rc9l09260540 hing ab 05:55:54 (D-Log Z. 58506-58519, rid weg2-21-21): TP0 matchte 19712 auf einem host-gedeckten Anker (MAMBA-HOST-RESUME depth=19712), TP1/TP2 16384, Gruppen-MIN 16384; TP0 schrieb 'RU FLOOR ABOVE-GROUP ... counted, not acted on', setzte sgl-project#1042 EXTENT 19712 und sgl-project#988 LOADBACK 19712, TP1/TP2 16384 -> verschiedene Extends, TP0 baute allein einen JIT-Kern, Gruppe stand bis zum Watchdog. Wurzel: H93 (RU) handelte nur bei Gruppe == 0; das Band 0 < Gruppe < lokal war als "Extent/LOADBACK konvergiert" angenommen und nie belegt. Fix: tp_match_floor.group_floor_cap nennt die Gruppentiefe, MambaComponent.finalize_match_result matcht VOR dem COW den auf genau diese Tiefe gekuerzten Schluessel neu (rematch_at_group_depth; der verschachtelte Match sieht 'agree' und macht seinen eigenen COW), Zeile 'RU FLOOR CAP'. Erreicht der Rang die Gruppentiefe nicht (kein Anker dort), stirbt er benannt (RankFloorCapMiss 'H96 RU FLOOR CAP-MISS') statt allein weiterzulaufen. Die Gruppentiefe ist das MIN aller Stimmen, TP0s Host-Abdeckung ist auf dieser Form Obermenge von TP1/TP2 -> der Anker liegt dort. Keine neuen Kollektive, kein Schalter. Tests test_nf_rank_floor_cap_h96 (7): 4 rot auf 6cda2aa (darunter der Verhaltenstest ueber die echte finalize_match_result: TP0 nahm 19712), gruen mit Fix; RU-Suite 15 gruen; H93-Suitenliste ohne neue Rote (19 Altlasten wie auf 6cda2aa)
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 26, 2026
…e), no 1.3*X band -- behind SGLANG_WEG2_FRONT_EXACT_TOKENS (default off)

User decision 26.09. ~19:00Z (memory d2p-sofort-flippen-und-x-exakt-0926): X holds
EXACTLY for the pending tokens; the 1.3*X SHORT band (release table row 15, an open
question, never built) is dropped.

Measured, boot dkr27brc10bar1agent09261821 (front.log, 114 requests): chars/3 over-
counted whole prompts by median 11.5 % (3.35 real chars/token, up to +60 %); D-direct
error median +11, |median| 125, range -4481..+4273; misroutes: 1 SHORT really > X
(weg2-10-7 3939/4780), 2 LONG really <= X (30-97, 30-106), ~6 LONG only by the chars/3
over-count. 9/78 D-direct under-priced by 1.0-4.7k: D resumes only at the Mamba anchor
(sgl-project#988 LOADBACK anchor_depth = P's cached of the predecessor) -- a D cache fact, logged
per request (X-EXACT-ERR), not banded.

On: weg2/front_tokens.py builds D's OWN rendering stack in the front (AnthropicServing +
OpenAIServingChat + TemplateManager) from the group's /get_server_info server args
(tokenizer_path, chat_template, chat_template_default_kwargs, parsers), so the count is
D's count_tokens code; pending = tokens - min(D's measurement, token LCP) (TokenSpans,
sgl-project#1324/sgl-project#49 semantics in tokens, epoch-bound held credit). One worker thread, incremental
per <|im_start|> segment (special token -> exact split). Lines: X-EXACT READY / PRICE /
FALLBACK (not ready, timeout, multimodal, path) / TOKENS (front vs group count) / ERR.
Off: nothing constructed or imported; ROUTE-VERDICT and X-ROUTE bytes unchanged.

Cost (desk, 27B INT8): 160k tokens cold 302 ms, next turn 55 ms, event-loop max lag
31 ms; load 7 s, RSS +608 MiB first load. NF INT4 160k: cold 251, warm 57 ms.

Tests: test_weg2_front_x_exact.py 21/21 (real tokenizers 27B INT8 + NF INT4-mixed:
count == D count_tokens on real-text Claude-Code payloads, segmented == whole on 300
hostile strings, MZ inline-system parity, boundary X/X+1, credit, fallback, residual
error log, switch off byte-identical). Affected suites (p49, sgl-project#49, inflight, messages
pricing/usage, idle policy, dp wait, flipfast, vision economics, H75/H78, no_route_1290,
x-split): 283 passed, 2 failed = test_weg2_no_route_1290 TheRouterEndToEnd x2, identical
red on base c51591f (Front has no attribute 'vision'). dup_defs_gate exit 0.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 26, 2026
…e), no 1.3*X band -- behind SGLANG_WEG2_FRONT_EXACT_TOKENS (default off)

User decision 26.09. ~19:00Z (memory d2p-sofort-flippen-und-x-exakt-0926): X holds
EXACTLY for the pending tokens; the 1.3*X SHORT band (release table row 15, an open
question, never built) is dropped.

Measured, boot dkr27brc10bar1agent09261821 (front.log, 114 requests): chars/3 over-
counted whole prompts by median 11.5 % (3.35 real chars/token, up to +60 %); D-direct
error median +11, |median| 125, range -4481..+4273; misroutes: 1 SHORT really > X
(weg2-10-7 3939/4780), 2 LONG really <= X (30-97, 30-106), ~6 LONG only by the chars/3
over-count. 9/78 D-direct under-priced by 1.0-4.7k: D resumes only at the Mamba anchor
(sgl-project#988 LOADBACK anchor_depth = P's cached of the predecessor) -- a D cache fact, logged
per request (X-EXACT-ERR), not banded.

On: weg2/front_tokens.py builds D's OWN rendering stack in the front (AnthropicServing +
OpenAIServingChat + TemplateManager) from the group's /get_server_info server args
(tokenizer_path, chat_template, chat_template_default_kwargs, parsers), so the count is
D's count_tokens code; pending = tokens - min(D's measurement, token LCP) (TokenSpans,
sgl-project#1324/sgl-project#49 semantics in tokens, epoch-bound held credit). One worker thread, incremental
per <|im_start|> segment (special token -> exact split). Lines: X-EXACT READY / PRICE /
FALLBACK (not ready, timeout, multimodal, path) / TOKENS (front vs group count) / ERR.
Off: nothing constructed or imported; ROUTE-VERDICT and X-ROUTE bytes unchanged.

Cost (desk, 27B INT8): 160k tokens cold 302 ms, next turn 55 ms, event-loop max lag
31 ms; load 7 s, RSS +608 MiB first load. NF INT4 160k: cold 251, warm 57 ms.

Tests: test_weg2_front_x_exact.py 21/21 (real tokenizers 27B INT8 + NF INT4-mixed:
count == D count_tokens on real-text Claude-Code payloads, segmented == whole on 300
hostile strings, MZ inline-system parity, boundary X/X+1, credit, fallback, residual
error log, switch off byte-identical). Affected suites (p49, sgl-project#49, inflight, messages
pricing/usage, idle policy, dp wait, flipfast, vision economics, H75/H78, no_route_1290,
x-split): 283 passed, 2 failed = test_weg2_no_route_1290 TheRouterEndToEnd x2, identical
red on base c51591f (Front has no attribute 'vision'). dup_defs_gate exit 0.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 27, 2026
…told=0 for every rank

Metal rc12k27 b1 (dkr27breleasedraftbar1w109270932, 9417507), 09:45:58, rid weg2-10-95: W27 on
PP1, 1024 rows for 512 tokens, sender_geom=(512, 1536) receiver_geom=(16895, 17407). Fix A held
(P-CHUNK-BUDGET pos=16383 pos_src=told width=512 on all three ranks); the split was the START:
  * PP0 put Admit(told=16383, absolute) on the wire -- head 16383 = what ITS registration matched in
    its own tree, span 0;
  * PP0's own admission in the same pass: [sgl-project#928 anchor] REFUSING resume ... match_tokens=69
    best_value_len=0 kv_host_hit=0 -> re-prefill, P-CHUNK-POLICY plan start=512 pick=mid=1024;
  * PP1/PP2 read 16383 from the store WITH the anchor (sgl-project#988 LOADBACK ... mamba_restored=33) and
    extended from 16383 at the budget width 512.
The authority admitted a different prefix than the one it told; the width split followed from the
start. Why PP0's head was gone: nothing holds a registered-but-not-admitted head; at 09:45:55 PP0
loaded weg2-10-93 back into the whole device KV pool (WEG2-ARENA-LOAD rows=151514 dst=[1,265705] of
265706), which evicts every unlocked device node. (sgl-project#1469's 600-line trail was exhausted at 09:40,
so the evicting call itself is not on this boot's record.)

managers/weg2_told_fidelity.py (SGLANG_WEG2_TOLD_FIDELITY, default on; 0 = the old Admit byte for
byte): right before PP0 appends an Admit with told > 0 -- paced form, both the window path and the
PF fallback path -- it asks its own tree (match_prefix with the fetch's key form, capped at the
told depth; the sgl-project#928 (a) rule read-only: 0 when the deepest node carries no state on device or
host) what its admission will resume from. The depth is the told itself when absolute (twin /
TK ABS-TOLD), head + span otherwise. Less than that -> the Admit carries told=0 with the PF fallback
marker: PP0 releases its own read, every follower releases its read (follower_release) and every
stage prefills from 0 -- decided before any follower adopts. A probe that cannot be asked gives no
verdict; the check is decided before any import (a tree without match_prefix costs nothing -- the
PF gloo ring measured PP0's publish at 10.7 s when the imports came first).

pp_admission_congruence.divergence_cause: the W27 text now names the split read off the two
geometries -- START-SPLIT (with both prefixes; "PP0's told was not the prefix one side admitted"),
WIDTH-SPLIT (same start, different chunk width), RID-SPLIT.

Not built (single-phase told form): the rig runs the paced form (#1416e PACED-TOLD/ADMIT on b1).

Tests: test_27b_told_fidelity_0927.py 11 (metal W27 provenance -> START-SPLIT; width/rid/absent;
sgl-project#928 state rule on nodes incl. host anchor and dense tree; metal case retold 0 with the log line;
resumable told kept, asked with told keys incl. bigram; span-relative told checked at head+span;
no probe / raising probe / switch off / told 0 keep the Admit; #1416e ring: PP0 that lost its head
-> one Admit told=0 fallback, every rank admits the same PP0 pass at cap 0; resumable -> 100000
unchanged; switch off -> old Admit, no probe; wiring order). Affected suites per file (store_told
1400/hold_tk/paced_1416e/positive_tk, told_group_fallback_pf, p_twin_defer, width_divergence_1233,
admission_congruence_791, admission_wiring_791, p_budget_rank_identical, p_intake_h91a): 133 passed,
4 failed -- the same 4 fail on the base 3e5a263 (791 module-imports-no-torch x1, wiring_791 x3).
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 27, 2026
… Gruppe -- Worker uebernehmen ihn, Uneinigkeit ist ein benannter Stopp

dpr-Tod (rc12j 3e97ef0, dkrnfh91dprbar1dauer09270832, D-Log 203833-203988, 08:51:31): weg2-14-70, host-gedeckter Treffer 75264 (KV-Key 81856, uncached 6817). Alle Raenge matchten 75264 (sgl-project#1042), X-GATE admit und sgl-project#794 3712 ueberall gleich; TP1/TP2 bauten den Extend (sgl-project#969 n=68 prefix 75264, 3712 Zeilen) und gingen in den Forward, TP0 schrieb fuer den rid nichts mehr: kein sgl-project#969, kein sgl-project#988 LOADBACK (unbedingt geloggt), kein WEG2-ARENA-LOAD, kein WEG2-LOADBACK-WAIT (im ganzen Boot 0x, druckt seine ersten drei). TP0 verliess PrefillAdder.add_one_req also VOR init_load_back -- dort sind die einzigen rang-lokalen Ausgaenge die Gates `total_tokens >= rem_total_tokens` (NO_TOKEN, stumm; batch_is_full haelt den rid in der Queue). Watchdog-Batch TP0 08:56:59 = Decode 12-55/14-73/14-62/14-65/14-71 ohne 14-70, Pool available=99008 evictable=704. Arena-Pin (2436) war ab 08:50:59 flach und wird vor init_load_back nicht gefragt -- es ist das KV-Budget-Gate, nicht das Arena-Pin-Budget. rc12g-Tod 09:21:17 (8f0bf40, #791b DIGEST MISMATCH, weg2-13-55) ist dieselbe Klasse: TP0 extent 52288 (0 Device-Zeilen), Worker sgl-project#988 extent=128.

Wurzel: das Gate bepreist `fill - len(prefix_indices)`. Auf TP0 (einziger Rang mit KV- und Arena-Bytes) ist der Treffer host-gedeckt, 0 Device-Zeilen bis zum Load-back HINTER dem Gate (82081 bzw. 52288 Zeilen + Reservierung); die Worker gehen mit Device-Praefix hinein und bepreisen 6817 bzw. 44+128. Gleicher rid, gleiche Arithmetik, zwei Verdikte.

Fix (H98-Form, TP0 entscheidet, Worker folgen):
- add_one_req sammelt die rang-lokalen Budget-Gates (vor und im Lock) zu EINEM Verdikt; auf Form A nimmt jeder Rang an genau einer Stelle -- im Lock, nach allen Gates, vor dem Load-back und der Tail-Adopt-Abstimmung -- den Verdikt des Hosts (Scheduler._form_a_admission_follow_fn, ein gestempelter broadcast_pyobj von TP0 je Gate-Aufruf, Watchdog-Arm chain-recv/form-a-admission/tp<-verdict). Host-NO_TOKEN laesst den Request auf allen Raengen in der Queue.
- Riegel: rid im Verdikt -> "H105 RU FORM-A ADMISSION SPLIT"; nach der Schleife vergleicht jeder Rang die gebaute Extend-Menge (rid, start, end) mit der des Hosts -> "H105 RU FORM-A EXTEND-SET SPLIT"; verschiedene Zahl von Gate-Aufrufen -> "... MALFORMED" (benannt statt Hang).
- Warte-Zeile "H105 RU FORM-A ADMISSION WAIT rid host_price host_budget local_price local_budget refusals waited_s" und "AFTER-WAIT" beim Zulassen.
- Ausserhalb Form A (tp 1, pp > 1, SGLANG_WEG2_ENABLE_FORM_A_TP0_FOLLOW aus, 27B) wird nichts installiert: Gates rang-lokal, byte-gleich, kein Broadcast.

Tests test_nf_form_a_admission_follow_h105.py: dpr-Form ueber das echte add_one_req und die echten Scheduler-Methoden (Basis 9417507 rot: Host NO_TOKEN, Worker admit), Aufrufzahl-Riegel, kein Aushungern (Pass n abgelehnt, n+k zugelassen, Raenge einig, Warte-Zeile mit beiden Preisen), Aus-Pfad.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 27, 2026
… kept out

User orders 2026-09-27 (via the 27B operator):
- Cache panel per boot: 'aus Cache / neu' = sum #cached-token / #new-token
  of the 'Prefill batch' lines (first rank only, each chunk once), 60 s and
  since boot, for P and D (for D this is mostly P's handed-over prefix,
  said on the page); L2 = 'sgl-project#988 LOADBACK' (TP0) with anchor_depth tokens;
  MAMBA-HOST-RESUME events; L3 = 'STORE READ INCOMPLETE' delivered /
  deliverable (only incomplete reads are logged, said on the page); the
  front's WEG2-SERVED cached_tokens/prompt_tokens per request.  L1-device
  is not logged separately and is named as an upper bound only.
- Totals since boot on the card and in the history table: P and D new
  prefill tokens (sum #new-token, PP0/TP0 only), decoded tokens (sum
  completion_tokens of WEG2-SERVED, once per request).  Logs are now read
  from their start (8 MB per slice, per-boot locks), so 'since boot' is
  the whole boot; a progress chip shows while the count catches up.
- redact.py: log lines naming a key (ADMIN-KEY, .adminkey, auth=bearer,
  WEG2-GROUP-ENV, ...) are dropped at ingestion, inline secret values are
  cut, and every JSON answer passes a final guard -- the page is reachable
  from outside now.

Tests: rigdash 40 passed (new: once-per-chunk/request counting with PP1
and TP1 duplicates ignored, ADMIN-KEY line never in the view).
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 27, 2026
…its nodes store -- a page carrying another depth's key is re-keyed to its own and loads its own slot

rc12n (92a6ecb) D-TP0 12:57:43, D-Log Z. 63225-63312: 'sgl-project#1424 CHAIN MISMATCH: the chain's rows are not whole distinct pages although every node's pages match their keys (5 node(s))' in load_back <- init_load_back <- add_one_req, the first loadback after the resume fence; CHAIN REPAIRED 0x in that boot. Form as at 11:49: two parked rids of ONE conversation (weg2-1-18 second piece loaded 768, extent 45824 on all ranks; weg2-1-20 second piece loaded 512, extent TP0 24832 / TP1,TP2 21824 = H98), MAMBA-HOST-RESUME depth 24320 on all ranks. TP1/TP2 loaded weg2-1-18 (sgl-project#988 LOADBACK 45824), TP0 died on it.

Why the duplicate was not legal: a page key is content-chained over the whole prefix, so one prefix never holds one key at two depths, and the arena index maps a key to exactly one slot (find_slot checks the 128-bit key). Every node matching its STORED keys and the chain still holding one slot twice therefore means one stored key twice: a node carries the key of another depth (the second piece shifted onto the page before it), and its rows -- resolved by that key -- are that depth's KV. The row gather would have loaded page j-1's KV under page j's tokens: a wrong answer, not a crash. The refusal was right; the proof was against the wrong authority.

Fix (arena_pool.verify_load_chain, UnifiedRadixCache._1424_verify_load_chain):
- the admissible keys of page j are P's hand-off key for depth j (the request's chain, handoff_keys.CHAIN_ATTR, indexed from token 0; page0 = depth of the first loaded page from the ancestors) and D's own key of the page's tokens chained from the proven page before it (get_hash_str on the node's key slice, computed only when P's key does not already prove the page);
- a stored key that is admissible keeps its slot (rows re-pointed to it when they are not its ids, as before);
- a stored key that is neither is replaced by the first admissible key whose slot is COMPLETE, the node's hash_value corrected in place, the slot referenced -- line 'sgl-project#1424 CHAIN REKEYED n= nodes= page0= node=.. page=.. depth_page=.. old->new';
- a clean chain that carries one of P's keys at another depth (no twin, so the old shape check let it through) is caught by the same proof -- one dict lookup per page;
- anything no admissible key can prove stays a named stop, now with node, page and depth ('sgl-project#1424 CHAIN MISMATCH node= page= depth_page= ... no admissible key has a COMPLETE slot'), and a remaining twin names its pages ('repeated pages (page, first seen)').
The writer of the shifted key is not in the log (INSERT-PLACED is rate-limited, the rid is cut to 8 chars); the REKEYED line names node, depth and both keys the next time.

Tests test_arena_chain_rekey_1424c (7, the real verify_load_chain + ArenaMHAHostPool._load_arena on CPU tensors, the real _1424_verify_load_chain over a parented tree with the request's chain): the premise (the metal chain holds slot of a3 at depth 3 and 4; stored keys alone prove nothing -> stop); metal shape re-keyed a3,a4 -> a4,a5 and the loaded bytes are each page's own slot; a shifted key without a twin is caught; pages beyond P's chain proven by D's own chained key; an admissible chain costs no lookup; an unprovable page is a named stop with its depth; the wrapper reads depth and chain from tree and request. Base 7cac9f5: 6 red (the premise test holds there too), fix 7/7; test_arena_page_load_duplicate_rows_1424 9/9 on both.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 27, 2026
…can pay; an under-delivering peel repairs the frontier once and names the rest

Metal rc12o b1 (dkr27breleasedraftbar1w109271344, 732d629), P log 54255-54280, PP0 13:56:43Z,
weg2-8-62: MAMBA-HOST-RESUME anchor 45238 -> sgl-project#988 LOADBACK 45238 -> WEG2-ARENA-LOAD rows=42216 (the
SF same-pass room evicted exactly the load's shortfall; its line n=9 is not printed by the sampler),
then the 512-token extend: "Available full tokens: 149167 (full_available_size=46 +
full_evictable_size_=149121)", "EVICTION UNDER-DELIVERED: asked for 512 tokens, the pool received 0".
PP0 prints no sgl-project#1421 BACKUP-REFUSED in the whole boot: no leaf was tried and refused -- the peel found
none it could pay.

Why the two numbers disagree: component_evictable_size_[FULL] counts every device node whose FULL
lock_ref is 0; the frontier (evictable_device_leaves, _is_device_leaf) admits a node only when EVERY
component's lock_ref is 0 and no child holds FULL rows. A MAMBA lock pins its node alone
(MambaComponent.acquire_component_lock), so an anchor node with FULL 0 / MAMBA >0 is counted and never
peeled, and every FULL-unlocked ancestor above it keeps a device child and never becomes a leaf.
NF's (b) -- the freshly loaded 42216 rows -- is not it: the load-back's inc_lock_ref moves them to
protected. The admission (PrefillAdder.rem_total_tokens, re-read after the load-back inside
add_one_req; common.fundable_extend_tokens -> chunk_tokens_the_pool_can_fund) read the reported
count and let the chunk through with 46 free.

ED (SGLANG_EVICTABLE_DELIVERABLE, default on; 0 = the reported count): MambaComponent records the
0->1 / 1->0 transitions of a node's device mamba lock (mem_cache/evict_frontier_census.note_aux_lock);
UnifiedRadixCache.deliverable_evictable_size() = reported FULL-evictable minus blocked_tokens (every
aux-locked node with FULL lock 0 and its FULL-unlocked ancestors up to the first FULL-locked one, each
once). rem_total_tokens (hybrid-SSM branch) and fundable_extend_tokens read it, so an unfundable chunk
answers NO_TOKEN / parks instead of OOM-ing in alloc_for_extend. The reported count, pool statistics
and every other reader are unchanged.

EF (SGLANG_EVICT_FRONTIER_REPAIR, default on; 0 = the old peel): FullComponent.drive_eviction, when the
peel ends short while the tree still reports evictable tokens, scans the tree once
(_collect_all_nodes), re-derives every node's leaf membership, retries the peel and logs
EVICT-FRONTIER-CENSUS (request, delivered before/after, reported, FULL-unlocked tokens, on the
frontier, aux-locked per component, behind a device child, leaves before/after, stale_added, ids).

Not changed: SF local_pp_room still evicts only the load's own shortfall (the extend is then priced by
ED and parks if the pool cannot pay it).

Tests: test_evictable_deliverable_rc12o_0927.py 10 (b1 shape: a mamba-locked tail blocks its 149121-
token chain, deliverable = the free leaf only, switch off = reported, lock gone = nothing blocked; walk
stops at a FULL-locked ancestor, shared ancestors once; FULL-locked aux node blocks nothing; the real
MambaComponent lock/unlock transitions feed the set; fundable_extend_tokens 46 instead of 149167;
adder wiring; EF: stale frontier repaired and paid with the census line, switch off = old peel, a
paying peel scans nothing, the census names the aux-locked chain).

Review (NF), amended:
  * Rank uniformity. Form A (NF-D): the host's vote decides (H105); a worker's tree is marked
    _ef_deliverable_exempt at every adder build and keeps the reported count, so its local extend
    arithmetic is the pre-ED one (test_nf_form_a_admission_follow_h105 + every *form_a* suite: 135
    passed with the ED file). Classic TP (27B-D): the published floor (fundable_extend_floor, sgl-project#681)
    reads fundable_extend_tokens, i.e. the deliverable count; the aux lock set is replicated with the
    tree (the same requests lock the same nodes), as the reported count was. P (carrierless PP): every
    stage plans for itself (pp_row_carrier_present False); the deliverable count is exactly as
    rank-local as the reported count and the free rows it is added to were -- no PP0 verdict is
    adopted on this form; sgl-project#1004 / sgl-project#1233 W27 remain the named stops.
  * Cost: blocked_tokens is memoised per cache on (aux-lock version, FULL evictable, FULL protected)
    -- recomputed only when one moved; timed, one ED-DELIVERABLE line per 60 s (calls, scans,
    scan_us_mean/max, blocked, aux_locked_nodes).

Operator fix: deliverable count read from the tree CLASS via common.deliverable_evictable_or (a duck-typed getattr on a MagicMock tree returned a mock and broke 681/971/prefill_adder/959/656); non-int answers fall back.
Tests: 255 suites vs base 732d629: after the fix the five admission suites are green again; ED file 15 passed.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 27, 2026
… so the same pass's extend evicts what it needs; a rank-local extend relief provider is the net

Metal rc12q (dkr27breleasedraftbar1w109271525, 21d7e3b, with ED/EF), P log, PP2 15:38:49Z, weg2-4-37:
  SF LOADBACK-ROOM SAME-PASS kv_tokens=5932 floor=5336 avail=5336 evictable=245003 evicted=810 avail_after=6146
  sgl-project#988 LOADBACK prefix moved to 20479; WEG2-ARENA-LOAD rows=5932
  sgl-project#969 EXTENT (20479, 21254) 775 -> "extend allocation failed and NO relief provider" -> Out of memory
Root: alloc_token_slots' eviction trigger reads uniform_avail_for_evict = published floor - admitted
ledger. The floor (5336, published at the top of the iteration, this rank's own value on P) was not
charged for the load-back's 5932 rows (cache_controller.load allocates outside the ledger), so the
trigger read 5336 >= 775 and SKIPPED, while the live pool held 6146 - 5932 = 214 -> alloc failed with
245003 evictable.

(1) weg2/pp_slot_fidelity.note_loaded: UnifiedRadixCache.load_back, after a successful device load,
    charges the loaded rows to the floor ledger (note_uniform_admitted) -- only while the floor is
    marked local-PP (tp group of one, pp>1) and SF is on. The same pass's extend trigger then reads
    5336 - 5932 < 775 and evicts. On a TP group the ledger is untouched (group MIN, replicated).
(2) ensure_relief_provider: once per process (registered from the single-rank floor publish, pp>1),
    a rank-local provider for common.register_extend_relief_provider: acts only while the tree's floor
    is marked local-PP (returns 0 and touches nothing on a TP group, so D's replicas cannot diverge),
    evicts exactly num_tokens - available, applies staged frees, logs "EXTEND-RELIEF evicted asked
    avail a->b evictable_left (n)".
Not built: SF pre-evicting kv_tokens + this pass's extend inside local_pp_room -- the extend width is
not known at load-back time; with (1) the extend's own trigger evicts the exact amount it needs.
Switch: SGLANG_WEG2_PP_SLOT_FIDELITY (SF's own; 0 = no charge, no provider).

Tests: test_weg2_sf_extend_relief_rc12q_0927.py 6 with the metal numbers (floor/avail 5336, evictable
245003, load 5932, extend 775): the charge makes the extend trigger evict and the alloc succeed;
without charge or net -> Out of memory (the metal); the provider alone funds it and logs EXTEND-RELIEF
asked=775, registered once; on a group floor the provider returns 0 and touches nothing; charge only
on the local-PP form and with the switch; wiring (load_back, scheduler).
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 27, 2026
…ile a younger one runs pauses the youngest -- its KV leaves only as far as needed; sgl-project#248 keep_role behind a guarded import

The user's design (SA, 312abdc0b3) displaces "jüngere ... ganz oder teilweise". Feasibility note
tmp/pa/TEILPARKEN_notiz_0927.md: a decode cannot continue with part of its KV off the device on this
model form (full attention reads every position each step; HiSparse exists only for DeepSeek DSA;
GDN/Mamba state is all-or-nothing; DCP uneven and the MTP/DFlash draft need their share whole). So the
displaced one pauses, and "teilweise" is how much KV leaves: release_req(retain=True) frees no page,
the span stays evictable in the tree, and the older one's allocation evicts only the missing amount
(LRU: older cache remnants first, the displaced tail last; write_back -> L2/L3), the resume reloads
only the rest (sgl-project#988). The gap: SA-DISPLACE triggered only on seats.

KV trigger (d_park_runtime.displace_for_age; SGLANG_WEG2_SEAT_AGE_KV_DISPLACE, default on; 0 = seat
trigger only; under SGLANG_WEG2_SEAT_ROTATE): a seat is free, the adder refused an OLDER waiting
request with NO_TOKEN in the last pass (Scheduler sets _weg2_sa_no_token to the first refused rid;
displace_for_age consumes it), and a younger one runs -> the youngest pauses (retain, pressure park:
it resumes when it is the oldest live). RANK-UNIFORM: the precondition (a waiting request older than
the youngest running one; queue, running set and rids are replicated) is the same on every rank, so
every rank enters the group MIN (_weg2_group_min_flags, the #1471e verdict helper) over "I refused an
older one"; the group displaces only when EVERY rank refused. At most one per pass, never an older.
Line "SEAT-AGE DISPLACE rid_out older_waiting trigger=kv|seat running cap pages_out".
_partial_keep: the ONE call site towards NF's sgl-project#248 -- keep_role(rid, "park", page_range=(a, b)) with
a = span end - ceil(shortfall / page_size), shortfall = the older's uncached need minus the free rows
(seat trigger: 0, a pure pause, no call); guarded import (sglang.srt.weg2.handoff_pending, name
pending): missing or raising -> today's retain, the displacement stands; pages_out = keep_role's int
return, else the requested window. NF releases the role at the request's free (their decision), so
no release call.

Tests: test_weg2_seat_partial_0927.py 11 (older refused for KV displaces the youngest with a free seat
through the group MIN, signal consumed; ranks disagree -> nothing; no refusal -> nothing but the
collective is entered; a younger refused never displaces an older and no collective; sub-switch off;
seat trigger unchanged with pages_out=0; window from the shortfall; keep_role called with the window
and its return logged; raising keep_role -> retain; seat trigger is a pure pause; scheduler wiring)
+ SA's 19.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 27, 2026
… + Anker) -- nie ein Mamba-Host-Wert ohne KV-Host-Wert

rc12x (dkrnfh91dprsabar1dauer09272253, 10f5bbf), D tot 63 s nach serving (22:59:01Z), auf allen drei Rängen gleich:
- on_idle -> _check_tree_cache_bounded -> sanity_check: "node 28 mamba host present but Full.host_value=None".
- Verlauf weg2-0-4 (D-Log): PARK-DEMOTE (12154/12277) -> WAKE-READ (13015) -> INSERT-PLACED deepest=28 (15424 Token, KV- und Anker-Host).
- Danach MAMBA-HOST-RESUME, sgl-project#988 LOADBACK kv_applied=1 mamba_restored=1, dann Z. 13138 "sgl-project#248 LOADED-HOST-RELEASE nodes=1 rows=15424".
- Die Worker folgen: R12 APPLIED kv_dropped=1 anchor_dropped=0 (13251/13252). Sanity-Fail 15649.

Wurzel: weg2.park_l3.release_loaded_host (sgl-project#248, 55fd84c) entfernte nur die KV-Host-Zeilen (BASE_COMPONENT_TYPE).
- Die Annahme im Docstring war "a mamba anchor may exist on the host alone". Das ist falsch.
- Die Baum-Invariante verlangt aux-Daten nur mit Full-Daten auf derselben Schicht (UnifiedRadixCache.sanity_check).
- Der Anker-Host-Wert blieb unter einem KV-freien Knoten stehen.
- Die Worker spiegeln diesen Zustand per R12 STATE (anchor_host=1), deshalb stirbt jeder Rang gleich.

Fix (park_l3.release_loaded_host):
- Je Knoten gehen die aux-Host-Zeilen (Mamba-Anker, Indexer) VOR der KV-Host-Zeile, beide zusammen. record_state trägt dann kv_host=0 und anchor_host=0 zu den Workern.
- Liegt ein aux-Zustand NUR auf dem Host (kein Device-Wert), behält der Knoten seine ganze Host-Seite. Ein Drop des KV würde die Invariante brechen, ein Drop des Ankers den einzigen Zustand verlieren.
- Nach dem Load-back setzt MambaComponent.commit_hicache_transfer(LOAD_BACK) den Device-Wert. Der Normalfall gibt also alles frei, der sgl-project#248-Zweck bleibt (keine Arena-Referenz über den Wake hinaus).
- Neue Zeile: LOADED-HOST-RELEASE ... kept_host_only_aux=N.
- Keine Änderung an handoff_pending/d_park_runtime/front.py.

Tests test_park_l3_loaded_host_r12_248.py (7):
- Neu test_rc12x_no_anchor_host_row_outlives_its_kv_host_row: kein Rang behält einen Anker-Host ohne KV-Host, die Regel wird wie im sanity_check geprüft.
- Neu test_an_anchor_on_the_host_only_keeps_its_node_whole.
- Der Metall-Test erwartete den Fehlzustand (0, 1) und erwartet jetzt (0, 0).
- 3 rot auf 10f5bbf, 7/7 grün mit Fix.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 28, 2026
…lform (array statt list) -- Admit(0) fuer alle, wenn PP0s Anker am told fehlt

rc12z2 (e8a2cd2, P-Log Z. 226312-226760, 03:26:31-41, rid weg2-44-76):
PP0 las 47168 Tokens (8x 'sgl-project#1433 L3->L2 fill' -- der Rueckweg, den Runde 4
erst oeffnete), klemmte told auf den Store-Anker 37952 (sgl-project#1416 ANCHOR-CLAMP)
und schickte ihn. Beim Zulassen:
  PP0 'sgl-project#904 ... reached=37952 refused=37952 why=MambaComponent:absent'
      -> '[sgl-project#928 anchor] REFUSING resume' -> Zulassung bei 0
  PP2 dasselbe -> 0
  PP1 'sgl-project#988 LOADBACK ... anchor_depth=37952 mamba_restored' -> 37952
PP1 bekam PP0s Zeilen 32768..49152 zu seinem Batch 70720..79688:
'sgl-project#1233 W27 PP WIDTH DIVERGENCE REFUSED ... cause=START-SPLIT', P tot.

Genau dafuer gibt es TF (weg2_told_fidelity, Default an): vor dem Admit
fragt PP0 den eigenen Baum, kann er am told nicht fortsetzen, geht told=0
mit PF-Fallback-Marke an ALLE Stufen (jede gibt ihren Read frei, alle
prefillen ab 0). Auf NF lief TF nie: '#TF told-fidelity probe skipped ...
AssertionError((<class 'array.array'>, <class 'list'>))' 10 von 10 auf
diesem Boot -- _probe_key baute den Schluessel als list, der Baum
vergleicht array('q')-Schluessel (RadixKey.match: assert type(t0) is
type(t1)). Keine Aussage -> Admit blieb 37952, waehrend PP0 selbst 0 nahm.

Fix (kein Schalter, bestehende Vereinbarung): _probe_key baut array('q').
Die #1416d-Klemme teilt den Schluessel; ein Array-Schluessel hasht dieselben
Seiten (compute_node_hash_values hasht die Array-Schluessel des Baums).

Test test_told_fidelity_array_key_rc12z2 (4; Fake-Baum vergleicht mit dem
ECHTEN RadixKey.match gegen einen Array-Knoten, told 37952, Bigram): 3 rot
auf e8a2cd2 (genau 'AssertionError((array.array, list))', Verdikt
(37952, None) statt (0, 0)), gruen mit Fix; Hash-Gleichheit list/array
gruen auf beiden. Die TF-Suite 0927 mass nur len(key) und erreichte den
Vergleicher nie.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 28, 2026
…ister -- offen ist F13 (die Bytes des KV-Workers in Host-Tier und Store)

Der Launch-Riegel refuse_unwired_token_cut verweigerte kv=qsa_forma_dcp bedingungslos mit einer Begruendung, die seit
S3c falsch ist ("die Form-A-Worker attendieren nichts") und die nie gefallen waere. Jetzt:

- rank_role.TOKEN_CUT_SEAMS = (F4, F5, F12, F13), unwired_token_cut_seams() nennt die davon noch wired=False.
  refuse_unwired_token_cut verweigert nur, solange eine davon offen ist, und nennt sie mit ihrem Was aus dem Register;
  sind alle gebaut, faellt der Riegel. Dry-Run und andere Formen wie bisher.
- Neue Naht F13 (wired=False, in UNWIRED_ORDER): Host-Tier und Store eines Workers, der Voll-Attention-Zeilen besitzt.
  Befund beim Bau von S3d: (a) cache_controller.attach_storage_backend verweigert den gewichteten Uneven-DCP-Owner-Modus
  bei page_size != 1 -- unter dem Schnitt ist _dcp_owner_ctx auf JEDEM Rang gesetzt, NF hat page 64, und jeder
  Weg2-Arm faehrt --hicache-canonical-kv-page mit File-Store: ein echter Boot staerbe beim Attach auf allen Raengen.
  (b) Ein Worker faehrt FormAWorkerNullStorage (claimt jede Seite, schreibt keine) -- mit echten Zeilen waere das nach
  einer L2-Verdraengung ein stiller Falsch-KV-Read. (c) Tail-Adopt/-Handoff und sgl-project#988/H105-Park-Loadback sind Host-only.
  Eine NF-Seite (64 Token) liegt unter einem Token-Vektor auf zwei Ownern; das kanonische Seitenformat kennt keinen
  Teil-Owner-Slot. Anker (selbstpruefend): cache_controller.py:1499, hicache_storage.py:3850.

Folge: ein echter Boot des Schnitts bleibt verweigert, jetzt mit dem richtigen Grund (F13), und der Riegel faellt,
sobald F13 gebaut und im Register auf wired=True steht.

Tests (test_weg2_form_a_dcp_s3d_239.py +3): Riegel nennt F13 und laesst den Dry-Run durch; faellt, wenn alle vier
Naehte gebaut sind, nennt 'F5, F13', wenn F5 offen waere; F13-Anker treffen. Auf eebe482: 3 rot; mit Fix 14/14.
test_weg2_kv_token_cut_s2_239 gruen (Verweigerung weiter mit 'sgl-project#239 S3'). Gate der geaenderten Dateien (14): 269 gruen,
auf der Basis nur die 3 neuen Roten.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 28, 2026
… Richtung statt je Layer-Aufruf -- Summen der vorigen Transfers in der naechsten Zeile, periodischer Zaehler mit suppressed_since_last_print

rc12z17 (b28315d, 10:50:22Z): H106 am Metall belegt (BYTELESS-GROW 353600 -> 389056, danach SKIP statt Tod,
0x OUT OF RANGE), aber die Skip-Zeile kam ungedrosselt -- n=1..11+ in derselben Sekunde: der Load-Pfad ruft den
Pool einmal je Layer mit denselben Ids (HostPoolGroup.load_to_device_per_layer), jede Layer-Runde eine Zeile.

Jetzt: QSAPagedHostPool merkt sich den offenen Transfer (Richtung load/backup, erste Id, Seiten). Ein weiterer
Aufruf mit demselben Schluessel wird eingefaltet (calls, pages_total); ein neuer Transfer druckt seine Zeile mit
'prev(dir= calls= pages_total=)' des vorigen; alle H106_PERIODIC (256) eingefalteten Aufrufe eine Zeile
'H106 FORM-A SIDECAR SKIP (periodic) … suppressed_since_last_print=256'. Die rid ist an dieser Stelle nicht
sichtbar -- start_loading fuegt die Loads per CacheOperation.merge_ops zusammen --, die 'sgl-project#988 LOADBACK rid=' Zeile
desselben Passes nennt sie. Richtung aus den drei Eingaengen (load_to_device_per_layer -> load,
backup_from_device_all_layer/_indices -> backup). Verhalten (Skip/Stopp) unveraendert.

Tests test_qsa_sidecar_byteless_grow_h106 (+2): auf b28315d rot -- eine Zeile je Layer-Aufruf statt einer je
Transfer, keine periodische Zeile --, mit Instrument 6/6 gruen.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 28, 2026
… Richtung statt je Layer-Aufruf -- Summen der vorigen Transfers in der naechsten Zeile, periodischer Zaehler mit suppressed_since_last_print

rc12z17 (b28315d, 10:50:22Z): H106 am Metall belegt (BYTELESS-GROW 353600 -> 389056, danach SKIP statt Tod,
0x OUT OF RANGE), aber die Skip-Zeile kam ungedrosselt -- n=1..11+ in derselben Sekunde: der Load-Pfad ruft den
Pool einmal je Layer mit denselben Ids (HostPoolGroup.load_to_device_per_layer), jede Layer-Runde eine Zeile.

Jetzt: QSAPagedHostPool merkt sich den offenen Transfer (Richtung load/backup, erste Id, Seiten). Ein weiterer
Aufruf mit demselben Schluessel wird eingefaltet (calls, pages_total); ein neuer Transfer druckt seine Zeile mit
'prev(dir= calls= pages_total=)' des vorigen; alle H106_PERIODIC (256) eingefalteten Aufrufe eine Zeile
'H106 FORM-A SIDECAR SKIP (periodic) … suppressed_since_last_print=256'. Die rid ist an dieser Stelle nicht
sichtbar -- start_loading fuegt die Loads per CacheOperation.merge_ops zusammen --, die 'sgl-project#988 LOADBACK rid=' Zeile
desselben Passes nennt sie. Richtung aus den drei Eingaengen (load_to_device_per_layer -> load,
backup_from_device_all_layer/_indices -> backup). Verhalten (Skip/Stopp) unveraendert.

Tests test_qsa_sidecar_byteless_grow_h106 (+2): auf b28315d rot -- eine Zeile je Layer-Aufruf statt einer je
Transfer, keine periodische Zeile --, mit Instrument 6/6 gruen.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 28, 2026
…oad-back -- kein Warten allein

rc12z30g (7bd3541, -st-vsync ohne Schnitt, Form A host,worker,worker,
1h07 unter qwen-Last), D-Log boot_weg2_dkrnfh91dprsavisnoadoptstvsyncbar1dauer
09282210 ~745380-745460, 23:23:28. Ein Pass nach weg2-180-303:
- weg2-180-304 host-gedeckt; H105-Verdikt ADMIT ging raus (TP0 'sgl-project#988
  LOADBACK rid=weg2-180-304 prefix moved to 71168 ... extent=71168');
- TP1/TP2 lasen das ADMIT (ein Follower liest das Verdikt VOR seinem
  Load-back) und liefen dann ihren eigenen: 'WEG2-LOADBACK-WAIT
  rid=weg2-180-304 extent=63296 applied=0: no device room for the host hit
  yet (rem_total_tokens=157504.0)' -> rangeigenes NO_TOKEN, Schleife zu Ende;
- TP0 ging weiter zu weg2-180-305 und sendete dessen Gate-NO_TOKEN
  (98650/89792); der Nach-Schleifen-Riegel der Worker las diesen Post als
  Extend-Set: 'H105 RU FORM-A EXTEND-SET MALFORMED got=('weg2-180-305',
  'NO_TOKEN', 98650, 89792, 0, '') local=[...]' -> D tot, TP0 an gloo.

Wurzel: (1) load_back entscheidet gegen den EINMAL je Iteration
veroeffentlichten Floor; der zweite Load-back eines Passes wurde gegen Zeilen
geprueft, die der erste schon genommen hatte (_form_a_note_loaded belastete
nur den Extend-Trigger). TP0 (5090, groesserer Pool) passte noch, die 3080er
nicht. (2) Die WAIT-Ausfahrt eines Workers ist rang-lokal NO_TOKEN, obwohl die
Gruppe schon ADMIT hat -- ungleiche Zahl von Gate-Aufrufen.

Fix (Klasse raenge-nie-uneins, H98-Follow):
- unified_radix_cache._form_a_load_back_floor: auf einer Form-A-Gruppe wird
  der Floor mit dem im Pass bereits Zugelassenen/Geladenen belastet
  (uniform_avail_for_evict, sgl-project#694-Ledger) -> der host-first Load-back des Hosts
  sieht den zweiten Load-back nicht mehr passen und sendet selbst NO_TOKEN
  (H105b/H106-Weg). Off Form A: der veroeffentlichte Floor, unveraendert.
- schedule_policy._h105c_follow: ein Rang, der das ADMIT schon genommen hat
  und 0 Zeilen unter adoptiertem Anker bekommt, wartet nicht allein: Anker
  zurueck, eigener Fehlbetrag wird evicted, Load-back einmal gegen den
  eigenen Live-Pool ('H105c FORM-A FOLLOW-ROOM', 'H105c FORM-A FOLLOW
  LOAD-BACK'); bleibt es 0 -> benannter Stopp 'H105c FORM-A FOLLOW LOAD-BACK
  UNSERVABLE' an der Stelle statt eines NO_TOKEN, das der Host nie sendete.
Kein Schalter. Host-first-WAIT (H105b) unveraendert.

Tests test_nf_form_a_follow_load_back_h105c (6, Metallform weg2-180-304/305,
Tiefe 71168, Worker-Extent 63296, rem 157504): 5 rot auf 7bd3541 (Worker
endet nach 304, riegel las 305), gruen mit Fix; 1 Waechter (Host-WAIT)
gruen auf beiden. Nachbarn 40 Dateien (H105/H105b/H106, xsn282, #616g/sgl-project#694/
sgl-project#1045-Floors, Load-back, Form-A-Admission): 1078 gruen, 275 Altlasten
identisch auf Basis und Fix, 0 neue Rote.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 30, 2026
…nn sein Span schon im Baum liegt (y5a weg2-19-28)

NF-Operator 30.09. (Mamba/GDN-Praefixzustaende gehen verloren, obwohl L3
Platz hat). Kette aus dem D-Log y5a (0110f8e132_0930_174039, TP0):
- 17:48:10 der Hold-Read von weg2-19-28 findet mit EIGENEN Schluesseln
  (sgl-project#1442 HANDOFF-KEYS NONE) den Sessions-Praefix im Store: "#1028B FETCH CAP
  kv=675 claimed=665 ... anchors_in_range mamba (9, 664)" = 42560 Token MIT
  Anker auf Seite 664. Schluessel-Identitaet ist NICHT die Luecke (18-24 las
  denselben Praefix mit eigenen Schluesseln: store_hit=42240; das "known=640"
  ist der Nachlese-Rest [42560, 43200) nach dem ersten Read).
- 17:48:12 das Geschwister weg2-18-24 wird zuerst zurueckgeladen ("sgl-project#988
  LOADBACK ... prefix moved to 43520 ... anchor_depth=43520"): sein KV liegt
  auf dem DEVICE, Zustand nur bei 43520.
- 19-28's Read endet (completed=42560): _insert_helper_host findet den
  ganzen Span schon im Baum, legt keinen Host-Knoten an (inserted_host_node
  None: der Knoten hat keine Host-KV-Kopie), und
  MambaComponent.commit_hicache_transfer(PREFETCH) GIBT DEN ANKER FREI.
- "[sgl-project#904 match-census] reached=43200 accepted=0 refusers=MambaComponent:
  absent=43200" -> "[sgl-project#928 anchor] REFUSING ... best_value_len=0 NONE-ON-
  THIS-PATH" -> W31 -> W50 x_refusal_midstream, 43396 Token zu P.

Fix: _insert_helper_host nennt den Knoten, an dem sein Schluessel ENDET
(InsertResult.matched_end_node; der Lauf hat ihn dort gespalten = Tiefe des
Ankers). Traegt dieser Knoten keinen Zustand (weder Device noch Host), nimmt
er den gelesenen Anker (host_value, Host-LRU) statt der Freigabe. Ein Knoten
MIT Zustand behaelt seinen, die Kopie wird wie bisher freigegeben. Der
naechste Match liest: best_match_node = der Knoten, state_anchor_depth =
seine Tiefe, mamba_host_hit_length = 1 -> init_load_back stellt den Zustand
in den Slot des Requests und nimmt den Device-KV darueber (der sgl-project#988-Weg).
Marker "WEG2 PREFETCH-ANCHOR-ATTACH". Schalter
SGLANG_WEG2_PREFETCH_ANCHOR_ATTACH (environ.py, default an).

Tests: test_weg2_prefetch_anchor_attach_0930.py 6 (echter UnifiedRadixCache
ueber echtem HybridReqToTokenPool; 5 rot auf 8406e68). Nachbarn
(anchor_drop_l3_257ii, arena_mamba_direct_1427, prefetch_* 7 Dateien,
short_read_anchor_sa, mamba_hicache_issuance_869b, mamba_gates_the_hit_706,
unified_radix_hicache_dispatch, unified_mamba_views, boundary_anchor_792,
mamba_anchor_seams_747): 152 gruen; 905 double_frees + 747 prepare_gates
rot auch auf der Basis (fremd).
efschu pushed a commit to efschu/htsglang that referenced this pull request Oct 1, 2026
…ss a kept told verdict, and acks only what it can resume (N1 dkr27browauthoritybar1fs10010740 PP1 sgl-project#968 death)

N1 boot (image 32fc268 = 341d089 + L1,5 shadow), PP1 07:46:29Z, rid
weg2-10-16: PP0 PF TOLD-ACKED told=17406 acks={1: 17406, 2: 17406}, PP0
sgl-project#988 LOADBACK mamba_restored; PP1 "sgl-project#1423 INSERT-PLACED matched=17406
deepest=122", "H91 STORE-TOLD KEPT told=17406 credit=0" (not seated in the
told visit), then "[sgl-project#928 anchor] REFUSING resume ... match_tokens=17406
best_value_len=0", "sgl-project#1175 UNDER-COVERAGE local=0 scheduled=17406", 19 s,
"sgl-project#968 PREFIX MATERIALISATION SHORTFALL" -> group stop.

(a) Root: weg2_store_told.admission popped the credit with
pop_prefetch_loaded_tokens, which also released the sgl-project#1417 span pin -- and the
recurrent anchor ANCHOR-PIN (341d089) keeps under it. A request the adder
does not seat in that visit (H91 KEPT) then waits with its anchor unlocked on
the mamba host LRU. Now the credit is popped and the pin stays
(_pop_credit_keep_pin); p_intake.settle_told releases it together with the
kept verdict when the request leaves the queue; an abort releases it as before.

(b) Riegel: the follower's PF ack (weg2_told_fallback.own_prefix) named its
KV depth. It now asks the told-fidelity probe (the sgl-project#928 rule read-only): KV
without a recurrent state at its end acks the resumable depth ("PF TOLD-ACK
UNRESUMABLE"), PP0 sees own != told and answers told=0 for EVERY rank -- a
rank-agreed re-prefill instead of a 19 s wait and a group death. No probe =
no verdict (the KV count stands).

Tests (CUDA_VISIBLE_DEVICES="", real check_prefetch_progress + real
FULL+MAMBA tree, array keys): new test_told_anchor_pin_ack_n1_1001.py red on
341d089 (2 failed: host_lock_ref 0 after the told admission; KV-only
follower acks 16 of 16), green here (3 passed incl. "anchored follower acks
told" = no false fallback). Changed area (pin 1417 x3, anchor pin, PF x2, told
1400/1416e/1416f/TF x2/TK x2/SL, shortread, dual x2, p_intake/h91): 261
passed; 1 failure (test_weg2_p_intake_h91a source-text assertion) fails
identically on 341d089.
efschu pushed a commit to efschu/htsglang that referenced this pull request Oct 14, 2026
…eady holds decides at its first re-read without growth

NF h16 a2cfc77 (boot ..._1014_151524), D TP0, weg2-8-68 (5 images, 176133 tokens, lane 1, routed
SHORT -> D on credit=175744 src=d_served_anchor with no device copy left): 15:27:55 the read landed at
64576 ('sgl-project#257 BELOW-ANCHOR read=65536 anchored=64576', '#1324c ... store_hit=175872 delivered=64576');
15:28:00/:06/:11 three identical re-reads (matched=64576 loaded=0, 5.2 s each, l3fill 730 pages), each
'sgl-project#1068 PREFETCH DEFERRED reason=store_prefix_short attempt=1' ("the store did not hold the requested
prefix yet"); 15:28:16 the rc12y bound (4 cycles) fell back -> W31/W50 -> PARK-IMMEDIATE -> flip.
The store HELD 175872: P loaded all of it at 15:28:22-24 ('sgl-project#988 LOADBACK ... anchor_depth=175872').

The store-short wait exists for a WRITER still filling the store. A read that ended short of the
store's own hit (deliverable, #248h, the group-synced END reading of the drain) and did not grow on
its re-read has no writer to wait for. SGLANG_WEG2_STORE_SHORT_HELD_DECIDE (default on): bound 1
instead of SGLANG_WEG2_STORE_SHORT_MAX_CYCLES for such a read; the fallback names
reason=store_held_no_growth / store_held=<hit>. A growing read is waited for as before, a dormant D
still does not count (xsn344), the settled-wake bound 0 is unchanged. Off: the cycle bound alone.

Tests (pytest_gedeckelt.sh, no GPU): test_weg2_store_held_decide_1014 (new, 6, metal numbers of
weg2-8-68 and rc12y); the three files that pin the cycle bound itself run with the switch off (one
autouse fixture each); all 19 files that reference the store-short path: 188 passed.
test_allreduce_admission_pin_1537::test_p5 is red at the base 38c6d40 already (resume_via_p.py
reads 'priority' since the lanes), not touched.
efschu pushed a commit to efschu/htsglang that referenced this pull request Oct 16, 2026
…iegelt) -- der Sleep-Flush findet Platz, wenn host-only Knoten die KV-Arena halten (h109 weg2-66-470)

NF h16q2, Boot 1016_051456, D 06:25:38 (D>P-Sleep): sgl-project#1470 FLUSH-PUBLISH ARENA-FULL-STOP unbacked=54
arena_refused=54 (TP0), unbacked_left=59 (TP1/TP2), sgl-project#1421 arena_claim depth=57472/66240/66304 auf den
Workern, W3-ARENA SPILL candidates=0 -- die KV-Arena war von host-only Knoten gehalten; die Geraeterunde
nimmt sie nie, die Host-Leaf-Runde (Port 27B Q-697c) nur auf dem local-PP-Floor. Der Reset verwarf
weg2-66-458's Schwanz (KV 56512..65024 + End-Anker), weg2-66-470 setzte bei 56512 auf: 8779 gerechnet,
1739 gepreist. TP1/TP2 sgl-project#988 extent=40640 ist der Host-Anteil hinter dem Geraetekopf 15872 (TP0 56512),
dieselbe Lesung auf allen Raengen.

Fix: host_only_spill.armed ist auf Form A fuer TP0 (role host) scharf; _w3_arena_spill sammelt die dabei
verworfenen Knoten per _r12_rec und schickt sie als R12-STATE (why=w3_host_leaf) an die Worker, wie
evict_host; Worker nehmen die Runde nie selbst. L3-Kopie jeder Seite zuerst (bestehende Regel). Schalter
SGLANG_WEG2_W3_HOST_LEAF_FORMA, Vorgabe AN.

Tests: test_weg2_k15b_forma_host_leaf_spill_1016.py 4 + dual15 4 gruen.
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.

2 participants