Repository navigation
Fix padding in the cuda graph - #1469
Merged
Merged
Conversation
Merged
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 17, 2026
…caller, EVICT with backup state With group P at --max-running-requests 2 the backup finds the node's mamba value EMPTY (86-102 of ~120 backups on weg2xsn219/221/222/225/226; 24 with one running request) and group D re-enters only the first 4095 tokens (W31/W35, then an ADMISSION-WEDGE on D). Three fixes aimed at the write-back backlog (sgl-project#1465, sgl-project#1467, sgl-project#1468) did not move it, and no existing line says whether the value was set at insert or who took it away. Rate-capped 'sgl-project#1469 RETAIN rid= is_finished= token_ids_len= cache_len= value=', 'sgl-project#1469 FREE caller= slot=' and 'sgl-project#1469 EVICT node= backuped= host= lock_ref=' answer that. Tests: 1469 (2) + 1467/924/pingpong -> 19 passed.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 17, 2026
…oin the write-throughs BEFORE the tree reset; mamba eviction spares un-backed states The hand-back regression since the bs1 order (xsn202): the flush's publish sweep was skipped whenever the waiting queue held anything (held store-told intakes count) and, when it ran, nothing waited for the write-throughs it issued before tree_cache.reset() dropped them. With group P at --max-running-requests 1 the backlog at the sleep flush is ~1 node and the race is invisible; at 2 it is 40-72 nodes (weg2xsn225/226/ 227: PUBLISH-SWEEP unbacked=72 in_flight_after=56 right before 'Cache flushed'), so P slept with the store missing every node past the first and group D -- whose sgl-project#1455 hold prefetch now reads DURING the flip -- re-entered 4095 of 97870 tokens ('STORE READ INCOMPLETE shortfall=93775', W31/W35, 0 of 6 served). xsn194 (p-bs 2, before sgl-project#1455) read after the drain and served 9/9 with the same backlog. flush_cache: sweep whenever nothing runs, loop until no node is un-backed, join the write-throughs, then reset; 'sgl-project#1470 FLUSH-PUBLISH issued= unbacked_left= waited_ms=' names it. mamba drive_eviction skips un-backed nodes (their backup is queued) instead of freeing the value (xsn227 sgl-project#1469: 88 EVICT backuped=False). Tests: 1470 (1) + 1386 (22) + 1456 (5) + 1068 (48) -> 70 passed.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 17, 2026
…s its state weg2xsn241/243 (P, --max-running-requests 2, write_back): the mamba pool's interior-node branch freed the recurrent state without a backup (28 x 'sgl-project#1469 EVICT backuped=False host=False' per minute under the second 98k prompt); the node's later KV write-through carried mamba_value=EMPTY, the store held 93,775 leading KV pages with no anchor in the page-floored tail range (the final anchor at 97872 lies outside ..97870), every hold re-read on D answered zero (#1035c CAPPED by=mamba) until the settle bound lapsed -> W31 -> second prefill. Mirror _evict_device_leaf: under write_back, write_backup(node, write_back=True) + writing_check(write_back=True) before the device value is freed; refused/failed backups evict as before. sgl-project#1469 note BACKUP-BEFORE-EVICT (written, ms). Tests: test_weg2_backup_before_mamba_evict_1480 (5) + 1469/1470/1467/924 -> 22 passed.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 18, 2026
…ead of refusing sgl-project#968 xsn282 (7b1e692): the first boot that loaded 98k prompts into group D (WEG2-ARENA-LOAD ~2020 compact rows per 3080 rank, draft half skipped by name) decoded three of them (cached 98550/98890/99570, 137/223/148 completion tokens) and died admitting the fourth: 'sgl-project#968 LOAD-BACK GDN ANCHOR OFF-EXTENT for rid=weg2-5-7: PP0 published an extent of 98210 token(s), this rank's load-back yielded 0' -> 'sgl-project#791 FORWARDED SCHEDULE UNEXECUTABLE STOP' on all three ranks. Zero rows loaded is not a skewed host tier -- it is no device room yet: the three finished prompts are retained (sgl-project#1469 RETAIN) until their write-through (sgl-project#1442 HANDOFF), and the effective pool (360k tokens under uneven DCP) cannot hold a fourth 98k prompt beside them. The adder now gives the adopted mamba anchor back (release_admission_acquired_mamba_slot, site=loadback_no_room) and returns NO_TOKEN -- the request waits like any other while the pool is full -- logged as WEG2-LOADBACK-WAIT. A PARTIAL load still refuses sgl-project#968 as before. Tests: loadback_no_room_xsn282 1 (new), intake_stall_xsn272 8: green; schedule_policy import smoke ok.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 23, 2026
…n, Knoten-Einheiten = konsumierte Token (fnFL2x76, Hebel 1) Befund x76 (Flipzeit 4,66 s): der Post-Wake-Extend auf D kostet 1,5 s fuer 105 Token, weil P den GDN-Zustand nach 4480 Token (Chunk-Ende, Grain 64) mit einem Schluessel aus 4480 Token = 4479 Bigram-Einheiten ablegt; die Seiten- ausrichtung faellt auf 4416 Einheiten, D restauriert 4416 KV-Token unter einem Zustand, der 4480 konsumiert hat (64 Token doppelt; x69 MID-2 hat das toleriert) und rechnet 77-105 Token nach. Fix: `bigram_anchor_key` -- unter Bigram-Schluesseln mit rekurrenter Komponente (`UnifiedRadixCache.bigram_anchor_exact`) nimmt der Retention- Schluessel das naechste (bekannte) Token dazu: Knoten mit cache_len Einheiten = KV-Praefix von genau den cache_len Token, die der Zustand konsumiert hat; die letzte volle Seite bleibt erhalten. Am Request-Ende ohne naechstes Token gilt die Upstream-Form. `MambaComponent._raw_token_pos` ist unter der exakten Form die Identitaet (+1 nur fuer die Upstream-Form, die in Produktion keinen Zustand mehr traegt); END-ANCHOR-Probe entsprechend. Dense-Bigram-Baeume (27B + DFlash2) unveraendert. Erwartung am Metall: D extendet 13 statt 105 Token, Flipzeit < 4,0 s, Doppelfuetterung weg. Tests: test_bigram_anchor_exact_x76 (4); Stubs in 747/758/913 um bigram_anchor_exact ergaenzt (Altlasten dort: is_on_interval- Quelltextsuche seit sgl-project#1469, two_file_arm -- unveraendert rot).
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 26, 2026
…alten dieselben Host- und Anker-Eintraege -- gruppeneinheitliche Freigabe-Politik statt fuenf Verdikt-Riegel Wurzel der Klasse rc9i/rc9k/rc9l/rc9m/rc9o: auf NF-D (Form A, --rank-tp-ratio 1,0,0) entschied jeder Rang die Host-Lebensdauer eines Knotens selbst. Store-Ack (_drain_storage_control_queues_impl/_drain_backup): TP0 bindet die Zeilen an die Arena (_weg2_rebind_host_to_arena) und behaelt sie, TP1/TP2 (0-Byte-Plain-Pools) geben sie als Transit frei (_weg2_release_chain_piece_host: HOST-Schicht ALLER Komponenten, Mamba-Anker eingeschlossen) -- rc9m-D-Log: 'WEG2 PUBLISH-CHAIN host released' nur auf TP1/TP2, rc9o ebenso (0/8/8, ratenbegrenzt). Dasselbe nach dem Load-Back (loading_check, nur ohne arena_read). Bei der naechsten Device-Eviction ueberlebt der Knoten auf TP0 als Host-Knoten mit Anker (sgl-project#1469 EVICT ... backuped=True host=True), auf den Workern wird er geloescht (host=False) -> Anker auf verschiedenen Tiefen (rc9o MAMBA-HOST-RESUME 17/13/13). H93/H96/H97/H98/H99 schliessen je ein VERDIKT auf diesen Baeumen; R12 nimmt den Unterschied aus den BAEUMEN. Politik (Variante c + a, Kapazitaet b), neues Modul mem_cache/form_a_host_shadow.py: - (c) Ein Form-A-Worker behaelt seine bytelosen Host-Zeilen, solange TP0 sie haelt: kein Transit-Release am Store-Ack und nach dem Load-Back ('R12 SHADOW-KEEP'), keine eigene Host-Eviction (evict_host -> 0, Aufrufer verweigert benannt, 'R12 SHADOW-OWN-EVICT-REFUSED'). - (a) TP0s EIGENE Host-Entscheidungen reiten auf dem vorhandenen tp<-reqs-Broadcast (request_receiver.recv_requests, Muster sgl-project#969 W3; keine neue Kollektive, kein neuer Bogen): TP0 haengt ein FormAHostVerdict VORN an die Liste, direkt nach dem Broadcast nimmt jeder Rang es heraus und wendet es an, bevor ein Request des Passes (Intake, Zulassung, Votes) den Baum liest. Schluessel = letzter Seiten-Hash + End-Tiefe (inhaltlich, nicht die rangeigene node.id). TRANSIT: gescheiterter Arena-Rebind auf TP0 -> TP0 gibt nicht mehr sofort frei, JEDER Rang (TP0 eingeschlossen) ruft beim naechsten Broadcast dasselbe _weg2_release_chain_piece_host. STATE: Abgaben, die TP0 sofort nehmen muss (H19-Anker-Verdraengung, eigenes evict_host, verweigertes Backup sgl-project#1421) -> Zustand (exists, KV-Host, Anker-Host); der Worker gleicht an (unter eigenem Host-Lock/laufendem Write-Through wartet der Eintrag und wird je Broadcast erneut versucht; ein spaeteres erfolgreiches TP0-Backup ueberschreibt ihn). Baum-Reset (Flush/Flip, auf allen Raengen an derselben Stelle) verwirft Ledger und Wartende. - (b) Kapazitaet aus replizierten Eingaben: der 0-Byte-Anker-Pool eines Workers bekommt 2 x SGLANG_HICACHE_ARENA_MAMBA_SLOTS Zeilen (TP0 adressiert Staging 6 + Arena 32 auf rc9m, der Worker hatte nur die synchronisierten 6; 0 B/Zeile). Der KV-Pool des Workers deckt TP0s ID-Raum schon (fnFL2x62, 353600 = 4096 + 5461 x 64). Schalter SGLANG_WEG2_ENABLE_FORM_A_HOST_SHADOW (EnvBool(True)); wirkt nur mit installiertem Form-A-Rollenplan, dessen Host TP-Rang 0 ist, auf reiner TP-Gruppe (keine DP-Attention, pp 1). Aus bzw. klassischer Boot = d1c7094. H93-H99 bleiben als Riegel; mit identischen Baeumen feuern nicht mehr: H96 RU FLOOR CAP / CAP-MISS, H97 RU FLOOR SKEW-ZERO, H98 FormAFollowMiss und die FOLLOW-Abweichungszeile, H99 W65 PrefetchSpanSplit und PREFETCH-FOLLOW, der H93- Usable-Arm nullt nur noch einheitlich. Tests test_form_a_host_shadow_r12 (14, echte UnifiedRadixCache-Methoden -- Storage-Drain, Transit-Release, loading_check, Evict-Trichter, _evict_device_leaf/_evict_to_host/_evict_host_leaf, evict_host, sgl-project#1421, H19 -- auf echten UnifiedTreeNodes, je Rang mit echtem installiertem Form-A-Rollenplan, Broadcast als Pickle-Rundreise): auf d1c7094 3 rot (rc9m-Form: TP0 {128,256,384: KV+Anker}, TP1/TP2 leer; Store-Ack; Load-Back), 2 Waechter gruen (Schalter aus, klassischer Boot), 9 ohne Modul uebersprungen; mit R12 14/14 gruen. Betroffene Suiten (H74, 1424, x20, 1068-mamba-mib, x25, 810, dround-27b, 841, 904, H19, 1481, Task3-Loadback, H81, 1469, 639, 645, 1158, H98, H99, H97, H96, RU): 33 Rote identisch zur Basis (Altlast), 0 neu. H99b (0002) wendet sich unveraendert darauf an (andere Dateien).
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
… park retained Metal dkr27bparkdraftbar1w209270645 (27B, rid weg2-2-5) and dkrnfh91bar1dauer09270859 (NF, weg2-1-13 / weg2-6-29): the same root on both models, so the repair is model-neutral. WHY 256 OF 417. park_running retracts with retain=True; cache_finished_req inserts min() of the components' retention lengths. With --mamba-scheduler-strategy extra_buffer the mamba component answers req.mamba_last_track_seqlen, the last DECODE TRACK point (multiple of --mamba-track-interval 256): sgl-project#1469 RETAIN token_ids_len=417 cache_len=256 (NF 47262 -> 47104, 45697 -> 45568). The KV above it is freed and never written (sgl-project#1439 census of the 416 keys: 255 COMPLETE, 161 state 0). 256 IS the last valid mamba anchor; KV beyond it cannot be resumed without a state and is recomputed anyway -- correct, not the defect. WHY THE REST WAS NOT READABLE -- never written, and asked for anyway. The dormant-hold read and the sgl-project#1471 settle registered the request's WHOLE context (417 / 47262 tokens), a span the store can never complete: * NF: prefetch INCOMPLETE delivered=47104 deliverable=47232, every re-read of the 128 declined below the threshold (vote_negative), SETTLE-RELEASE lapsed held_after_wake_s=20.0; * 27B: the store held 255 bigram pages -- one under prefetch_threshold 256 -- and the prefetch thread revoked every read (storage_hit_count < prefetch_threshold), record materialized 0, four sgl-project#1456 zero-answers, held_after_wake_s=20.1; after the lapse the fresh read (hand-off keys dropped at the wake) answered sgl-project#1035 R13 EMPTY keys=417 and D prefilled all 418 tokens. THE REPAIR (SGLANG_WEG2_PARK_READ_CAP, default on; 0 = the old read byte for byte): * cache_finished_req stamps the raw token span of the key it inserted (weg2/d_park_read.py RETAINED_ATTR; bigram = units + 1); park_running clears a stale stamp before the retraction and stamps (retained, request length) on every parked request, one line WEG2-D-PARK RETAINED; * _prefetch_kvcache ends the store read of a request whose length has not changed since the park at that span (after the fork cap): the read lands COMPLETE, nothing to settle, the resume's extend computes the tail (< one track interval); * that read may be smaller than the threshold (min_tokens=1), and the controller now honours a caller's floor on the store hit too (managers/weg2_min_hit.py, registered before the operation is queued, consumed once, never raises the threshold) -- the same second-threshold gate had also defeated xsn437's sub-threshold tail re-read. All terms are functions of the request ids and the retained key (identical RETAIN on TP0/1/2 on both models, Form A workers included) -- no collective, no file. Not changed: the retain itself (a live-state anchor at the park would need sgl-project#747's grid rule lifted); PK2's zero-read settle stays as the net. Tests: test_27b_park_retain_read_0927.py 13 (retained span arithmetic bigram/plain, read span == stored units, cap inert once the request grows, switch off/no stamp = old read, controller floor lowers once never raises + metal numbers 255<256, bounded table, park stamps/clears/logs, REAL UnifiedRadixCache+MambaComponent: stamp == what the tree holds with a 16-of-21 track cap and the KV above freed, wiring order). Mutant (stamp the whole span) caught. Affected suites per file (weg2 park/hold/settle/refetch/store-short, mamba anchor, prefetch gate/participation/generation, controller reset): branch 380 passed / 8 failed, base 9417507 367 / 8 -- the same 8 (mamba_anchor_seams_747 x1, prefetch_completion_generation_905 x1, participation_desync_580 x6) fail identically on the base; test_unified_radix_cache_unittest exceeds the 3G test cgroup on both.
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 28, 2026
…nach N frischen Marken ohne Zuwachs PREFETCH-DEFER-FALLBACK (Match nehmen, Rest auf D extenden) rc12y (ce041f0, D-Log weg2-16-42, 00:07:35-00:13:24): EIN Store-Read von 46850 Tokens endete 692-mal 192 kurz (sgl-project#1324 delivered=46656 deliverable=46848). Jeder Zyklus: Drain setzt eine FRISCHE Marke ('sgl-project#1068 PREFETCH DEFERRED reason=store_prefix_short attempt=1'), der Retry gibt den Read neu aus, das 'issued' raeumt die Marke als LANDED ('sgl-project#1068 PREFETCH LANDED after_passes=1 verdict=issued'), der Read endet wieder kurz. Der Fortschrittszeuge (_weg2_note_prefetch_progress) laeuft nur auf einer Marke, die eine zweite Beobachtung erlebt -- also nie; das X-Gate hielt den Request (X-DEFER bound_s=inf) bis zum DEADMAN BUSY-STARVED der Front (00:13:12Z). Kein Schreiber war unterwegs: P schlief, und D's eigener Vorturn weg2-13-41 hatte am Ende keinen rekurrenten Zustand behalten (sgl-project#1469 RETAIN is_finished=True cache_len=None value=False). Fix (Schranke, kein Schalter): _weg2_store_short_fallback zaehlt je Request die FRISCHEN store-short-Marken, deren geliefertes Praefix nicht gewachsen ist (am Request, also vom Raeumen der Marke unberuehrt; Paesse, keine Sekunden -- jeder Rang markiert im selben Pass aus dem gruppensynchronen Record; waehrend D schlaeft zaehlt nichts, xsn344). Ueber SGLANG_WEG2_STORE_SHORT_MAX_CYCLES (Default 4): Rest <= X (oder kein X-Riegel) -> Marke weg, Request zur Zulassung mit dem gematchten Praefix, D extendet den Rest, Zeile 'PREFETCH-DEFER-FALLBACK ... reason= no_writer_progress'; der kurze Record setzt danach keine neue Marke, bis ein Read MEHR liefert. Rest > X auf dem Fensterpfad -> benanntes W88 (reason=over_x), wie der Zeuge selbst. Unabhaengig vom xsn437-Schalter (NF-Profil store_short_tail aus). Test test_weg2_store_short_fallback_rc12y (5, Metallzahlen 46850/46656/ 46848, X=12288): 4 rot auf ce041f0 (50 Zyklen 'deferred', der Livelock), gruen mit Fix; wachsender Read wartet weiter (gruen auf beiden).
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 28, 2026
…-Views bei jedem Re-Shape neu -- sonst toetet der sgl-project#760-Guard ein legales Backup in die sgl-project#249-gewachsenen Zeilen Tod D TP1+TP2 06:24:47 (boot_weg2_dkrnfh91dprsavisbar1dauer09280609, D-Log Z. 132586ff): 'KvTransferShapeMismatch: sgl-project#760 ... dst indices out of bounds: max=365887 >= capacity 353600' im Backup der fertigen weg2-0-14 (sgl-project#1469 RETAIN token_ids_len=62091); TP0 danach nur Gloo peer-closed. Wurzel mit Zahlen: 13 s vorher (Z. 128505/128506, 06:24:34, TP1 und TP2) 'sgl-project#249 BYTELESS-GROW pool=MHATokenToKVPoolHost rows 353600 -> 436032 (+82432)'. 365887 = 353600 + 12287 liegt im gewachsenen Bereich -- eine gueltige, vom Worker selbst vergebene Id, kein fremder TP0-Platzhalter. _regrow_byteless_buffer baut kv_buffer in der neuen Groesse, aber k_data_refs/v_data_refs/k_data_ptrs/v_data_ptrs waren einmal in __init__ geschnitten und sahen weiter den alten 353600-Zeilen-Puffer. Der sgl-project#760-Guard liest die Host-Kapazitaet (layer_first) genau aus k_data_refs -> 353600 -> Tod vor dem byteless-Return, obwohl nichts kopiert wird. Jeder Form-A-Worker, der unter R12 ueber die synchronisierte Groesse waechst, stirbt so beim naechsten Backup. Fix: _bind_data_refs() -- eine Bindung von Views und Zeigervektoren, die __init__ und jeder byteless Re-Shape (Wachstum und clear() zurueck auf die synchronisierte Groesse) benutzen. Keine Belegungsaenderung (slot_used, free_slots, size unberuehrt), kein Schalter; der Guard bleibt scharf fuer Zeilen jenseits des gewachsenen Id-Raums. Test test_byteless_grow_rebinds_refs_760 (4) aus der Metallform (353600 Zeilen gehalten, alloc 82432 -> Wachstum auf 436032, Backup der ersten 12288 = max 365887): auf 0eb7829 3 rot mit exakt der Metallmeldung 'max=365887 >= capacity 353600', gruen mit Fix; der Fremdzeilen-Fall (Zeile 436032) stirbt auf beiden Seiten benannt.
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
…-Resume-Klemme, K1 P-End-Anker hinter Schalter) -- PREFILL-EINBRUCH-0929 NF z30u (4f23714, Front-Log ..._0929_065429): 77 LONG geroutete Folgeturns prefillten < 2k neue Tokens auf P (Median 402 auf 49 792 Treffer, PP0 ~250 tok/s = H118-Sockel); 69 davon trafen exakt eine P-END-ANCHOR/MAMBA-ARENA- Tiefe, die VOR dem Urteil im Store lag. Der X-Preis kannte sie nicht. K2 (Fehler, immer an): ein geparkter und wieder aufgenommener D-Leg-2 meldet prompt_tokens == cached_tokens == behaltener Praefix inkl. dekodierter Tokens (weg2-2-7: tokens_front=21601 tokens_d=21760, 'WEG2-D-PARK RETAINED 21761 of 21987'; 73/73 match=0 des Boots sind D-Park-Resumes). Der Eintrag reichte damit ueber seinen eigenen Text hinaus, PX gab jedem Folgeturn 0 (weg2-6-13: credit=0 -> LONG, P prefillte 1283 auf 21568 Store-Treffer). Fix: TokenSpans.record_presence klemmt eine Messung, die ueber den eigenen Text reicht, auf dessen End-Anker (Seitenboden, P-END-ANCHOR / D sgl-project#1469 RETAIN); eine Tiefe innerhalb des Textes bleibt. Zeile 'WEG2 PRESENCE-OWN-TEXT-CLAMP', Zaehler presence_own_text_clamped. K1 (Schalter SGLANG_WEG2_ENABLE_P_ANCHOR_PRESENCE, Default aus): der Zeuge war beim Urteil noch nicht fertig (47 der Faelle; sgl-project#59 A: in Flug = 0; sgl-project#1324: P-Leg-1 speist nichts). Beim ersten Inhalt eines after_p-Leg-2 -- D hat von P's End-Anker aufgenommen, der Publish ist also fertig und gelesen, nicht der Write-Through im Flug, den sgl-project#1324 (weg2sn6s, W31->W50) verweigerte -- wird page_floor(P prompt_tokens) als Store-Praesenz eingetragen, epochenfest; ein sgl-project#59-A-Deckel darunter wird auf den Anker gehoben, nie darueber. Zeile 'WEG2 P-ANCHOR-PRESENCE'. A/B gegen W50-REROUTE. SGLANG_WEG2_FRONT_ANCHOR_PAGE (64, Store-Seite sgl-project#107) = Ankerkorn. Tests: test_weg2_price_store_anchor_0929 (8): 5 rot auf cb98c3d, 8 gruen mit Fix; Kontrolle ohne Park + PX-Divergenz + Tiefe im Text gruen auf beiden. test_weg2_front_x_exact: Zaehler der Reprice-Aufrufe 3 -> 4 (neuer Aufruf hinter x_exact). Nachbarn je Datei einzeln auf Basis und Fix: 0 neue Rote (5 Sammelfehler 'Invalid device id' ohne sichtbare GPU und 5 Altlasten in s3s4/sched_fix3 identisch auf beiden Seiten).
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Oct 2, 2026
…e D-Leg-2 kreditiert ihren End-Anker, auch ueber den D-Schlaf NF boot dkrnfint4bar1dauer10020634 (5b46b88), nextflash row agent_span=0: a FINISHED D leg 2 was credited only with its admission hit (record_presence dropped prompt_tokens/held_epoch). weg2-26-44 served 06:42:29,440 pt=53748 ct=50688 depth 53760; 44 ms later weg2-26-45 (SESSION-PREFIX common=53748) 'X-EXACT-PRICE pending=4582 credit=50688' > X=3647 -> LONG, P prefilled 1510 on a 53760 hit. weg2-24-40: credit 45824 (24-39's ct), 4339 > 3602, P 2291. (1) Same epoch: the nextflash row runs sgl-project#49 (form.py agent_span=True; released by the NF seat). Its premises hold on NF: the Flash-Next template renders <tools> first (chat_template.jinja 57-67), D sends weg2_resumable_depth on every finish (sgl-project#59 RESUMABLE mode=form-a-dcp-min). A served leg then holds min(prompt, D's depth) for its epoch (src=d_served_epoch): 26-45 credit 53696 pending 1574, 24-40 47808 / 2355 -- both SHORT. (2) Across epochs: the sgl-project#49 epoch guard protects the radix-only tokens past the anchor. With a sgl-project#59 depth the credit is min(prompt, depth, page floor) and survives D's sleep as a store load (src=d_served_anchor): in this boot 14 of 14 follow-ups after a D sleep read >= that anchor (26-45 P hit 53760 >= 53696, 27-46 55232, 64-104 on D 88336 >= 85888), 0 ANCHOR-LOST. The load is not priced: the LONG path loads the same prefix (P store read, D LOAD-DEVICE after the hand-off), X is a prefill bound. Without a depth the epoch guard stands. ANCHOR-LOST now also matches D's unclamped depth (TokenSpans.raw_depths; the K2 clamp had hidden it). (3) d_inflight (fceeda8) only for after_p legs (P's END-ANCHOR, realised): a prompt D prefilled itself anchors on its prefill track, 8 of 54 in-flight 'sgl-project#1469 RETAIN value=True' were below the page floor (weg2-4-7 19509 -> 17728); its finish reading covers it. Replay of the boot (25 LONG with real P prefill <= X): finished-same-epoch 9, cross-epoch 5, in-flight after_p 4 (attributed in that order; alone 9 / 8 / 11) = 18 SHORT. Tests: test_weg2_x_credit_finished_1002.py (11; 8 red on base: 26-45, 24-40, row, cross x3, no-depth guard, ANCHOR-LOST raw depth). Pins updated: agent_span profile rows (nextflash on), sgl-project#59 held-cap pin (outside the epoch 640 d_served_anchor), H61/H61b read the booked entry instead of SpanLRU.span_tokens (a chars/3 reader under sgl-project#49). Front-importing suites A+B (171 files) under the nextflash form: base 8+23 failed, fix 8+23 failed, 0 new reds (the 21 x_credit tests red on base only); no form: 507 passed.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Oct 14, 2026
…fore it evicts NF h14 ba1d5be (boot 1014_144540), D TP0 14:50:53, weg2-0-3 (lane 0, 83239-token price): TP0's own gate passed and H105d made this rank's load-back room BEFORE the token cut's gather -- 'sgl-project#1469 EVICT node=43/42/38/37/36 backuped=True host=True' freed the device copy of weg2-2-20's 163k session -- then a worker's own pool gate refused ('H105 RU FORM-A-DCP WORKER-GATE rid=weg2-0-3 host=ADMIT worker=1 code=NO_TOKEN price=83239 budget=33536') and the request stayed queued. The session's next turn weg2-2-21 found its prefix host-only (price 167776) and wedged D for 317 s (PW-W, a2cfc77, is the net). H105f: _h105d_cut_load_back_room(evict=False) is a DRY vote (need <= available + payable: may this rank make the room?); the gather decides; only on the group's ADMIT does every rank evict its shortfall and a second gather confirm the room (a rank whose peel fell short votes NO_TOKEN there, the request stays queued on every rank). Both gathers are entered alike: the first's verdict is the group's, the switch and the installed token cut are group-uniform. Off the token cut nothing changes (H105d is a no-op there). SGLANG_WEG2_H105F_VOTE_BEFORE_EVICT=0: the old order. Also: rank_role SEAMS F14 anchor hicache_storage.py 5157 -> 5352 (line drift from the 14.10. L3-fill commits; test_the_f13_anchors_hit was red on the line). Tests: test_nf_form_a_cut_load_back_room_h105d (2 new: a worker's refusal leaves the host tree untouched / switch off = old order; gather counts updated to vote+confirm), test_nf_form_a_cut_chunk_room_h110 (gather count), backup_wall_payable_int18, admit_room_first_h98e, cut_kv_only_follow_h105e, form_a_dcp_s3d_239: 42 passed.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Oct 19, 2026
… idle prefix NF rc17 (7d93470, boot 1019_171636) D.log from 32274 (17:28:28Z): every end event read "end event: live pages up to 405056 hold S9 (wanted S8)" (up to 418176; rc16 263x) while used 278k-383k fit S8 = 393216. The pages above the boundary were the finished turns' prefixes the tree retains (sgl-project#1469 RETAIN / sgl-project#59 RESUMABLE, 86-98k tokens), idle and backed between turns; max_live_page counted them like a request's page. S9 cost the 3080 ranks 6-10 expert seat rows (misses/forward x2.2-2.4 on TP1/TP2; S9 vs S8 bs4 +14 %, bs3 +10 %). Fix (default on, no switch; the 30.09. product rule of d_seat_compact: "KOMPAKTIEREN, nicht verdraengen ... Verdraengen nur als Rueckfall ... nie einen ungesicherten Zustand verlieren"): - pdflip/d_kv_compact.py: survey (live pages above the boundary -> tree node, one D2H copy, tensor ops), plan (un-backed first, backed MRU-first into free pages below; a backed leaf without room is evicted -- host copy stays; a page outside the tree or a pinned node (lock, write-through, load-back, shared page) stops the plan, all or nothing), execute (evict, claim, copy, sync, re-point the node's token ids with offsets kept, free the sources; transactional). - d_seat_vram.KvPageCopier: moves a page in every born KV tensor (FA K/V or the DCP owner share, QSA compressed keys, draft K/V) by the geometry the stage form unmaps it with; KV buffers outside _KV_BORN refuse the move. - MemSched._shrink_to: a floor blocking a decided shrink goes to the compactor first (also on a pending shrink at an end event). - runtime_tick: group verdict MIN over the candidate stages, moves-only first, evictions only as fallback; floor re-read; a refusal waits for the next end event (one survey per decision). Installed only on the unified tree (config). Tests (serial, systemd-run MemoryMax=2G): - test_s77_kv_compact_s9_hold_1019.py 19 passed; on 7d93470 the metal test is RED with "end event: live pages up to 405056 hold S9 (wanted S8)". - pdflip D suites + scheduler_soll + seat_compact + s77: 884 passed; the 11 failures are identical on 7d93470 (launcher dry-run / activation ring / norecompute_1002[True] order effect).
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.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Oct 21, 2026
…cked leaf; a W3 room spill that released nothing is not walked again until the arena/tree changed (nf-rc29-pphase-1021 W-D/W-C, user 15.10. "volle Arena ist keine Ausrede") SPECIMENS (P.log boot_weg2_dkrnfint4h6ablxcw3spmlrhlvwflbar1dauer10210232_893d09fa3f_1021_023225.P.log): (a) OVER-EVICTION, 6x. - PP0 18254 02:37:15 SF LOADBACK-ROOM SAME-PASS rid=pdflip-0-19 kv_tokens=113408 floor=85760 avail=85760 evictable=243648 evicted=165632; PP1 18600 02:37:22 LB-VERDICT ROW-ROOM rid=pdflip-0-19 kv_tokens=113408 avail=85888 evictable=419520 evicted=165632 (PP2 18738 the same). - The DEMAND is right: pp_slot_fidelity.local_pp_room and pp_loadback_verdict.row_room both call tree.evict(num_tokens=min(kv_tokens - avail, evictable)) = 27648 (PP1/PP2: 27520). - The peel paid 14272 from the dropped 0-22 tail, then reached the BACKED node 9 (PP1/PP2: node 18), 151360 tokens ([18880,170240)), and _evict_to_host demoted it WHOLE: PP0 18252 / PP1 18598 / PP2 18736 "sgl-project#1469 EVICT node=.. backuped=True host=True". 14272 + 151360 = 165632. ROOT: node granularity in FullComponent._peel, not a demand error. 137984 backed tokens left the device for nothing (every later hit on that prefix pays their load-back). (c) REFUSED PUBLISH ROUNDS ON THE FOLLOWERS' SCHEDULER THREAD. - PP1 18488/18489 02:37:20 RETAIN-PUBLISH rid=pdflip-0-17 {'unbacked': 21, 'issued': 0, 'refused': 21, 'memo_skipped': 8, 'arena_full_skipped': 20, 'refused_by': {'arena_claim': 1}, 'issue_ms': 497.6} retain_ms=500.9 - PP1 18507/18508 02:37:21 rid=pdflip-0-20 refused=21 arena_full_skipped=20 stopped=budget issue_ms=826.5 retain_ms=829.5 - PP2 18561/18562 rid=pdflip-0-17 issue_ms=524.9 retain_ms=529.0; PP2 18605/18606 rid=pdflip-0-20 issue_ms=823.2 retain_ms=826.9 (the #PGAP process 1361/1397 ms of the pphase report) - PP0 17755/17756 rid=pdflip-0-22 the same shape: issue_ms=100.3 retain_ms=104.6. - ROOT: 20 of 21 nodes were SKIPS (no claim) and still cost ~20-36 ms each: the skip's room question _pdflip_full_arena_refuses first runs _w3_arena_spill, and on a follower the W3 room-set spill (_apply_new + _own_only -> _candidates: _collect_all_nodes, keep-payable walk, arena header read for the order) walks the whole tree EVERY time with the same answer 0. PP0 has the 0.5 s empty backoff (backoff_ok is decider-only); the followers have nothing. FIX (a) pdflip/evict_fit.py, FLLIPER_PDFLIP_EVICT_FIT (default on). In FullComponent._peel_heap, before a backed device leaf is demoted, a leaf longer than the remaining need by >= one page is split with the insert path's own UnifiedRadixCache._split_node at len - ceil(need/page)*page; the node object (KV/host tail, mamba anchor, every pdflip attribute) is the demoted tail, the head stays on the device with its host rows. Only a node backed for its whole length, unlocked (device and host), no write in flight, complete page hashes; else whole as before. Local-PP floor only (the tree is this rank's own; W3 decides on arena slots, never node ids); TP groups / Form A (R12 node keys) unchanged. Instrument EVICT-FIT SPLIT (node, tokens, need, keep, tail). (b) unbacked nodes: UD-LAST (9b5da59) unchanged. With (a), pass 2 fires only when the backed leaves cannot pay the need even split to the token; at the metal numbers (need 27648, 78016 evictable left, of which node 21 = 44288 un-backed) it would not have fired on PP0 if the other 33728 were backed -- not provable from the log; UD-LAST DROP-AFTER names it on metal. Pass 2 also uses the fit on the backed parent after a drop (13376 instead of 151360). (c) pdflip/spill_memo.py, FLLIPER_PDFLIP_SPILL_STATE_MEMO (default on). In _w3_arena_spill's W3 room-set branch: a spill that released 0 and is not UNDECIDED (PP0 waiting for an ack / a follower's transient debt -- resolved by acks, never memoised) records the state it saw: arena free/COMPLETE/referenced slots + sum of references, the W3 set generation this rank applied/published, its debts, the tree's evictable/protected tokens and leaf counts. The next spill at the SAME state returns 0 without the walk; any changed term walks again. No timer, no wait, no file I/O (the arena header is shared memory). Set application keeps its own paths (tick, the claim's apply_if_new). Instrument: PUBLISH-SWEEP / RETAIN-PUBLISH stats spill_walks, spill_memo_skips, spill_ms (W3 spill walks of THIS sweep and their scheduler-thread ms), SPILL-MEMO SKIP lines. Expected on the specimen: 1 walk instead of 21 per retain publish on PP1/PP2. Rank agreement: nothing new is decided. (a) acts where eviction already is each stage's own (SF), with the same deterministic rule on every stage; (c) skips only a rank's own walk whose inputs did not change. TESTS (serial, systemd-run --scope -p MemoryMax=2G, CUDA_VISIBLE_DEVICES=""): - new test/registered/unit/mem_cache/test_evict_fit_spill_memo_1021.py 11/11, on a REAL CPU UnifiedRadixCache (conftest CPU get_device): 200-token backed leaf pays need 30 with 30 (head 170 stays, with host rows); switch off / group floor -> 200; metal chain scaled (backed 151 <- unbacked 14, need 27): pass 2 drops 14, the fit demotes 13 -> 27 (was 165); + a backed leaf elsewhere: nothing dropped, exactly 27 from it; guards (partly backed, host-locked, nothing to keep). Spill memo: 20 identical calls -> 1 walk, 19 skips; each of free/unref/new set/lock/leaf change walks again; undecided and released>0 never memoised; switch off walks every time. - mutants: MUTANT-A (fit never splits = "more evicted than needed") 4 red ("200 != 30", "165 != 27", "40 != 27"); MUTANT-C (memo never answers = "refused attempt repeated without a state change") 1 red ("20 != 1"). - related suites (53 files, serial, same command): 538 passed. 51 files green, incl. test_ud_last_arenafull_1021 7, test_pdflip_unbacked_drop_eb_rc12q_0927 7, test_pdflip_f1_w3_room_set_1016 27, test_sweep_full_arena_skip_1007 13, test_w3_arena_spill_0929 5, test_w3_arena_spill_forma_dual15_0930 4, test_w3_spill_group_order_1014, test_w3_spill_host_leaves_int22_1008, test_pdflip_read_room_d_1015, test_pdflip_l3_complete_only_1016, test_s83_*, test_k23_*, test_s22_r12_spill_class_1018, test_s109_backup_wall_aux_leaves_1020 46, test_review_s108_s109_1020, test_evict_demotion_703 11, test_evictable_deliverable_rc12o_0927 15, test_host_tier_contiguous_backup_841 9, test_pdflip_pp_slot_fidelity_b23_0927 27, test_pdflip_pp_room_vote_int19_1008 16, test_pdflip_pp_loadback_verdict_1014 9, test_pdflip_k15_evict_anchor_save_1016 20. test_rereview_s109_a5a8_1020: 1 red in the run (q1_a5, "8 == 2*8", a write-behind timing probe; other agents' pytest runs were active on the rig), 3/3 green on rerun -- untouched code. Pre-existing on the base a773b4e (checked for 9b5da59): test_pdflip_arenafull_1015 2 failed / 49 passed.
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.
FlashInfer requires seq_len to be 0 during cuda graph capture. Otherwise, it will raise illegal memory access sometimes.