Repository navigation
Add libibverbs-dev to Dockerfile - #1427
Merged
Merged
Conversation
zhyncs
approved these changes
Sep 15, 2024
zhyncs
enabled auto-merge (squash)
September 15, 2024 06:40
zhyncs
disabled auto-merge
September 15, 2024 06:40
timethink
pushed a commit
to timethink/sglang
that referenced
this pull request
Mar 9, 2025
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 16, 2026
…ed out at PLAN time, in-graph claim is a pure gather Boot kvt4d (16.09. 14:58Z, D-layout TP3 uneven DCP + MTP + graphs, --kv-tail-min-tokens 16384) passed parse and ring construction (ring 35328/27648 rows, verify plan ran) and died in the CUDA-graph capture of the verify forward at KvTailRing.claim: 'loc[mask]' is a data-dependent boolean index -> 'operation not permitted when stream is capturing'. The write site (_dcp_write_scatter) runs INSIDE the captured decode/verify graph. Fix: KvTailRing.precommit(loc, mask) does the allocation (loc[mask], int(fresh.sum()), allocator.alloc) at plan time, out of graph, for the step's out_cache_loc evaluated with the SAME owner-rule expression the write site uses (dcp_weighted_write_slots); claim() under a precommitted step or an active capture is a fixed-shape gather mapping[loc] masked by (row >= 0) & owner mask, so the captured kernels read the CURRENT mapping at every replay. The capture pass itself precommits nothing (precommit_skip: dummy slots must not leak rows). The backend stashes the forward_batch in init_forward_metadata[_out_graph] and calls _kv_tail_precommit_step right after begin_step in both plan sites (decode, verify). Legacy claim (allocate on first write) stays for un-precommitted eager callers. Tests: test/registered/unit/mem_cache/test_kv_tail_1243.py 125 passed, 19 subtests (hermetic, CUDA_VISIBLE_DEVICES=""); new Test1427CaptureSafeClaim: precommit+claim == legacy claim with zero allocator calls inside claim, unmapped slot masked out not row 0, precommit_skip hands out no row, begin_step/disarm drop the precommit.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 16, 2026
…traight from the card into the arena slot. Stufe 3 mapped only the read side; writes still went card -> 1 GB staging ring -> store thread -> arena -> rebind, and the park test died on that transit (xsn184-187). Now write_backup claims one arena slot per page hash (arena_claim: fresh / join an earlier shard's claim / already complete), the backup thread DMAs this rank's K and V extents into the slot with the all-layer kernel (arena data region as the host buffer, page stride), and the ack merges the extents into the page's coverage (arena_complete) -- COMPLETE when every layer shard is in -- takes the node's reader reference and marks it store-present. No staging row, no ring, no store write, no rebind for KV; the draft pool does the same behind each KV row. Refs on CLAIMED slots are allowed (a writer's node holds one from the claim on); free bumps the generation so a late completion is refused. Mamba states still go through the 13-slot host anchor pool -- next step. Tests: 1427 (4+3), 1424 (8, one obsolete raise dropped), 1410, 1426, 1417, 1175 green.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 16, 2026
… reader reference since sgl-project#1427 (the writer's node holds one from the claim on); the Stufe-3 expectation was committed red in 92bc003 by mistake -- green now.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 16, 2026
…l-project#1435 census walk), needles 6/6, but D still took ~9.5 s per 100k prompt, serial. py-spy on TP0 around the flip: 17 % presence probe (batch_exists_v2 stat()ing 100k stems on disk), 12 % draft page flags (a Python genexpr per page), 7 % blake2 of the same stems for find/ref/draft, 4 % lazy pinning -- the KV/draft pre-pin of sgl-project#1436 never ran (its anchor missed the sgl-project#1427 lines; only the mamba arena was pre-pinned). Now: KV/draft arenas pre-pinned at bind; presence answered from the arena (COMPLETE slot = present, one C call per width) before any disk stat; key128 cached; draft row checks and resolve_rows as tensor ops. Tests: arena 1427/1424/1433/0828, told 1400, 861, 931, 706 green.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 18, 2026
… D's presence probe (sgl-project#1439 ARENA-PRESENT) -- the dormant hold's hit query answers 0 (READ-TRACE arena_hits=0, no-file) while the wake finds 520k pages via find_slots_np xsn327: weg2-6-2 finished on P 14:00:04-07 (its shared 4095-page prefix node complete since 13:59:31 by PP2's ack), D's sgl-project#1456 re-reads 14:00:06-12 answered zero (READ-TRACE asked=512 readable=0 arena_hits=0), no ARENA-GET MISS at all -- the hit query never reaches the page get. Both sides now print the full stem so the key derivation can be compared. Tests: xsn309/305/307 green (7 passed).
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 23, 2026
…rena-Kapazität (fnFL2x62) Boot fnFL2x62 (b7aebdc, erste volle Kette der seitenfähigen Arena-Form): Kontrolle CODE MATCH, MID 3871 Token MATCH, MID-2 (3776 Radix-Treffer auf D) MATCH; Nadelrunde 1 (4,4k, Flip) starb nach 277 s: D TP0 Gloo-Abort "op.preamble.length <= op.nbytes. 8 vs 4" im Claim-Vote des Prefetch-Threads, TP1/TP2 "Connection closed by peer". Host-RAM dabei stabil (nonreclaim 78,5 GiB, 27 GiB frei, kein OOM-Kill). Zwei Wurzeln, beide aus der Arena-Form: 1. SIDECARS OHNE ARENA WURDEN NIE GESCHRIEBEN. Der Direct-Write vollendet die KV-Seite im Arena-Slot und Mamba/Draft in IHREN Arenas; der Write-Through- Ack überspringt danach write_backup_storage (sgl-project#1427) -- und damit die Plain-V4-Sidecars: P STORE-WRITE-ISSUED 0 (x58: 12), '#106T qsa page write' 0 (x58: 24), D: anchors_in_range qsa_indexer=(0,-1), '#1035c ZERO-ANSWER PARTITION cause=CAPPED ... by=qsa_indexer', HOLD-REFETCH-Schleife. Fix: unified_radix_cache._weg2_write_plain_sidecars nach jedem Direct-Ack: dieselben Transfers wie write_backup_storage, gefiltert auf registrierte Pools ohne arena_read (_plain_sidecar_transfers), als Store-Write mit sidecar_only=True (HybridCacheController: nur batch_set_v2, kein KV-Pass, Ack über alle Token); Zeile '#106S SIDECAR-WRITE-ISSUED'. 2. NULL-KV-PEERS SYNCHRONISIERTEN AUF DEN STAGING-RING. Die Form-A-Worker (0 B/Token) nehmen das Gruppen-MIN der festen Poolgröße; unter der Arena- Form ist TP0s size der 4096-Zeilen-Ring ("Sync ... from 1099511627776 to 4069"). Die 70-Seiten-Nachlese (4480 Token) verweigerten sie als host_pool_exhausted, TP0 gab sie aus (verdict=issued) -> rang-lokaler Ausstieg vor dem Vote = Gloo 8 vs 4 (x25-Klasse, Memory: "unter Form A ein OFFENER Riegel"). In x59 stimmten sie nur zufällig (TP0-Pool 325568). Fix: zweiter MIN-Reduce in HostKVCache.__init__ (_sync_no_kv_peers): KV- Ränge bieten _carrier_capacity_bid und behalten ihre Größe, 0-B-Ränge nehmen das Ergebnis; ArenaMHAHostPool bietet Ring + planned_arena_slots*P (D TP0: 4096 + 2730*64 = 178816). Gleiche Kollektivzahl auf allen Rängen (jeder baut den Pool im Lockstep), ohne Prozessgruppe unverändert. Nebenbefund, nicht neu: 'WEG2-ARENA-WRITE run mode failed (CUDA error: out of memory); cell mode from now on' auf D TP0 beim ersten Direct-Write (der Run-Modus allokiert im knappen 5090-VRAM), Rückfall auf _backup_paged_copy lief. Tests test_arena_sidecar_and_peer_capacity_x62 (8): Filter (registriert und ohne Arena; ohne Registry leer), sidecar_only schreibt nur die Sidecars und ackt alle Token, reguläre Operation nimmt den KV-Pass, Plain-Pool bietet seine Größe, Null-KV-Rang nimmt das Sync-Ergebnis, Arena-Pool bietet den Id-Raum und behält den Ring, Arena ohne Bytes bietet den Sentinel. Arena-/Sidecar-/Draft-Suiten: 126 passed, 3 bekannte HEAD-Rote (1424).
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 27, 2026
…e named one arena slot twice, the sorted write refused it (P-PP0 "not consecutive") rc12p (fced72c) P-PP0 15:15:51 node 999 and 15:21:05 node 1109 (P-Log Z. 150760 / 164056): 'WEG2 PUBLISH-SWEEP write_backup raised on node N: RuntimeError: sgl-project#1424 paged arena load: a page's token rows are not consecutive from its first id' -- the WRITE side, caught by the sweep, P ran on. Root: ArenaMHAHostPool._claim_np (and the dict-path _claim) answers per page fresh / join / COMPLETE / no free slot. The COMPLETE pages took their reader reference only at the END -- after the claim had made room for its 'no free slot' pages (_evict_for_claim: the oldest UNREFERENCED complete slots, no disk I/O). A page this very claim had just found COMPLETE is exactly such a slot: freed by the room-making, handed by the redo to another page of the same node. One node, one slot twice. The controller sorts the host ids of the write (move_indices, layer_first/direct), the two copies of the page interleave, and the page check in backup_from_device_all_layer refuses ('not consecutive'). The refusal was the lucky outcome: unsorted, the second page overwrites the first, and the first page's key no longer names that slot at all (the eviction unlinked its index cell). Both incidents sit next to claim-time room-making under a full arena (sgl-project#1427 ARENA-DROP 15:14:42 n=256; 15:21:05 n=512 freed=0; ARENA-CLAIM REFUSED from 15:18:19). Reproduced on the real C arena: slots [0, 0] for one two-page node. Not the D double-page/shift class (#1424c/d): no key is wrong here, the slot is handed out twice by the writer's own claim. Consequence of the caught exception (asked): write_backup raised out of cache_controller.write before the commit -- the node stays unbacked (the sweep retries it; node 1109 then kept being refused parent_unbacked / arena_claim), and every page the claim had taken stayed PENDING for good: no ack comes, nothing aborted it, and the KV arena has no orphan reap (sgl-project#231 reaps only the mamba arena). So yes, a sgl-project#231-like hole: the node is missing from the store for D (shortfall -> re-prefill or via P), and its claimed slots are lost capacity until the arena is rebuilt. Fix: - _claim_np / _claim: the found-COMPLETE pages take their reader reference BEFORE any room is made (the evictor skips referenced slots); pages the redo finds COMPLETE take theirs after it; a refused claim gives all of them back (plus: the numpy path's refusal now also unclaims its JOINs, as the dict path did since sgl-project#231). - belt: a slot named twice by one claim is refused by name, never written ('#1424f ARENA-CLAIM DUPLICATE'). - UnifiedRadixCache._weg2_write_or_abort: a controller write that raises after the direct claim gives the claim back (abort_write: fresh slots freed, joins unclaimed, found references released) and re-raises -- nothing stays pending. Tests test_arena_claim_evict_race_1424f (5, the real C arena on a temp file, the real alloc_write/_claim_np/_evict_for_claim): the metal shape (full arena, the found page the only evictable slot -> base: slots [0, 0]; fix: refused by name, page-a keeps its slot and key, references back to base); room from another unreferenced slot -> two distinct slots, the found page carries the node's reference, the sorted write is whole pages; the duplicate mask; the premise (one slot twice + the controller's sort = the metal message); a raising write gives its claim back. Base 1155482 + #1424d/e: 4 red (premise green), fix 5/5.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 27, 2026
…rid waits for a D seat is re-routed fresh through P when D would have to prefill more than X of it; the front drops the rid's hand-off marks at every rid end NF rc12r (dkrnfh91dprbar1dauer09271632, 2494e7e): weg2-12-39 was prefilled whole on P (76602), published, then waited 255 s for a D seat (6/6); a flip's P reset gave the arena refs back (sgl-project#1427 RESET-RELEASE), H81 released the Mamba end anchors at=wake, the pages were overwritten, and at the D admission #1028B FETCH CAP lost=1196 / sgl-project#928 no recurrent state / X-GATE uncached=76602 refused it mid-stream. The hand-off's life was tied to phases, not to its consumption. NF's side (sglang.srt.weg2.handoff_pending: a pending mark from P's publish to D's consumption, pending pages evicted last, a loss NAMED as HANDOFF-LOST + <arena>/handoff/lost/<rid>.json; status(rid) / drop(rid, reason), never raising) is NF's commit. This is the front half, agreed 27B <-> NF 27.09. (weg2/handoff_seam.py): - Guarded read: without NF's module or when it raises / answers a wrong shape, state=none (the front is unchanged). The import is tried once per process. - A rid whose leg 1 ran and that waits for a D seat (not skip_leg1 / d_direct / resume_via_p / p_only) is checked every controller pass (_hl_sweep, before _rvp_take), in d_admitter before the seat and again with the seat in hand (the seat wait is the long part). lost: credit = first_lost_page * page_size (no page_size -> credit 0, never an assumed size), uncached = leg-1 prompt - credit. uncached > X -> "WEG2 HANDOFF-LOST-REROUTE rid= first_lost_page= credit= path=fresh-P": drop(rid, reroute_fresh), leg1_done/seat/d_eligible/d_direct cleared, est_uncached = uncached, back at the queue HEAD (the oldest, as an intake stall), R28 reroute, controller kick -- the queue re-entry X-REQUEUE ends with; X-REQUEUE's own entry answers a refused LEG 2 and needs its request and seat, which a rid still awaiting admission does not have, and its W31/W35 counter is not touched. Bounded at one reroute per rid (handoff_lost_reroutes); a second loss is admitted and left to D's own X gate. uncached <= X -> "WEG2 HANDOFF-LOST-KEPT" once per rid; D prefills the lost tail itself (law 4). - Rid end: handle_generate notes its rid on the aiohttp request; before the FORWARD_PATHS routes are registered the app binds front.handle_generate = handoff_seam.wrap_handler(...), the ONE rid-end site -- drop(rid, served | status_<code> (W35 503, refusals) | abort:<Exc> | disconnect) on every return, exception and cancel. - Switch SGLANG_WEG2_HANDOFF_LOST_REROUTE (default on; 0 = no status reads, no reroute; the rid-end drop stays, it is bookkeeping). Tests: test_weg2_handoff_seam_243_0927.py 15 (fake NF module: pending left alone; lost over X -> fresh P at the head with drop reroute_fresh, flags cleared, the line; lost under X kept and named once; second loss admitted; missing module / raising status read none; switch off reads nothing; no leg 1 / skip_leg1 / d_direct not checked; no page_size credits nothing; sweep moves only the lost one and keeps the order; the rid-end wrapper drops on 200 / 503 / exception / cancel and not without a rid; wiring: admitter before and after the seat, controller sweep, route registration, rid noted).
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 27, 2026
…cht läuft, hält über den Flip keine Arena-Referenz -- Ordnung statt Pin, L3-Kopie im Hintergrund, Referenz erst beim Wake, Host-Zeilen nach dem Load-back zurück (Worker-Spiegel per R12 STATE) rc12s dkrnfh91dprbar1dauer09271719, D-TP0 17:32:40 (tmp/r989/befund_248_park_l2_pinnt.md): ARENA-REF-HOLDERS n=7 tree=1231 tree_in_use=3982 sum=5213 own_held=5213 -- ein SCHLAFENDES D hielt 5213 von 5461 KV-Arena-Slots per Referenz: die Schlaf-Vorabholung (sgl-project#1443/sgl-project#1455) von 2 Geparkten (1292 Seiten) und 3 im Schlaf eingetroffenen Wartenden (3921). P fand "no free slot" (17:32:21-58, 17:35:18-25), BACKUP-REFUSED arena_claim, parent_unbacked-Kaskade, 4 leere 200 (W50 re-route impossible). Einen Weg "gehalten -> L3 -> frei" gab es nicht (Arena-Eviction nimmt nur Unreferenzierte, der Claim gibt ohne I/O frei, L3 hielt 96 MiB). Nach dem Wake hielt D die geladenen Spannen weiter als tree=5213 bis zum nächsten Reset; auf den Form-A-Workern wuchs derselbe Bestand als byteless Spiegelzeilen im festen 353573-Zeilen-Pool bis zum Reset (sgl-project#249: R12 SHADOW-OWN-EVICT-REFUSED n=1->592, Vote-MIN -> sgl-project#915 TRUNCATED -> W88). Fix (Form, keine Reserve, keine größere Arena; Schalter SGLANG_WEG2_ENABLE_PARK_L3, Default an, nur Gruppe D; aus = alter Pfad): 1. Referenz erst beim Wake (weg2.park_l3): der Dormant-Hold-Intake schlägt nur nach (P-Kette auf den Request), keine Store-Lesung, keine Referenz, kein Pin im Schlaf. Die Lesung läuft bei sgl-project#1443 DORMANT-RELEASE in Hold-Reihenfolge auf jedem Rang (issue_deferred_reads), das sgl-project#1471-Settle gibt frei, wenn komplett. 2. Park als Ordnung: park_running markiert jeden Geparkten (handoff_pending Rolle "park", Kette in der Marke, mark_park); keep_for liest pending + park, Parks zuerst. 3. L3-Kopie im Hintergrund: Thread weg2-park-demote (D, attn-Rang 0, nie Scheduler-Thread) kopiert gehaltene Seiten per HiCacheFile.arena_copy_to_disk nach L3 OHNE Freigabe -- über den bestehenden Evictor (reserve/commit/abort, 150-GB-Kappe), kein eigener Größen-, Sweep- oder Verzeichnispfad. 4. Claim in drei Stufen, weiter ohne I/O (arena_pool._evict_for_claim): (i) unreferenziert+ungehalten, (ii) gehalten MIT L3-Kopie (frei, arena_fill_from_disk liest zurück), (iii) gehalten ohne Kopie -> benannt HANDOFF-LOST / PARK-LOST. sgl-project#1427 ARENA-DROP nennt stages=i:,ii:,iii:. 5. Nach dem Load-back gibt TP0 die KV-Host-Zeilen des geladenen Pfads zurück (park_l3.release_loaded_host aus loading_check; Seite bleibt COMPLETE in der Arena, Mamba-Anker bleibt), mit R12 STATE je Knoten -> die Worker-Spiegelzeilen gehen beim nächsten Broadcast mit. form_a_host_shadow._reconcile lässt dabei den Anker stehen, wenn TP0 ihn hält (vorher riss ein KV-Verdikt den Anker mit -> SHADOW-SHORT im nächsten Zyklus). 6. PA-Naht (TEILPARKEN_notiz_0927.md §5): handoff_pending.keep_role(rid, "park", page_range=(a,b), page_keys=, page_size=) -> Zahl der Seiten aus [a,b), die zuerst in die Demotion gehen (rang-gleich); keep_role(rid, None) idempotent; keep_state(rid, tree=None) -> {device, l2, l3, pages}; register_pool. Wirft nie. Instrument: sgl-project#248 HOLD-LOOKUP, WAKE-READ, PARK-MARK, PARK-DEMOTE, KEEP-ROLE, LOADED-HOST-RELEASE; HOLDERS park_kept/handoff_kept. Tests: test_weg2_park_l3_248 (17: Hold ohne Referenz, Wake-Lesung + Settle, Park-Marke, Claim-Stufen, L3 bytegleich zurück, Demotion ohne Freigabe, 3 Ränge gleiche Keep-Liste, keep_role/keep_state/Teilpark), test_park_l3_loaded_host_r12_248 (5: Metall-Form Load-back -> TP0 und Worker (0,1), Worker-Pool ohne Ratsche über 5 Park/Resume-Zyklen, Worker gibt nie selbst frei, Host-Lock/Host-Blatt bleiben, Schalter aus/Gruppe P = alt). Rot auf 27e1d90738, grün mit Fix. Nachbarsuiten: siehe Bericht, 0 neue Rote. Metall-Abnahme: own_held(D) im Schlaf ~0; 0x no free slot / BACKUP-REFUSED arena_claim über >=3 Park-Zyklen bei Stau >=5; PARK-DEMOTE vorhanden, Rückkehr per sgl-project#1433 L3->L2 fill digest=match; W50 re-route impossible = 0; LOADED-HOST-RELEASE nach Load-back; R12 SHADOW-OWN-EVICT-REFUSED ohne Ratsche; Flipzeit gegen rc12t prüfen (Wake-Lesung statt Schlaf-Lesung). (cherry picked from commit 3a339b714dc8b3ba6079ce149cf0442995fd4977) (cherry picked from commit b606ec3b7283ea679b5f06aa01bec1789b9aed59)
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 28, 2026
…dit -- Bruecke f833fcb: D schrieb den Anker 37376 in 16-46s eigenem Extend ('sgl-project#1469 RETAIN rid=weg2-16-46 ... cache_len=37376', 19:50:38), 16-48 setzte darauf auf (19:50:51, '#cached-token: 37376'). Der D-Schlaf 19:51:15-16 verweigerte die Host-Sicherung ('sgl-project#1421 BACKUP-REFUSED why=mamba_pin ... pins=8/8', danach 'why=mamba_claim' hinter 'sgl-project#1427 ARENA-CLAIM REFUSED ... no free slot' der 32-Slot-Arena) und setzte den Baum zurueck ('sgl-project#1470 FLUSH-PUBLISH issued=13 unbacked_left=1', 'Cache flushed'). Nach dem Wake gab der Store den KV zurueck (store_hit=37376), aber keinen Anker ('[sgl-project#904 match-census] ... MambaComponent:absent=37376'); die Front preiste weg2-16-54 trotzdem SHORT (presence 35942 src=d_leg2_cached) -> 17 s D-Sitz, dann W31 am X-Gate (38291 Tok) und W50-Umweg ueber P (12 solche in rc12z26, 8 auf der Bruecke). Das X-Gate auf D preist schon die anker-nutzbare Tiefe (W31), die Front nicht. Fix: (a) Instrument: sgl-project#1421 BACKUP-REFUSED nennt depth= und rid= (weg2_node_depth, weg2_anchor_rid). (b) Der Flush zaehlt vor tree_cache.reset() jeden nur-Device-Mamba-Anker mit Tiefe (UnifiedRadixCache.weg2_unbacked_anchors, 'WEG2-ANCHOR-LOST at=flush n= depths= rids='); der Scheduler haelt die Tiefen bis zur Schlafantwort (weg2_take_anchors_lost, einmal lesen). (c) Die Gruppenzaun-Stimme des release-Legs traegt anchors_lost (Modulfunktion _weg2_anchors_lost_for_leg, [] auf jedem anderen Leg und ohne Scheduler-Ledger), die Reduktion vereinigt, ReleaseMemoryOccupationReqOutput.anchors_lost, der Tokenizer-Merge vereinigt (Feld fehlt, wenn nichts verloren -> alte Antwortform). (d) Front.flip liest nach completed_tags die Schlafantwort von D und nimmt jeden SpanLRU-Eintrag zurueck, dessen Kredit auf einer verlorenen Tiefe stand (depth_cap, sonst gemessene ct), 'WEG2 PRESENCE-ANCHOR-LOST'; ein Eintrag auf einem ueberlebenden Anker behaelt ihn. Zu viel Zuruecknehmen ist sicher (voller Preis = Preis des X-Gates). Die Rettung des Ankers ueber den Schlaf bleibt bei sgl-project#259 4c. Luecke: Arena-Verdraengung ohne L3 ausserhalb des Flushs erfasst der Ledger nicht (nur die Host-Kopie-Pruefung). Tests test_weg2_anchor_lost_presence_0928 (10): alle rot auf 1ea8133, gruen mit Fix. Nachbarn 18 Dateien (1424g, H113, H74, R12, sgl-project#59, X-exact, Spans, sgl-project#1470, sgl-project#49/P49, flip_cost_1235, 1273 x2, sched_fix3, W35, Profil, H91e, sgl-project#248): 298 gruen auf Fix und Basis, dieselben 5 Altlasten (VramCredit x3, sched_fix3 b4a/b4c).
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 28, 2026
…dit -- Bruecke f833fcb: D schrieb den Anker 37376 in 16-46s eigenem Extend ('sgl-project#1469 RETAIN rid=weg2-16-46 ... cache_len=37376', 19:50:38), 16-48 setzte darauf auf (19:50:51, '#cached-token: 37376'). Der D-Schlaf 19:51:15-16 verweigerte die Host-Sicherung ('sgl-project#1421 BACKUP-REFUSED why=mamba_pin ... pins=8/8', danach 'why=mamba_claim' hinter 'sgl-project#1427 ARENA-CLAIM REFUSED ... no free slot' der 32-Slot-Arena) und setzte den Baum zurueck ('sgl-project#1470 FLUSH-PUBLISH issued=13 unbacked_left=1', 'Cache flushed'). Nach dem Wake gab der Store den KV zurueck (store_hit=37376), aber keinen Anker ('[sgl-project#904 match-census] ... MambaComponent:absent=37376'); die Front preiste weg2-16-54 trotzdem SHORT (presence 35942 src=d_leg2_cached) -> 17 s D-Sitz, dann W31 am X-Gate (38291 Tok) und W50-Umweg ueber P (12 solche in rc12z26, 8 auf der Bruecke). Das X-Gate auf D preist schon die anker-nutzbare Tiefe (W31), die Front nicht. Fix: (a) Instrument: sgl-project#1421 BACKUP-REFUSED nennt depth= und rid= (weg2_node_depth, weg2_anchor_rid). (b) Der Flush zaehlt vor tree_cache.reset() jeden nur-Device-Mamba-Anker mit Tiefe (UnifiedRadixCache.weg2_unbacked_anchors, 'WEG2-ANCHOR-LOST at=flush n= depths= rids='); der Scheduler haelt die Tiefen bis zur Schlafantwort (weg2_take_anchors_lost, einmal lesen). (c) Die Gruppenzaun-Stimme des release-Legs traegt anchors_lost (Modulfunktion _weg2_anchors_lost_for_leg, [] auf jedem anderen Leg und ohne Scheduler-Ledger), die Reduktion vereinigt, ReleaseMemoryOccupationReqOutput.anchors_lost, der Tokenizer-Merge vereinigt (Feld fehlt, wenn nichts verloren -> alte Antwortform). (d) Front.flip liest nach completed_tags die Schlafantwort von D und nimmt jeden SpanLRU-Eintrag zurueck, dessen Kredit auf einer verlorenen Tiefe stand (depth_cap, sonst gemessene ct), 'WEG2 PRESENCE-ANCHOR-LOST'; ein Eintrag auf einem ueberlebenden Anker behaelt ihn. Zu viel Zuruecknehmen ist sicher (voller Preis = Preis des X-Gates). Die Rettung des Ankers ueber den Schlaf bleibt bei sgl-project#259 4c. Luecke: Arena-Verdraengung ohne L3 ausserhalb des Flushs erfasst der Ledger nicht (nur die Host-Kopie-Pruefung). Tests test_weg2_anchor_lost_presence_0928 (10): alle rot auf 1ea8133, gruen mit Fix. Nachbarn 18 Dateien (1424g, H113, H74, R12, sgl-project#59, X-exact, Spans, sgl-project#1470, sgl-project#49/P49, flip_cost_1235, 1273 x2, sched_fix3, W35, Profil, H91e, sgl-project#248): 298 gruen auf Fix und Basis, dieselben 5 Altlasten (VramCredit x3, sched_fix3 b4a/b4c).
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 29, 2026
…s mitschreiben, nicht mehr frei -- z30n D (Form A, Token-Schnitt 0,32,32) Befund z30n D-Log (...dauer09290349_09993f1153_0929_034921.D.log): Wake->erstes Token Median 11,6 s, max 43 s; D rechnet seinen eigenen Decode-Schwanz neu (3,7-6,8k Tok je Request), weil die von D beim Park geschriebenen Seiten nie lesbar werden: weg2-36-56 RETAINED 77569 / #59b 77568, aber store_hit 77184 (= Ende des letzten P-Legs), '#1324c DELIVERABLE-CAP asked=77568 known=77184', PREFETCH-DEFER-FALLBACK; spaeter 79424 fest ueber mehrere Parks, waehrend RETAINED waechst. Parallel 'sgl-project#1427 ARENA-COMPLETE LOST slots=[...] (recycled under the writer)' 75x auf TP1/TP2, jeweils dieselben Slots auf beiden Workern in derselben Sekunde, nie auf TP0 (TP1 n=1548 kumuliert); DIRECT-WRITE-ACK-Stichproben completed_for_all=0 auf allen Raengen. Wurzel: unter dem Schnitt beansprucht JEDER D-Rang jede Seite (TP0 mit Anteil 0 ohne Extents, oft zuerst -> Status 0 'fresh'; die KV-Owner TP1/TP2 treten bei -> Status 1). ArenaMHAHostPool.free() und abort_write() (und die beiden Claim-Refusal-Pfade) gaben einen noch unquittierten FRESH-Claim mit arena_free_slots GANZ frei -- arena.c zaehlt den Generationszaehler hoch: der Merge der beigetretenen Owner kommt als 3 zurueck (LOST), und eine Seite, die beide Owner schon COMPLETE gemacht hatten, wird ohne Zeile freigegeben. Fix: arena.c arena_release_claims -- ein aufgegebener Fresh-Claim wird nur freigegeben, wenn dieser Rang der EINZIGE Beansprucher war und der Slot noch CLAIMED ist (CAS nach EVICTING, Writer-Zaehler erneut geprueft); sonst loest der Rang nur seinen eigenen Claim auf (writer_done) und die Seite bleibt den beigetretenen Schreibern, COMPLETE oder nicht. ShmArena.release_claims + arena_pool._release_fresh an allen vier Stellen (free_pending, abort_write, claim_refused x2); ohne release_claims (hermetische Fakes) wie bisher free_slots. Kein Schalter: der alte Pfad ist ein Datenverlust. Metall-Marker: '#1427r CLAIM-RELEASE site=<free_pending|abort_write|claim_refused> fresh= freed= kept=' (kept>0 = eine Seite, die vorher verloren ging) und 0x 'sgl-project#1427 ARENA-COMPLETE LOST' auf TP1/TP2; beim Wake store_hit bis zur RETAINED-Tiefe statt bis zum P-Leg-Ende, kein PREFETCH-DEFER-FALLBACK fuer Park-Schwaenze. Tests: test_arena_release_shared_claim_1427r (7) -- die beiden Metall-Formen rot auf c963e47 (TP2-Merge -> 3 LOST; die fertige Seite (-1,0) frei), gruen mit Fix. 47 Nachbardateien (arena/claim/host-pool/weg2-Arena): 385 gruen, 6 rot = identisch auf der Basis (test_arena_host_pool_1424 x3, test_arena_l3_fill_group_rc12z, test_weg2_arena_find_np_xsn309, test_weg2_fix8_image_1233).
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 29, 2026
…D-eigene Seiten werden COMPLETE und lesbar (z30n/z30p) Wurzel (z30p, 16543d7): unter dem sgl-project#239-Token-Schnitt (S=2) schreibt TP1 die geraden, TP2 die ungeraden Tokenzeilen jeder 64-Token-Seite -- je Owner 2 x 12 Attention-Layer x 32 Laeufe = 768 disjunkte Extents einer 786432-Byte-Seite. arena.c gab KV-Slots KV_IVALS=64 Abdeckungsintervalle (ival_cap_for); merge_ivals lief schon beim ERSTEN Owner ueber, arena_complete antwortete 3, arena_pool loggte das als 'sgl-project#1427 ARENA-COMPLETE LOST ... (recycled under the writer)' -- recycelt wurde nichts. Die Seite blieb fuer immer CLAIMED, jede Seite, die D selbst schrieb (Decode-Schwanz, Park), war unlesbar; der Wake las nur P's Hand-off-Seiten und rechnete den Rest neu (108x PREFETCH-DEFER-FALLBACK, Wake->Token Median 11,1 s). Niemand gab den Slot frei: zwischen 05:04:54 und 05:07:40 kein ARENA-FREE, 0x #1427r. - arena.c: KV-Kapazitaet = KV_IVALS + slot_bytes/1024 (786432 -> 832); arena_complete trennt 3 recycelt / 4 nicht mehr CLAIMED / 5 Ueberlauf (Ueberlauf schliesst den Schreiber per writer_done); arena_init verweigert eine Datei mit anderem header_bytes; arena_ival_cap(). - arena_pool: _note_complete_lost zaehlt und nennt die Gruende ('sgl-project#1427 ARENA-COMPLETE LOST site= recycled= not_claimed= overflow='), Refs nur noch fuer Status <= 2; bind() prueft unter owner_rows die Kapazitaet gegen 2 x L x ceil(P/2) und verweigert benannt ('#1427s OWNER-ROWS COVERAGE REFUSED'), sonst eine Zeile '#1427s OWNER-ROWS COVERAGE ... verdict=ok'. - Jeder Slot-Free nennt seinen Grund (Operator-Order nach z30p): 'ARENA-FREE reason=<claim_room|claim_refused|abort_write|free_pending| mamba_free_pending|l3fill_past_prefix|l3fill_complete_refused| evict_to_disk|unnamed>' gedrosselt je Grund (erste 8, dann 2er-Potenzen), auch fuer die in C freigegebenen release_claims. Kosten: Slot-Header 1280 -> 13568 B (tmpfs, duenn): 5461 KV-Slots = 70,7 MiB virtuell, ~21 MiB beim Init beruehrt (vorher ~7 MiB); ein Intervall-Array wird nur waehrend der Owner-Luecke voll. Decode/Flip unberuehrt. Tests: test_arena_owner_rows_coverage_1427s.py (echte NF-D-Geometrie) 6/7 rot auf 7704b80 (Metallpfad: letzter Owner -> 0 statt 1, Seite nie COMPLETE), 7/7 gruen; 51 Nachbar-Dateien 434 passed, 6 rot = die 6 Basis-Altlasten.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 29, 2026
…D-eigene Seiten werden COMPLETE und lesbar (z30n/z30p) Wurzel (z30p, 16543d7): unter dem sgl-project#239-Token-Schnitt (S=2) schreibt TP1 die geraden, TP2 die ungeraden Tokenzeilen jeder 64-Token-Seite -- je Owner 2 x 12 Attention-Layer x 32 Laeufe = 768 disjunkte Extents einer 786432-Byte-Seite. arena.c gab KV-Slots KV_IVALS=64 Abdeckungsintervalle (ival_cap_for); merge_ivals lief schon beim ERSTEN Owner ueber, arena_complete antwortete 3, arena_pool loggte das als 'sgl-project#1427 ARENA-COMPLETE LOST ... (recycled under the writer)' -- recycelt wurde nichts. Die Seite blieb fuer immer CLAIMED, jede Seite, die D selbst schrieb (Decode-Schwanz, Park), war unlesbar; der Wake las nur P's Hand-off-Seiten und rechnete den Rest neu (108x PREFETCH-DEFER-FALLBACK, Wake->Token Median 11,1 s). Niemand gab den Slot frei: zwischen 05:04:54 und 05:07:40 kein ARENA-FREE, 0x #1427r. - arena.c: KV-Kapazitaet = KV_IVALS + slot_bytes/1024 (786432 -> 832); arena_complete trennt 3 recycelt / 4 nicht mehr CLAIMED / 5 Ueberlauf (Ueberlauf schliesst den Schreiber per writer_done); arena_init verweigert eine Datei mit anderem header_bytes; arena_ival_cap(). - arena_pool: _note_complete_lost zaehlt und nennt die Gruende ('sgl-project#1427 ARENA-COMPLETE LOST site= recycled= not_claimed= overflow='), Refs nur noch fuer Status <= 2; bind() prueft unter owner_rows die Kapazitaet gegen 2 x L x ceil(P/2) und verweigert benannt ('#1427s OWNER-ROWS COVERAGE REFUSED'), sonst eine Zeile '#1427s OWNER-ROWS COVERAGE ... verdict=ok'. - Jeder Slot-Free nennt seinen Grund (Operator-Order nach z30p): 'ARENA-FREE reason=<claim_room|claim_refused|abort_write|free_pending| mamba_free_pending|l3fill_past_prefix|l3fill_complete_refused| evict_to_disk|unnamed>' gedrosselt je Grund (erste 8, dann 2er-Potenzen), auch fuer die in C freigegebenen release_claims. Kosten: Slot-Header 1280 -> 13568 B (tmpfs, duenn): 5461 KV-Slots = 70,7 MiB virtuell, ~21 MiB beim Init beruehrt (vorher ~7 MiB); ein Intervall-Array wird nur waehrend der Owner-Luecke voll. Decode/Flip unberuehrt. Tests: test_arena_owner_rows_coverage_1427s.py (echte NF-D-Geometrie) 6/7 rot auf 7704b80 (Metallpfad: letzter Owner -> 0 statt 1, Seite nie COMPLETE), 7/7 gruen; 51 Nachbar-Dateien 434 passed, 6 rot = die 6 Basis-Altlasten.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Oct 1, 2026
…ssion, like its KV chain (sgl-project#1417) -- z30y15 weg2-12-56 told=0 re-prefill z30y15 P PP0 04:21:39Z, rid weg2-12-56: the read brought the mamba anchor at 16383 (#1028B FETCH CAP anchors_in_range=(4, 16382)), the insert named the end node (sgl-project#1423 INSERT-PLACED matched=16383 deepest=107) and the mamba PREFETCH commit attached the anchor there. But check_prefetch_progress takes the sgl-project#1417 pin BEFORE the components' commit: at pin time the node carried no mamba host value, so its mamba lock was skipped (skip_lock_node_ids), and the commit left the fresh anchor UNLOCKED on the mamba host LRU. The 112-slot mamba arena evicted it within the second (sgl-project#1427 ARENA-DROP slot_bytes= 78446592 at 04:21:39), PP0's told-fidelity probe found no state (pp0_admissible=0) and sent told=0 with acks {1: 16383, 2: 16383}; PP1/PP2 "sgl-project#928 REFUSING ... best_value_len=0"; P re-prefilled 16383 tokens. Fix (unified_radix_cache.check_prefetch_progress): after the components' PREFETCH commit, a request whose span was pinned re-takes the pin -- the anchor is now host-locked with its chain until pop_prefetch_loaded_tokens / release_aborted_request release it (unchanged release path). Not touched: a read without a pinned span (declined / host_span_unclaimed). On P "0x PREFETCH-ANCHOR-ATTACH" is no defect by itself: that line is the branch for an end node WITHOUT a Full host copy (the D case); P's end node had one and the anchor attaches silently. Tests (CUDA_VISIBLE_DEVICES="", real check_prefetch_progress, real FULL+MAMBA tree): new test_prefetch_anchor_pin_z30y15.py red on 38c1d66 (2 failed: host_lock_ref 0, drive_host_eviction strips the anchor), green here (3 passed incl. the admission releasing the pin). Neighbours (1417 pin/sanity/reset, 1424h2, 1157, 257, 937/939/905, p4b, 257iii, anchor attach 0930 x2): pass, except 905 double-free retry test which fails identically on the base. mem_cache prefetch/radix sweep: 221 failed / 765 passed identically with and without the fix (pre-existing scaffold failures).
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Oct 2, 2026
…troyed the early hold read (N4f ping-pong) N4f 1002_110321 (L15 on, WAKE_READ_EARLY on by default since d1e5da0): 11:11:19 sgl-project#248 WAKE-READ-EARLY issued=3 for D's parked rids (weg2-10-16, weg2-11-17, weg2-18-20); 11:11:21 HiCache prefetch success weg2-10-16 loaded=203826; then the kv wake's L15 path (L15-REFILL anchors-missing: votes no hold, L15-RESTORE no hold kept) reset the tree (sgl-project#1427 ARENA-REF RESET-RELEASE released=203827, HOST-POOL CLEAR) and the read was gone: X-GATE weg2-10-16 uncached=206952 W31, weg2-18-20 uncached=14384 W31, W50-REROUTE x_refusal_midstream of both to P, FLIP-ECONOMICS p_only=2 -> D->P 4.0 s after the P->D (11:11:21.9 -> 11:11:25.97, MIN-DWELL held 3.9 s): the ping-pong of N4f. The release-time read is issued after that reset and survives it. park_l3.early_enabled() now also requires SGLANG_WEG2_L15 off (read via l15_plan.master_on, the group's env -> the same on every rank). No L15 code touched. Until the L15 wake keeps a completed hold read or skips the L15-held rids rank-uniformly (l15-lead), L15 boots read at the release. Test (flock pytest.lock, systemd-run MemoryMax=4G, nice 19, ionice c3, -n 1; the 31 dormant-hold / hold-read / wake-tail files): this commit: 312 passed (+ test_red_pdflip_early_read_is_off_under_l15, RED on e34d3ee)
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Oct 2, 2026
…ion fixes: N4F-FIX / SLEEP-AGREE, CAP0-CHECK + REFILL-DMA, 16c park chunks, FLIPCOST-3, 10d hot take at wake, 14e-2 deposit adopt, READ-EARLY-FILTER, L15-17 hermetic test)
Conflicts, each side keeps its markers:
* scheduler.py flush_cache: L15-SLEEP-AGREE POST (all-ranks hold or every rank flushes plain) first,
then PDFLIP-L '_fsub.mark("l15")' after it.
* park_l3.py: L15-READ-EARLY-FILTER (l15_agreed_held_rids) beside PDFLIP-S (spread_enabled, max_n).
issue_reads_at_wake_begin(sched, max_n): the filter computed ONCE per wake (PDFLIP-S calls once per
weight tag) -- cached on the scheduler by the wake sequence (_wake_key; l15-lead: an object id can
repeat across wakes), then note_hold_order + issue_deferred_reads(max_n) + spread-aware log line.
PDFLIP-P's L1.5 lock (a065d69: early_enabled() False under L15) stays -- on the l15-lead's word:
the filter only skips rids every rank holds, the N4f wake-without-hold is SLEEP-AGREE's, the real
fallback still resets the tree; lifted together (l15-lead + P->D seat) once an L15 boot shows no
W31 on parked rids after the wake and no sgl-project#1427 RESET-RELEASE on verdict none.
Tests: test_weg2_l15_read_early_filter_1002 (stub takes max_n; + once-per-wake under the spread,
asks again at the next wake); L15 / park_l3 / WAKE_READ_EARLY suites (100 files): 710 passed,
2 red = test_weg2_sched_fix3_0907 b4a/b4c, red on the base 6dd8d7e too.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Oct 4, 2026
…ct#1427 rows, host-backed END anchor), pp0 mode, log names rank and end_anchors, corrected rank-congruence text A1: the leaf and every descendant are kept (old behaviour) when write_through_pending_id is set (split node: the key stays the OLD node id), the node id is in _weg2_direct_mamba_rows (sgl-project#1427), or it is a END anchor with a mamba host value (the reset path holds it one D phase on purpose). A2: the docstring said "named stop on one request" for the follower case; sgl-project#1004 SLOT DISAGREEMENT and Weg2StoreToldMismatch are raises without a catch = named group death. SGLANG_WEG2_DUAL_UD_HOST_CHILDREN is now 1 (all P ranks, default) / pp0 (tree.pp_rank == 0 only) / 0. The _weg2_store_told_satisfied window is documented as a named residual (the tree does not know the scheduler's satisfied rids). A3: EVICT-UNBACKED-DROP SUBTREE names end_anchors and rank=pp<n>. Tests: 20 in mem_cache/test_dual_p_ud_host_children_1004.py (new: pending id, direct rows, END anchor, pp0, log, M4 mamba pool/LRU return, M15 EF retry off), flip_unchanged_1003 88 passed, neighbour suites of the changed modules 217 passed.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Oct 4, 2026
…gl-project#1427 mamba rows, host-backed END anchor) in the V2 eligibility, A3 over-trim brake (order capped at P's own_held; 3 orders in a row that do not lower arena_pinned pause the episode 30 s, named warning), A4 execute/decide never raise (named STOP lines), A5 REQ-TRACE hides the order, A6 tests for the aux-host-only / staging-rows / budget guards Tests (pytest_gedeckelt.sh): test_dual_arena_trim_v2_1004.py 34 passed; V1+V2+Q-697c+Q-1190+flip_unchanged together 156 passed; touched-file neighbour suites (burst clock, pp order/deadlock, idle vote, flush verdict, phase policy ...) 271 passed / 18 failed -- the same 18 failures as on 056ece9 (harness stand-ins without flush_wrapper / _pp_post_send / _pp_send_admission_decision, pre-existing). Mutants (each >=1 red): V1-guard call out, aux-host-only guard out, budget not passed, staging guard out, own_held cap out, stale brake out, execute raises, decide raises, trace filter out, post-D out.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Oct 12, 2026
…unt (children test, not the L3 backup rule); death-shape tests at realistic host room, clr-only mutant Review finding: the first commit named the root as "the vote priced node 181 as a backup into the slots the W3 spill freed". The log contradicts that. P.log 40117-40135: the peel demoted the device children 195/194 (backuped=True, MAMBA host_lock_ref=1), then node 181 could neither be backed up (sgl-project#1427 ARENA-DROP need=1006 freed=0, sgl-project#1421 BACKUP-REFUSED why=arena_claim) nor dropped (UD-H cannot clear host-locked children), delivered=960. The old walk paid 181 over its UD branch: its host-child test saw only children that were host-only AT VOTE TIME; 194/195 were still device nodes, so the test was vacuously true. The old backup branch (budget >= tokens) cannot pay 181 at a host room below 120448 (the vote's real host_free is not in the log: unbelegt). Changes (no behaviour change in the walk): - pp_slot_fidelity: new demoted_node_clearable(node, children_clearable) = the test host_node_local_ok applies once a demoted node is host-only (no host lock, children clearable); pp_room_vote's clr propagation calls it. THE DEATH / THE ROOT comment, the BACKUP route note (l3 rule is conservative, NOT the proven cause), pp_room_vote docstrings, the unified_radix_cache comment and the test docstring now state the log-proven root. - tests (17, was 14): death shape at realistic host room (0 and 56064 < 120448: walk == peel), mutant "only the clr/host-lock term reverted" overpays at host room 0 / 56064 / BIG, old walk overpays at 0 / 56064, load-back path: clr-only mutant dies with "PR AGREED-ROOM SHORT" at both realistic host rooms, shared check refuses without a stop. Tests (pytest_gedeckelt.sh, PYTEST_MEMMAX=4G, CUDA_VISIBLE_DEVICES empty): - test_weg2_room_vote_one_check_1011.py + test_nf_n3_unchanged_1005.py + test_planer_referenz_n3_1006.py (goldens NF part) + test_weg2_pp_room_vote_int19_1008.py + test_weg2_pp_room_arena_honest_int22_1008.py + test_weg2_pp_slot_fidelity_b23_0927.py + test_weg2_unbacked_drop_eb_rc12q_0927.py: 124 passed, 0 failed, 3 skipped. - 188 vote/room/evict/hicache/spill/park/arena/w3/l3 test files (weg2 + mem_cache, without unified_radix_cache_unittest/bench): 1774 passed, 18 failed, 16 skipped. 17 of the 18 are red on 6c53a95 too (same test names in the earlier base run); the 18th, test_weg2_arena_find_np_xsn309::test_arena_get_uses_the_numpy_path, is a source-text assert on managers/cache_controller.py, which this branch does not change (git diff 6c53a95 -- that file: empty) -> pre-existing. - unified_radix_cache.py: comment-only change this round; the -k run of the first round (317/128/221 == base) was not repeated.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Oct 15, 2026
…ide the join wait loses its key -- the reader reads the page from L3; the claims a wait leaves are named NF h16h 853534a (boots 1014_211215 / 1015_011215): 16 of 16 JOIN-WAIT tears (5 s, still_claimed > 0) 3-45 s after a park on D or a wake of P, 67-100k tokens recomputed per case. Every claim census of boot 011215 that names held claims names role host-write with no open writer: pid857 = P PP0 (barlink P.log Z.110), pid2659 = D TP0 (D.log Z.136) -- the census at 01:53:17 (P.log Z.143135ff, claimed=200 oldest=3603/10583ms/pid857/host-write/g76/open0) is P PP0's own host-write claim, its age = PP1's CHUNK-PUBLISH merge at 01:53:06 (Z.142971). Root, by code: a host-write claim completes only when EVERY writer of the page merged (P: one layer shard per PP stage; D Form A: TP1/TP2 token owners, TP0 claims share 0) and each writer decides its own backup (R12 SHADOW-SHORT why=arena_claim: 114x in D.log 011215). Every writer that merged references the partial slot (ArenaMHAHostPool.complete_write: ref for status <= 2, partial included). arena_quarantine_stale then answers 3 (referenced) for as long as a writer's node lives and 0 (young) while late extents trickle in: the JOIN-IDLE reap and the SELF-JOIN take-over refuse, the read ends at the claim although L3 holds the page. Both rig readings (S4c reference, S4c3 trickling merges) are this one class. * arena.c arena_quarantine_host_write: a CLAIMED host-write slot of the caller's generation is taken from its key regardless of references and byte progress; the old slot is QUARANTINE (never freed while referenced or written -- quarantine_release / quarantine_sweep), a late completion answers 6, a new reference is refused. Other roles: status 4, untouched. * hicache_storage.arena_fill_from_disk: after the join wait (prefetch io thread only -- every other caller keeps the immediate miss) and the stale reap, what is left is named (L3-FILL JOIN-HELD: refs, merged/joined writer tags, open, coverage, age, quarantine verdict per slot), host-write holders are taken over (L3-FILL HOST-WRITE-TAKEOVER) and read from L3; a stem a peer stage took over first is awaited once instead of ending the prefix. * Switches SGLANG_WEG2_L3FILL_HOST_WRITE_TAKEOVER, SGLANG_WEG2_L3FILL_JOIN_HELD_LOG (default ON). raenge-nie-uneins: arena integrity, not a rank decision -- every stage lands the same or a deeper depth, the read depth stays the group's told (PP0 / MIN). readdepth open question: the missing writer's late merge on a taken-over slot answers 6 (sgl-project#1427 ARENA-COMPLETE LOST stale_reaped=, no reference taken); its node's rows are re-pointed to the key's COMPLETE slot by sgl-project#1424 _chain_plan. Base: desk/nf-h16n-int-1015 @ 17c2563 (origin; branched at 222919f, rebased). rank_role.py: the F14 seam anchor 'class FormAWorkerNullStorage' follows (hicache_storage 5717 -> 5868); test_weg2_form_a_dcp_s3d_239: 15 passed. Tests (all /spinning/gpu-arb/pytest_gedeckelt.sh): * cold-start rig (tools/weg2_coldstart_rig.sh): base 222919f S4c ROT (landed 0 of 24), S4c3 ROT (7 of 24), all else GRUEN; this head: all 17 GRUEN (S1, S2, S3, S4a, S4b, S4c, S4c3, S4c2, S5, S6 + 7 self-checks). * test_weg2_h54_park_join_1015.py: 14 passed; on the base 11 failed, 3 passed (the 3 that pin the base behaviour: root, switch off, off-thread). * mutants: quarantine_stale semantics -> cut; any role -> peer's fill lost (6); re-joins dropped -> cut; gate removed (sed) -> off-thread test red. * neighbours (66 files on arena_fill_from_disk / quarantine / join wait / claim census / host-write / complete_write): head 645 passed, 5 failed, 3 skipped; base the same 5 failed (rc12z, l3_fill_orphan_claim_nf x2, xsn309, l3_index_1459), 627 passed. * catalog.json rebuilt (+2 env entries); profile_catalog_1003, profile_catalog_union_1005, kanten_loader_2002: 29 passed.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Oct 15, 2026
…for a P read -- TP0 decides for the group, the workers follow its R12 verdicts, anchors stay The KV arena is ONE file shared by group P and group D; a slot is free only when no rank of either group holds it. READ-ROOM (73b1a36) armed the local-PP floor only, and _w3_arena_spill returns 0 under R12, so group D never answered a room request. Boot ..._226aad7105_1015_124245, weg2-70-293 (13:35:34-39): READ-DEPTH landed=47 of=1832 cause=arena_full on all three P stages; arena-786432.bin pinned=6485 of 6485 refs=21495; P own_held=2258 per stage (running requests), D TP0/TP1/TP2 ARENA-REF-HOLDERS (13:35:42) tree=3215 tree_in_use=1692 own_held=4907: the host copies of D's live tree and of the five requests D had just parked (WEG2-D-PARK park_running ... span retained; sgl-project#248 PARK-DEMOTE ... l3_pages=996 absent=0 -- already on the L3 disk). D gives them back only at its sleep's sgl-project#1427 RESET-RELEASE. (That boot then died of W120 -- root K12, a dead backup thread on D TP0, nf-k12-sleepdrain-1015; not claimed here.) READ-ROOM-D (weg2/read_room.py only): - armed: local-PP floor OR a rank of a Form A TP group (R12 role host/worker): every rank of D posts its fills' need and waits the same bound; serves: local-PP floor or Form A TP0 only -- a worker never releases on its own; - serve on Form A TP0 -> form_a_spill: device-resident nodes with a KV host copy; secure_rows_to_l3 first (arena_secure_to_disk: lost != 0 or nothing COMPLETE keeps the node); aux host rows, then the KV rows (sgl-project#248 LOADED-HOST-RELEASE rule); l3_present; R12 record_state(why="read-room") -- every worker drops the same rows at the next tp<-reqs broadcast (form_a_host_shadow._reconcile). Kept: a node with a Mamba anchor on the host (a parked request keeps its anchors as they are), host lock / pending write-through, aux state on the host only, host-only nodes (the sleep reset gives those back). Order: the group-equal _w3_spill_keys. Named line READ-ROOM D-SPILL; - the hybrid HostPoolGroup resolves to its anchor host pool under READ-ROOM's own switch: the NF profiles set SGLANG_WEG2_ENABLE_W3_SPILL_ANCHOR_POOL in NF_ENV_P only, D would have stopped there. A parked span given back is read again by stem at the resume (L2 while the slot holds it, else the L3 copy written before the release): the whole span to its last anchor, never short, never recomputed. Tests (test_weg2_read_room_d_1015.py, real C arena + real HiCacheFile.arena_fill_from_disk, real UnifiedRadixCache trees for D TP0 and its worker, real R12 attach/consume/_reconcile), under pytest_gedeckelt.sh: head 8 passed; the same file on f5278f4: 8 FAILED (the two integration cases by behaviour: D's serve released 0, the read landed 0 of 16). Mutants scripts/mutants_arenaread_d_1015.py (one lock turn): 13 of 13 KILLED.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Oct 19, 2026
…(A2), real K12 release (A3), S80 comment (H1) Review nf-review-s81-1019 A1 (boot blocker): the Python census (_s81_orphan_slots) and arena_release_claims were two steps; release_claims is the give-up of a writer with its OWN open claim -- on TP0's open0 share-0 slot its writer_done took the open writer of a worker that joined in between and free_if_abandoned freed the slot under it (completion 3 'recycled under the writer' = S61 / K21 RANK-DIVERGENCE class). Now arena.c arena_revoke_orphan_claims (+ ShmArena.revoke_orphan_claims): CAS CLAIMED->EVICTING, under slot_lock the slot is freed only if writers == one claimant with none open, n_ivals == 0, refcount == 0 and the generation is the caller's; anything else goes back to CLAIMED untouched (no writer_done), status 1 'kept' -> the S81 entry stays. A2: tests per release condition in the dangerous form (joined/open/no bytes), each alone (pid, open, covered, claims, ref) with the writer census unchanged; the publish gap over 12 republishes capped at 64; a kept release keeps the entry. A3: the revoke test through the REAL UnifiedRadixCache._k12_republish_orphaned -> _pdflip_release_chain_piece_host -> ArenaMHAHostPool.free: TP0's slot reference is 0 at the revoke (sgl-project#1427: a writer's node references its CLAIMED slot from the claim on), the orphan is revoked, R12 STATE goes out. H1: the S80 comment no longer says the workers evicted their shares unbacked (sgl-project#1469 EVICT = mamba component). Tests (serial, systemd-run MemoryMax=2G, real C arena): test_s81_store_hole_d_1019.py 21 passed (A1 repro included: the review's sequence, slot kept, joiner's writer untouched, its completion 0). Reviewer mutants /tmp/rv78-tools/mut81.py M1-M12 + M13 (revoke via release_claims) all killed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Currently when running
sglangin a multi-node configuration with infiniband andNCCL_DEBUG=INFO, the logs will containThis means all-reduces will be performed over TCP instead of gpu RDMA. In the VLLM containers, they fix this by installing
libibverbs-devhereDoing so in
sglang's docker container fixes this issue and greatly speeds up multi-node deployments.Modifications
Add
libibverbs-devto the installed dependencies in the Dockerfile.Checklist