Skip to content

Enable chunked prefill by default - #1040

Merged
merrymercy merged 4 commits into
mainfrom
default-chunked-prefill
Aug 15, 2024
Merged

merrymercy merged 4 commits into
mainfrom
default-chunked-prefill

Conversation

@merrymercy

Copy link
Copy Markdown
Collaborator

No description provided.

@Ying1123
Ying1123 force-pushed the default-chunked-prefill branch from 4fd8e90 to a0653bf Compare August 12, 2024 04:27
@Ying1123
Ying1123 force-pushed the default-chunked-prefill branch from a0653bf to 8e3e590 Compare August 12, 2024 04:36
@merrymercy
merrymercy marked this pull request as ready for review August 13, 2024 09:33
@Ying1123
Ying1123 force-pushed the default-chunked-prefill branch from 8e3e590 to e0a53ad Compare August 13, 2024 09:43
@zhyncs

zhyncs commented Aug 13, 2024

Copy link
Copy Markdown
Contributor

@Ying1123
Ying1123 force-pushed the default-chunked-prefill branch from e0a53ad to 5d4301c Compare August 13, 2024 09:46
@merrymercy
merrymercy requested review from Ying1123 and zhyncs August 15, 2024 02:28
@merrymercy
merrymercy merged commit e86b1cc into main Aug 15, 2024
@merrymercy
merrymercy deleted the default-chunked-prefill branch August 15, 2024 04:56
@merrymercy merrymercy mentioned this pull request Aug 20, 2024
15 of 29 tasks
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 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
… it without admission

BOOT-8 ROOT, MEASURED. The extent was derived inside
`build_pp_admission_decision`, reached only from `_get_new_batch_prefill_raw`'s
tail -- after an admission loop with eight `continue` branches and an
`if len(can_run_list) == 0: return` above it. On the passes where a host hit was
live, the holder was skipped at scheduler.py's `prefetch_pending` branch before
the adder ever saw it, the list came back empty, the method returned, and NO
decision was built:

  09:13:52 PP0/PP1/PP2  sgl-project#788 PP-ADMISSION verdict=DECLINE n_reqs=0 queue=1
                        reason=loop_skips(prefetch_pending=1(first=f7f997c0...))
  09:13:54 PP0/PP1/PP2  sgl-project#968 LOAD-BACK DEFERRED rid=f7f997c0... (kv=4618)
                        ... holds no PP0 extent for it yet

The chain fed itself: hit present -> prefetch pending -> skipped -> empty list
-> no decision -> no extent -> deferral. `sgl-project#1040 EXTENT STATE-ALIGN` read 0 in
the whole log while its sibling emitter logged 9 times, which is what localised
this.

TWO HALVES, both mechanism-agnostic on purpose.

1. CHOICE MOVES TO THE WRITER. `stamp_state_aligned_extent` runs at the two
   sites that write `Req.host_hit_length` -- `Req.init_next_round_input` and
   `match_prefix_for_req` -- both unpacking one `match_prefix` result.
   `Req.__init__` only zeroes the field and `truncate_prefix_to` is dead (0
   callers, 0 name reads), so a request CANNOT hold a hit without passing one of
   them. Every `can_run_list` filler (`add_one_req`, `add_chunked_req`,
   `add_one_req_ignore_eos`, the dllm pair, `_add_scheduled_req`) must match
   before it is executable, so the match dominates all six. The dominator
   argument is made over the WRITERS deliberately: the call graph cannot carry
   it -- `call_path add_chunked_req -> match_prefix_for_req` walks past 156
   unresolved edges and finds nothing, which is a bounded negative and proves
   nothing. The row builder now READS the stamped field on both branches and
   derives nothing.

2. PUBLICATION DECOUPLES FROM ADMISSION. `_publish_pp_decision_1041` is the one
   publisher and BOTH exits of `_get_new_batch_prefill_raw` go through it,
   including the empty-list return that boot 8 died on. Everything the loop SAW
   and did not admit rides as an `admitted=False` FACT CARRIER. Collected at ONE
   site at the top of the loop, before any skip -- appending inside each skip
   branch would be the per-path retrofit this slice exists to avoid, and would
   have missed the second, still-unproven decline mechanism exactly as the first
   was missed.

CARRIER SAFETY IS STRUCTURAL, NOT CAREFUL. `forwarded_schedule` already filters
`e.admitted and not e.retracted`, so a carrier can never enter
`_pp_scheduled_extents` and therefore never reaches the sgl-project#791 membership compare
(scheduler.py:10508/:10522) -- the PPScheduleRefused-storm direction is closed at
the source. `reconcile_pp_admission_decision` passes it through verbatim;
`forwarded_last_chunk`/`forwarded_fill_carry` key on `fill_len`, which it does
not carry; `apply_pp_load_back_row` stamps it by rid, which is its whole purpose,
and an unheld rid is already a counted no-op there.

STANDING INSTRUMENT. `sgl-project#1041 EXTENT POPULATION seen/published/delta` per pass.
`delta != 0` means a request held an extent and no entry carried it, i.e. a
bypass. The three legitimate differences are structural and produce no delta: no
host hit stamps no extent, `pp_size<=1` never reaches the publisher, and an
unheld rid is the receiver's counter. A future bypass is now loud instead of a
silent zero that costs a boot to read.

CHECK (speed mode: one matched check). devtools/check_1041_factcarrier.py,
hermetic, CUDA-free. Named failure class: non-admitted entries reaching readers
that iterate the decision, dangerous direction a PPScheduleRefused storm. The
three pinned directions: (1) carrier passes without refusal and is absent from
forwarded_schedule / last_chunk / effective while still delivering its extent
through reconcile and apply; (2) a real membership violation STILL refuses -- an
admitted rid the rank does not hold is still nameable as MISSING, pinned so the
gate cannot go quiet; (3) unknown rid raises nothing and stamps nothing. 20/20
PASS. sgl-project#1040 check re-run green (no regression), py_compile + import smoke, ruff
clean on the edited congruence module.

cell_1039: adds `sgl-project#1041 EXTENT POPULATION` delta==0 and PPScheduleRefused==0 as
acceptance criteria, both voiding the PASS branch.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 31, 2026
…ess match stops erasing

BOOT 10 MEASURED THE ERASER. `sgl-project#1041 EXTENT POPULATION seen=0 published=0
delta=0 admitted=1` stood beside `sgl-project#1040 ... rid=... extent=4618` for the same
rids: the field was stamped with a real extent and reached the publisher empty.
Cause was inside the fix itself -- `stamp_state_aligned_extent` nulled the field
on every match WITHOUT a host hit, so writer and reader were separated by an
ordinary intervening match. That is the deleter-between-writer-and-reader shape
the pre-boot lifecycle table exists to catch, reproduced inside the mechanism
meant to close it.

THE TABLE IS NOW THE CONTRACT, not a comment beside it. Four transitions, the
only writes to `pp_load_back_extent`, each counted:

    set            a match WITH a host hit chooses an extent
    hitless_noop   a match WITHOUT a hit -- NO-OP, never a clear, always counted
    spend          the row carried it (`_spend_for_entry`, at the row build)
    retract        `reset_for_retract` voids it

`_spend_for_entry` is one expression used by all three entry paths, so no branch
can publish without spending and none can spend without publishing -- the
two-populations defect this slice removes, kept out of its own fix. Spend at the
row build rather than at apply: the field does not travel the rank hop, and
never clearing would let one hit republish forever (the stale-HIGH republish
e0bc960 already paid for).

`hitless_noop` IS ALSO THE DISCRIMINATOR for boot 10's unstamped rid (364e5b59:
DEFERRED x3 with kv=4618, zero stamps). Two hypotheses were checked and BOTH
REFUTED at the tree before adding it: the stamp is present on BOTH
`host_hit_length` writers (schedule_policy.py:366, schedule_batch.py:1717), and
the log rate limit suppressed nothing (cumulative `n=5` per rank IS the total,
matching 5 emitted lines per rank). So either the stamp ran with a zero hit --
it will appear in `hitless_noop` -- or a third path sets `host_hit_length`
without passing either writer, and it will appear nowhere. The counter decides
in boot 11 instead of another round of inference.

CHECK: devtools/check_1042_lifecycle.py, hermetic. Named failure class: a write
path emptying the field outside the two sanctioned deleters. Replays the exact
boot-10 sequence (stamp 4618 -> hitless match) and pins that the value SURVIVES
and the no-op is counted; pins spend clearing exactly once and a second build
republishing nothing; pins retract clearing and double-retract not double
counting; pins that all four transitions are counted rather than silent. 15/15
PASS. sgl-project#1040 and sgl-project#1041 checks re-run green. ruff clean on the edited module.

cell_1039: reports the sgl-project#1042 cumulative counters and treats `hitless_noop == 0`
as "contract untested by this window", never as "contract holds".
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 31, 2026
…enumeration

THE DENOMINATOR HAS NOW BEEN WRONG TWICE IN THE SAME CLASS, so this closes the
class instead of writing a third hand-list. `_seen_this_pass` alone missed
`add_chunked_req` (which fills `can_run_list` BEFORE the loop). The union with
`admitted_list` still missed every request that HOLDS an extent without being
touched by this pass -- boot 11 measured it exactly: the deferring rids carried
`extent=4618` and `extent=1295` with `hitless=0`, while the publisher counted
`seen=0 published=0 admitted=1`.

STRUCTURAL STATEMENT, and it is the user's amendment finally landing whole: the
extent is a property of the REQUEST, so every pass-scoped population is wrong by
construction.

`holders_with_unspent_extent` is DERIVED, not enumerated afresh: it builds on
`phase_flip_runtime._live_reqs`, the residency authority the CUTOVER itself
uses, which covers `running_mbs`, `last_mbs`, `running_batch`, `last_batch` and
`chunked_req`. One deviation, declared rather than silent: `waiting_queue` is
added, because the cutover authority answers "what holds POOL ROWS I must move"
while this answers "what holds a FACT I must publish" -- and a queued request
holds the second but not the first. That queued request IS the boot-8
population.

THE #858b LAST_MBS WARNING WAS CHECKED, NOT BELIEVED, AND IS STALE. W30 added
that route to the authority (phase_flip_runtime.py:1346-1347) after
`ResidentCarryError` measured the gap on all three ranks, under the explicit
rule "fix it at the one authority, not at the consumers". Deriving inherits that
fix rather than re-opening the hole.

sgl-project#1041's `seen` is widened through the SAME function that builds the carriers, so
the instrument and the publication can no longer measure different populations
-- which is the precise defect the instrument exists to catch.

CHECK: devtools/check_1043_holders.py -- a PLANT TEST, not a list assertion. One
request carrying an unspent extent is planted at EVERY holding site
(running_mbs, last_mbs, running_batch, last_batch, chunked_req, waiting_queue)
and each must reach the population; negative controls pin that a held request
with no extent or a zero extent is not a carrier; identity dedup pins that one
Req on six routes is carried once; a bare scheduler yields empty rather than
raising. Direction E plants a request in an UNWIRED route and asserts it is
MISSED -- documenting the authority's real limit as a contract (a new route must
be added to the authority and planted here) instead of pretending coverage is
automatic. That direction is what makes this a class closure: it rings on the
day someone builds a seventh holding site. 13/13 PASS; sgl-project#1040/sgl-project#1041/sgl-project#1042 re-run
green; ruff clean.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 4, 2026
The flip aliased both stacks' request-index space at boot and never
rebound the scheduler at the cutover: `tp_req_pool.req_to_token` was
pointed at the PP pool's tensor (and the mamba index map with it), so
every row id the TP phase used had been minted by the PP allocator, and
a row freed in one phase was still named by the other. This is CUT 1 of
the WEG1 family spec -- the request axis (R), which is independent of
the KV-token axis (K) and buys correctness, not tokens.

Five edit sites, one cut:

C1.1  phase_flip_boot.py -- the two alias ASSIGNMENTS are deleted. The
      three shape/space checks around them STAY and the `5a.` premise
      comment is rewritten to the reason they are load-bearing AFTER
      the deletion: three consumers cache `req_to_token`'s SHAPE once,
      at construction (hisparse_coordinator.py:109, overlap_utils.py:296
      and :299), and now see the other phase's pool after a rebind.

C1.2  phase_flip_runtime.py -- `rebind_req_pool_for_cutover` runs in
      `_cutover`, immediately BEFORE the sgl-project#719 HiCache rebind and OUTSIDE
      its try/except, on EVERY cutover. Deliberately NOT gated on
      --phase-flip-rebind-hicache: sgl-project#719's "a refused rebind is SAFE"
      holds because a stale HiCache binding has a disarmed state (sgl-project#718);
      a request pool has none, so a refusal here RAISES.

C1.3  memory_pool.py -- `ReqToTokenPool` gains `binding_tag` (minted at
      construction, re-minted by `clear()`); `Req` gains
      `req_pool_binding`, stamped beside `req_pool_idx` in `alloc`; the
      existing `reusing` branch refuses a row minted under another
      binding. Both pools hold the same row count, so a carried id lands
      IN RANGE on someone else's row -- silent, not a device assert.
      `SessionSlot` carries the binding with the parked row.

C1.4  phase_req_pool_binding.py -- the sgl-project#919 census on the REQUEST axis:
      the outgoing pool is counted before the rebind, the line is
      emitted on every cutover whatever it found (indicator law), and a
      non-zero escapee count raises with the rids and rows named.

C1.5  kv_session_offload.py -- the only tree-wide cacher of the pool
      OBJECT now reads `self.scheduler.req_to_token_pool` through a
      property, so its ~20 `req_to_token[...]` writes cannot land on the
      outgoing phase's tensor.

Evidence
  red-first on the parent 8fe7b60:
    17 failed / 4 passed. The 4 green are exactly the must-not-change
    and already-true ones (the three shape checks survive; reuse within
    one binding stays allowed; the two default-path pins).
  green after: 21 passed.
  mutants, each verified to have actually applied before running:
    M1 DANGER gate the rebind on --phase-flip-rebind-hicache -> 2 failed
    M2 drop the binding_tag clause from the guard              -> 2 failed
    M3 census counts only rows a request still names           -> 1 failed
    M4 restore the req_to_token alias in phase_flip_boot       -> 1 failed
    M5 skip clear() of the incoming pool                       -> 1 failed
    M6 re-cache the pool object in kv_session_offload          -> 1 failed
    (a first M6 attempt cached under a DIFFERENT attribute name and
    survived -- an equivalent mutant, dead code nothing reads, not a
    test gap; the faithful form is the one counted.)
  ruff: per-file counts identical to HEAD on all seven modified files
  (1/0/8/43/0/0/0); the new module and the new test file are clean.

C1.5 follow-on: four test modules set the pool ON THE MANAGER
(`mgr.req_to_token_pool = ...`), which the read-at-use property makes
read-only. They now set it where it lives -- on the scheduler stand-in.
Found by the desk gate (test_host_finish_stream_659, +3 failures vs the
HEAD baseline); the other three sites are OUTSIDE the gated directory and
were found by a tree-wide sweep of the same assignment shape. Two files
matching the same grep are deliberately NOT changed:
test_kv_spill_destination_unit builds a bare SimpleNamespace (no class, no
property, the attribute is the pool), and test_specv2_kvcache_offloading
sets it on DecodeKVCacheOffloadManager -- a different class.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 15, 2026
…o an anchor the key match reaches

Boot xsn128 (e0e3f11, write_back on both groups): the round trip held
(P leg 1 -> publish sweep 'unbacked=3 issued=3' at the flush -> D leg 2
cached 4314/4316; pin-skips 0, anchor drops 0, deferrals 0, flips 1.85-1.89 s
sleep / 2.06-2.28 s wake). Then the in-flip request rid ca49dc53 (Q1 prefix
+ 7k) killed PP0: 'sgl-project#968 LOAD-BACK GDN ANCHOR OFF-EXTENT: PP0 published an
extent of 4031, this rank's load-back yielded 4095, and the mamba restore
already adopted the anchor state at 4095' -> sgl-project#791 STOP, the group died,
every later request failed.

`state_aligned_load_back_len` took `host_hit_length` (4031: only the node
the read had just landed; the leading 64-token node had come in hitless on
the earlier Q2 request) while the key match reached 4095 with the anchor AT
4095 -- and the load-back applies the key match up to the anchor. Under
write_through (xsn122) the same read stamped kv=4095; under write_back the
host accounting of that leading node differs. The extent is now raised to
the anchor when the key match reaches it and the anchor lies above the host
hit (`raised_to_anchor` counter on the sgl-project#1040 census); rounding DOWN for an
anchor below the hit is unchanged, as is the pure-KV path.
Tests: test_1245 (+1: raised / not raised / rounded down) 7 passed; 1157
seam witness 21 passed, 1 failed identically before and after (socket).
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 26, 2026
…gl-project#49 armed lines

Every prefix miss of an agent-load boot gets a token receipt. With
SGLANG_WEG2_PREFIX_TRACE=1 (min rest SGLANG_WEG2_PREFIX_TRACE_MIN_TOKENS,
default 1024), read once per process (weg2/prefix_trace.py, armed line
"#PT PREFIX-TRACE armed=<0|1> min_tokens=M group=G pid=P"):

- sgl-project#1420 WALK-STOP: one line per (rid, stop depth) with rest >= min, no
  process cap, root stops included; appends
  "rid=<full> trace=1 stop_node=N stop_hash=H want_run=[..] have_run=[[..]]".
  A split stop now names the TRUE rest and want (the un-advanced key made
  depth+remaining exceed pt-1 by the split's matched part; also untraced).
- sgl-project#1400/sgl-project#1416/#1416d/#1416e (and TK's sgl-project#1442 ADOPT / TK ABS-TOLD): full rid,
  8/256 sampling lifted.
- sgl-project#1442 HANDOFF-KEYS REG, sgl-project#1040 EXTENT STATE-ALIGN: one line per distinct
  (rid, matched, span) / (rid, extent).
- sgl-project#1469 EVICT: uncapped (outside the 600), + parent, pages, hash_first,
  hash_last, key_len, trace=1.
- sgl-project#1427 ARENA-DROP: uncapped, + "trace=1 claim=<stem> dropped=<lo64 hex,..>".
- sgl-project#1439 ARENA-PRESENT: once per distinct (keys, leading, first stem) with
  rest >= min, + "trace=1 break_stem_full=<stem>" (joinable to dropped=).
No traced line sits on the decode round path.

Armed lines (once per process): "#MZ INLINE-SYSTEM-IN-PLACE armed= merge=
group= pid=" (anthropic adapter, P and D HTTP process) and "WEG2-FRONT sgl-project#49
SPAN-INFLIGHT armed= role=front pid=" (front start).

Tests (desk, CUDA_VISIBLE_DEVICES="", test27b.sh):
Base: desk/27b-unified-0926 @ 2bddf04 (rebased from f4b6f21, clean).
- new test/registered/unit/mem_cache/test_weg2_prefix_trace_in.py: 16 passed
- rebased run, all files below plus test_weg2_store_told_{hold,positive}_tk:
  324 passed
- managers/test_weg2_store_told_{1400,paced_1416e}, test_weg2_p_twin_defer,
  test_prefetch_deferral_1068, test_weg2_p_burst_clock_h42c,
  test_weg2_p_multi_anchor_tails_h42, anthropic/test_inline_system_in_place,
  mem_cache/test_arena_{queue_refs_27b,inner_anchor_release_0924},
  test_backup_ack_drain_tp_asymmetry_h74, test_hicache_drain_budget_27b,
  weg2/test_weg2_{p_intake_h91a,front_span_inflight_fs,arena_reset_release_h81,
  node_value_trail_1469}, test_producer_phase_census_wiring_1061: 232 passed
- test_hicache_arena_claim_1427, test_weg2_handoff_1442,
  test_weg2_store_short_tail_xsn437, test_evict_frees_the_bound_allocator_941,
  test_weg2_p_trim_end_anchor_0924: 50 passed
- test_unified_radix_cache_unittest.py, per class, against the base:
  identical FAILED sets (pre-existing on the CPU desk; ps128_sw4/sw128
  OOM in the 3 GiB cgroup on both trees)

Unify note (RM, pick onto 2a7f992): conflicts line by line (store_told: PF fallback forget kept + IN _rt(rid); front: IN line helper + the P49 request_text signature). The sgl-project#49 SPAN-INFLIGHT armed line also names agent_span (the inflight credit needs the sgl-project#49 span, profile field agent_span); its test pin follows.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 28, 2026
…-- die gruppeneinheitlich realisierbare Resume-Tiefe nach dem Finish (Front kappt credit auf min(ct, Tiefe))

Die Front schreibt einem D-Leg seine cached_tokens gut, also den KV, den D bei
der ANKUNFT fand. Was D fuer den naechsten Turn behaelt, ist eine andere Zahl:
Der Finish fuegt den ganzen Schluessel ein, aber ein hybrides GDN/Mamba-D setzt
nur an einem rekurrenten Anker fort (sgl-project#928), und der Finish ankert auf dem
Track-Raster (sgl-project#747). Ein Finish neben dem Raster haelt KV oberhalb seines
letzten Ankers, von dem keine Zulassung fortsetzen kann (RETAIN off-grid).
rc12z weg2-12-61: credit 55424, D-Extent 37952 -> 19840 > X, X-Verweigerung
mitten im Stream, 72 s P-Umweg; rc12y weg2-16-42 ebenso (27B f4a982e).

Neu: managers/weg2_resumable_depth.py.
- Der Output-Streamer stempelt auf der FINISH-Ausgabe (release_kv_cache lief
  schon) time_stats.weg2_resumable_depth. Wert = die seiteneffektfreie
  Admission-Probe der RU/H98-Stimmen (tp_match_floor.admission_probe:
  host_admission_len mit sgl-project#1040-Extent, sgl-project#928-Ankertest, #1424d-Beweisschnitt)
  auf der ganzen Sequenz, ohne das len-1-Limit dieses Turns.
- Gruppeneinheitlich: Form A -> der Host entscheidet (H98, Worker folgen und
  rechnen nichts); ein Rang -> trivial; klassisches TP -> MIN ueber die
  TP-CPU-Gruppe (nur fuer eine nicht leere Finish-Liste, auf allen Raengen
  gleich); DP-Attention ohne Form A oder PP -> kein Feld.
- 0 ist gemessen und wird gesendet; -1 = kein Feld. Abgebrochene Requests
  enden ueber denselben Pfad und tragen es mit.
- Traeger: time_stats.__getstate__ (auch ohne --enable-metrics) ->
  meta_info (/generate) -> sglext (OpenAI Body + Stream-sglext-Chunk) ->
  /v1/messages Top-Level-sglext (Message und message_delta). Damit greift der
  27B-Front-Leser (meta_info/sglext, Body und Stream-Tail) unveraendert.
- Metall-Marker: 'sgl-project#59 RESUMABLE rid=.. depth=.. seq=.. cached_tokens=.. mode=..'.
Kein Schalter: fehlt das Feld, bleibt der alte Preis.

Tests test_weg2_resumable_depth_59.py (17): alle rot auf 78b9ff7, gruen
mit Fix. Nachbarn 70 Dateien Basis gegen Fix: 0 neue Rote.
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