Repository navigation
PrefillAdder abstraction - #968
Merged
Merged
Conversation
Ying1123
approved these changes
Aug 7, 2024
Closed
timethink
pushed a commit
to timethink/sglang
that referenced
this pull request
Mar 9, 2025
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 28, 2026
…and PP0 names it Boot 3 of window-flip-0828: after a sgl-project#797 void the follower holds a sgl-project#971-parked chunked continuation in self.chunked_req (never in any queue); PP0 cannot see it, its uniform cap is MIN-reduced before occupancy is loaded, and the void's requeue tail-rotates PP0's copy so it never reaches a seat. The follower's add_chunked_req appends its continuation unconditionally, so every forwarded schedule is illegal on the follower: 514 refusals (191 missing + 323 'admitted rid(s) the decision does not name'), 512 voids, sgl-project#801-spin guard death in 2 min. Fix, the register's named sgl-project#968 direction -- the fact rides EXISTING messages, no new wire, no collective: (rid, executed_len) of a parked continuation is stamped on (a) the per-pass decision downstream and (b) the output/void return lap homeward. Named deviation from the design brief: the ring is asymmetric (the last rank sends output DIRECTly to PP0, so a middle parker never gets onto the output lap alone) -- hence both messages, and facts are MERGED per hop, never overwritten, or a middle rank's fact dies one hop before its consumer. PP0 absorbs before the admission loop, REORDERS its own waiting_queue so the ordinary loop admits the rid (reorder, never admit: no second admission authority, no seat pricing -- once named, the continuation is a cap-counted member on every rank: no extra, no missing), and clears the fact when a decision names the rid (self-correcting: the next lap re-stamps if still parked). No prefix is ever reduced (Kein-Doppel- Prefill); all seven helpers module-level (holder lesson, test-pinned). Single-slot hypothesis CONFIRMED (double-sourced): chunked_req is one attribute, overwritten per truncation and cleared on launch -- PP0 cycles it (518 admits / 7 rids, the stuck rid named 2x), the follower pins it (514x). That is why the carry must exist. Tests: test_pp_parked_continuation_carry_968.py, 21 tests -- red-first GENUINE against the unmodified pin 3c470fb in a detached worktree: 18 failed / 3 passed (names == summary 18==18), 21 passed on the fixed tree; legacy arm byte-identical without the stamp; no-double-prefill arm asserts zero prefix reduction; can-fail arm neuters the absorb. Gate: 42 modules BEFORE/AFTER byte-identical 510P/9F, the 9 pre-existing name-identical both sides (prefetch_symmetry_580 7 + ring_commit_973 2 -- the 973 pair is the known gloo hang-shape arms, reproduced solo on the unmodified tree; environmental, posten noted).
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 28, 2026
…w speaks Boot 4 proved the sgl-project#968 carry chain worked L1-L3 (absorb ran 514x) and failed at L4 ACT, twofold: the act permutes only waiting_queue, where a parked continuation never lives, and PP0's copy was DROPPED at the cross-slot void restore -- self.chunked_req is ONE field, the per-slot restores write it back to back, last slot wins, and the clear at the old :8382 justified itself with a claim ('re-admitted from the waiting queue') that is false for continuations by this file's own rules. Live witness: boot 4 line 408 clearing 4077b704, one of the 107 missing-rids; 407 of 514 refusals were the parked rid as an unnamed extra. Fix at all four unguarded void writers (:8729/:7449 rehome-before- overwrite, :8823/:7486 requeue-on-clear, checked not asserted: only a healthy parked continuation not already reachable, not finished, never reset -- reset shapes are the disposal loop's, which releases AND queues in one act). scheduler.py:9506/:9545 untouched (exonerated: preempt requeue / assert-guarded mint). ACT unchanged; its docstring's false premise and two dead citations are kept as a NAMED retraction plus the real requeue sites. Writer census: 11, four now guarded, seven sighted clean and listed in the helper docstring. Reachability (CPG/call-graph, standing order): every new site closes at _event_loop_pp_body (:3200 -> :8982 absorb -> :8729/:8823; :3200 -> :3415 own-void -> :7449/:7486; :3430 -> :7745 -> twins); ACT via get_next_batch_to_run:6962 -> scheduler.py:9130. Instruments (standing order, 22 lines, rate-limited first+64th, zero cases PRINTED): sgl-project#968 MINT/FORWARD/ABSORB/ACT (ACT carries carry>0- front=0 with an explicit NOT-REACHABLE clause -- the line that names boot 4 in one pass), sgl-project#968 PARK + sgl-project#971 REHOME-ON-REFUSAL in both previously-silent park actuators, #968b REHOME-ON-DISPLACE / REQUEUE-ON-CLEAR, and #791b/#797d now print released=/kept=/displaced= rid lists (all 514 boot-4 void lines were rid-free). Test evidence (desk, built before the tests-off-critical-path order landed; the boot with instruments is the acceptance): test_pp_continuation_cross_slot_rehome_968b.py red-first GENUINE 22F/9P at b070296 -> 31 passed; 10 neighbouring modules green (968 21, 797 31, 971 25, 798 7, 631 6, 801 14, 973 5, 962b 8, 974 11); one honest update: 797:1578 asserted 'dropped, not retracted' -- the exact belief this commit refutes.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 28, 2026
…nstead Boot 5's third continuation-loss exit was #968b's own gate: the park-shape equality in pp_rehome_displaced_chunked_req refused the UN-parked mid-plan occupant (end=7939 prefix=4096, named verbatim by its own 'sgl-project#968 MINT none' line), returned None, and the caller's next statement nulled the live occupant -- a drop, not a release. The fix that closed the cross-slot displacement carried the class it closed: a predicate assumed where pp_chunked_req_is_reachable already tests. Evidence chain one second wide in the boot-5 slice (R6, double-checked): ADMIT 8192,4096 -> MINT none (last provable hold) -> next line's void restore with chunk parked=False + displaced=None -> rid never on PP0 again; 514 refusals, PP1 spinning 323x on the unnamed extra it took over via the sgl-project#971 route. Fix: the un-parked shape is PARKED first (_park_chunked_prefill_chunk, void-default pass_allocated=True -- its pass was built, so KV rows and the inflight increment are owed back), then falls through to the SAME reachability+queue junction as the parked shape. Zero cached tokens discarded, nothing reset. Parker-side alternative rejected: retiring the orphan discards 7939 tokens against the one-chunk law and treats the spin instead of the drop. Instruments: the formerly-ambiguous displaced=None (empty field vs refused occupant were indistinguishable) disappears for a present occupant -- 'sgl-project#968 PARK route=void-give-backs' plus REHOME-ON-DISPLACE now fire at exactly the line boot 5 went silent. Execution proof (standing order): the strongest available -- boot 5's own log shows this exact line running 514x (every ACT NOT-REACHABLE pass traversed the refusing gate); reachability is measured, not argued. Import smoke green; suites live in the parallel test-agent lane per the tests-off-critical-path order.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 28, 2026
… is a no-op on the real path The self-audit of window-flip-0828 found the harness supplying the delivery it tested: _pp0_pass builds pp0.waiting_queue out of queue_rids and so manufactures the queue membership the production defect never satisfies. Three arms rested on that premise while their names claimed delivery. The premise is retracted where it was made, not deleted: _pp0_pass now carries its limit of validity, Arm1 carries its scope, and the arm that claimed 'pp0 names it within one pass' is renamed to say GIVEN queue membership. The file's own header already said the opposite four hundred lines up, and so does the shipped code twice (scheduler_pp_mixin.py:2563-2565 and :798-802) against the act's docstring at :1757-1759. Arm6 states what actually happens on the defect path, without the falsifying helper: the fact arrives over the real lap, and pp_parked_continuation_priority still returns the empty tuple because the continuation is in no queue -- plus the silent empty-queue early return that kept 259 of 468 boot-4 passes out of the log, plus a fence against ever teaching the act to admit out of the carry table (DESIGN_679 §4 rule 1). Green before and after the #968b fix by design: that fix re-homes the continuation upstream and leaves the act unchanged. Test: CUDA_VISIBLE_DEVICES= PYTHONPATH=<worktree>/python pytest -p no:randomly test/registered/unit/managers/test_pp_parked_continuation_carry_968.py -> 24 defs / 24 passed in 9.20s (count probe: 24 == 24), at b070296.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 28, 2026
… its seat too Boot 11 (aae7e3b) reached 3m47s -- sgl-project#991 held, no AttributeError -- and died on `sgl-project#801-spin PP IDLE-VOID LIVELOCK REFUSED` (pp_rank=2, 512 consecutive voided passes, scheduler_pp_mixin.py:8214). The guard is right that the defect is not on rank 2. ROOT. Uniform membership -- "a rank executing a forwarded schedule may admit only what the decision names" -- is enforced at scheduler.py's `pp_not_named` skip for every candidate that comes out of `waiting_queue`, and NOWHERE for the one candidate that never appears in a queue. `add_chunked_req` runs ~250 lines earlier and appends `self.chunked_req` unconditionally, before the decision is consulted at all. MEASURED, 512 byte-identical rounds (21:27-21:31): rank 1 held rid 8a330526c7b9410f963232874adc451b at executed=3332 as its parked continuation, in NO queue on ANY rank, so rank 0's decision could not name it. That site gave it the seat; the decision's own rid (dfd22a9a… / 9528ff20…) could then not be reached; `sgl-project#791 FORWARDED SCHEDULE UNEXECUTABLE` voided the pass; `sgl-project#971 REHOME-ON-REFUSAL` put the continuation straight back into `self.chunked_req`; the next pass was identical. Rank 2 voided every pass behind it until the bound fired. THE CLASS: a compensator that restores the precondition of its own trigger. The cut therefore belongs upstream of the rehome, at the admission -- fixing sgl-project#971 would only move the latch. FIX. At the one junction, gate `add_chunked_req` on the same membership test the queue loop already applies: when this rank is executing a forwarded schedule that does not name its continuation, refuse the SEAT. Not a drop -- the precedent is the sgl-project#906 gate immediately below it: the request stays `self.chunked_req`, keeps prefix, pages and mid-chunk position, and resumes on the first pass whose decision names it. PP0 has no incoming decision, so `incoming is None` there and the default path is byte-identical. SIBLING SWEEP: the two candidate sources into `can_run_list` under a forwarded schedule are the queue loop and this one; the queue loop was already gated. `_note_skip("batch_full_break")` and `pp_not_named` are the two symptoms this produced in the census and both are downstream of it. WHAT THIS DOES NOT CLOSE, stated rather than assumed: sgl-project#968's half. sgl-project#968 makes the parked-continuation fact ride the return lap so PP0 CAN name such a rid, but its actuator `pp_parked_continuation_priority` only REORDERS PP0's queue and is a no-op exactly when the rid is in no queue on PP0 -- which is this specimen. The new log line prints the rid, its executed extent and the decision's full name set, so boot 12 MEASURES whether the continuation ever becomes named instead of leaving it to inference. Evidence: desk. py_compile + import smoke. Belegstufe: DESK-BEWIESEN.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 28, 2026
…ter a boot Commit 7398727 published two predictions. The second one was wrong, and it was wrong at the time I published it -- its author withdrew it before the boot ran and I re-checked the withdrawal against the log myself. It stands struck through rather than deleted: a published prediction may not quietly vanish. WHY (b) IS FALSE, three ways, all in the specimen: * The refusals' actual cause is printed one line ABOVE each of them: :2033 (PP1) and :2044 (PP2), 'sgl-project#992 CHUNKED CONTINUATION NOT NAMED rid=da614e20 executed=7939 decision_names=5689567b'. That is the sgl-project#992 asymmetry -- the followers hold a resident the decision does not name -- and no false last_chunk is involved. * :2028 'sgl-project#968 MINT none rank=0 rid=5689567b end=4096 prefix=0'. It was a genuine MIDDLE chunk, so last_chunk=False was correct. Cut C carries the same verdict and the refusal fires unchanged. Two stays two. * :2120 'local=8446 -> upstream=8447 appended=1'. The follower is SHORTER and the adopt raised it, which is the covered direction. Site #0 needs the executing rank LONGER. That never happened in this boot. So Site #0 is desk-proven as a defect, has ZERO boot-observed instances, and contributed nothing to Boot 16. Cut C fixes a LATENT defect and the next boot can neither confirm nor refute it -- which matters operationally, because anyone watching for an indicator there is watching for one that cannot come. Exactly one prediction now rides on the boot: the sgl-project#631 leftover SURVIVES. And the class section is corrected rather than left flattering: the two seams do NOT carry the same evidence tier. D1 (:5330-5331) is boot-proven at the symptom; Site #0 (:1433) is desk-proven with no instances. Two independent finds still argue the class better than one, but the class is carried by the metal-backed half, and writing it otherwise would inherit exactly the overclaim the indicator law exists to forbid. The error form is recorded too, because it is not a foreign one: an event that FITS a mechanism was read as BEING that mechanism, without reading the line above naming the alternative. Twice, and both times the refutation was one line higher in the same log. Same shape as the dead ratchet in sgl-project#996 and the false guard hint in sgl-project#997. The cheap counter-check is the same in all three and costs seconds: read the line above.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 29, 2026
Three carriers were checked for an enrichment and all three fail: no rid-precise log exists after `req.output_ids.append`, `sgl-project#968 MINT` sits in the parked-continuation fact ring rather than the result path, and `sgl-project#788` fires at ADMISSION where `out_len` is structurally 0 (measured, boot 38). A new emission is therefore the only option, not a convenience -- and it is a STATE reading, not a timing signal, the same distinction that carried `published_fundable_floor`. WHAT IT MEASURES. extend = min(fill - prefix, cap). Three terms are settled: cap is group-uniform (sgl-project#610 pins each rank to the group minimum, measured identical at 12977) and never bound (4096 against extends of 253-278); prefix is equalised by the sgl-project#791 truncation, both branches. Fill is defined as `origin_input_ids + output_ids` with a rank-identical prompt, so `output_ids` is the single rank-local component of the whole equation -- and this append, in the RESULT path a voided pass never reaches, is the only place it grows. THREE CONSTRAINTS, each from a mistake made in this window: DENOMINATOR ALWAYS. seen/emitted/unreadable ride on every line whatever they are. A counter that only moves on confirmations is what made me quote a 12:1 neutrality basis that was really 10:5. FIXED CADENCE, NOT A HIT FILTER. "Emit only when interesting" cannot tell a zero from a never-evaluated -- the same shape that made boot 27 unreadable. Every 40th append, whatever it says. SENTINEL THAT CANNOT COLLIDE. `len(output_ids)` can legitimately be 0, so 0 and None are both unusable for "not read"; -1 is the sentinel and the message says so. `floor=unset` already saved one reading this way. THE DEATH FORM IS NOT A SIGNAL HERE, in either direction. Cumulative over 15 no-flip boots of this config: WIDTH=10, IDENTITY=5. At a one-in-three base rate a single flip is noise, and a single non-flip proves nothing. The only question this boot answers is what `out_len` says for the same rid on two ranks. Evidence: desk. py_compile; the format verified by rendering it through logging rather than by counting placeholders. Belegstufe: DESK-BEWIESEN.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 29, 2026
Boot 41 measured the first term of the decomposition and it is 1: output_ids differs between ranks by one, with PP2 -- the rank that samples first -- ahead. That is the normal pipeline offset, not a defect. The second term had never been measured, and the code says it exists. `fill = origin_input_ids + output_ids` holds only at the instant `_refresh_fill_ids` runs, and that runs from `init_next_round_input`, i.e. gated on THIS rank admitting THIS request. In the admission loop the refresh sits at scheduler.py:9487 and the rank-local skips lie on both sides of it: `already_in_batch`, `seam_transport_only`, `lora`, `batch_full_break` and the three `prefetch_*` skips all break out BEFORE it (:9415-9480), while `pp_not_named` comes after (:9533). A rank that breaks out early keeps appending while its fill stands still. So fill-divergence = output-divergence + refresh-timing divergence, and only the first was measured. This measures the second as `lag = len(output_ids) - (len(fill) - len(origin_input_ids))` -- exactly the `n_have_output` that `_refresh_fill_ids` computes at schedule_batch.py:1313, verified against that definition in the smoke. It is an enrichment of the probe added in #997d: same counter site (the DECODE append), same emission site (`pp_ring_note`, whose execution on this config is established by 594 lines across three ranks in boot 41), no new emission, one more field in a tuple that was already printed. FIFTH INSTANCE OF THE EVENING'S CLASS, and the first on the killing path. A rank-local predicate deciding a group-uniform quantity: Site #0, the hold actuator, the proxy send/recv boundary and the sgl-project#996 budget cap were desk-proven, indirect, or never bound. This one gates `full_untruncated_fill_ids` -- the quantity whose divergence the sgl-project#631 guard reports. AND IT MEETS A FILED POSTEN: sgl-project#968 has stood since 2026-08-28 as "divergence SOURCE: rank-local prefetch verdict under PP -- the prefetch-pending fact must ride the sgl-project#791 ring lap home". That prefetch skip is one of the two that gate this refresh. A design question parked "after the window" turns out to sit on the critical path; the fix cut should take it up rather than reinvent it. The prediction is recorded before the boot, both directions, and the lag will not be held against 47 whichever way it lands -- the question is whether the refresh timing diverges, not whether a number fits. Evidence: desk. py_compile on both files; the lag arithmetic checked against the :1313 definition on three worked values. Belegstufe: DESK-BEWIESEN.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 30, 2026
…fixt -- Hold-Text ehrlich gemacht; Abnahme-Menge komplett == WAS ICH ZUERST EINRAEUME == Der LEBENDE Zustand war weg, bevor die Freigabe kam: ich hatte den gestrandeten Prozessbaum per SIGKILL geraeumt, um Serving zurueckzuholen. Die py-spy-Stacks sind gesichert, Queue-/Seat-/Chunk-Zustand nicht. Geerntet wurde daher aus dem BOOT-LOG (das die Felder traegt), nicht am lebenden Prozess. == BEFUND, aus dem logindex-Ingest des Strandungs-Boots == boot_855_fix1027_0840f82601_0830_112900.log, 708.146 Zeilen, voll ingested. Ein sauberer Schnitt: ALLES Request-bezogene endet 11:57:55-11:58:07 (admission, admission_suppressed, prefill_batch/rank, output_fill, extend_invariant, hicache_io/round, flip_cutover/reconciled). NUR policy_hold, flip_event, collective_census und cohort_read laufen bis 12:04:5x weiter. Der Scheduler lebt; die Pipeline ist ab Admission tot. Im Strandungsfenster (ts > 11:58:10) gibt es GENAU EINE Hold-Begruendung: "decoding in tp" n=29, 11:58:17 .. 12:04:51 Gegenprobe: letzter Decode-Batch 11:57:45, NULL Decode-Batches nach 11:58:10. Die Policy hielt also 6,5 Minuten auf einer Begruendung, die einen Decode behauptet, den es nicht gab. == ABER: DIE POLICY IST SYMPTOM, NICHT URSACHE -- und das ist der Grund, warum hier nichts "gefixt" heisst == `phase_policy.py:3696` ist der FALL-THROUGH des tp-Zweigs. Er wird erreicht, wenn `work_exists()` False ist -- und `work_exists()` fragt AUSSCHLIESSLICH nach Prefill (`pending_prefill_tokens` / `admissible_prefill_tokens`). An dieser Stelle weiss der Code also: es ist kein Prefill geschuldet. Ueber Decode weiss er NICHTS. Der Hold ist damit die korrekte Antwort auf "mir wurde nichts angetragen" -- und PP0 stand passend dazu in `is_fully_idle`, der Detokenizer wartete gesund auf seinem Socket, der Client wartete auf RM-13. DER REQUEST IST OBERHALB DER PHASE-POLICY VERLORENGEGANGEN. Die Wurzel liegt im Request-Intake, ist NICHT lokalisiert, und ist damit >S/M und ein Kandidat der sgl-project#968-PP0-Familie -> MELDEN STATT BAUEN, wie beauftragt. == WAS GEBAUT WURDE: nur die Ehrlichkeit des Instruments == `_no("decoding in tp")` -> nennt jetzt den Term, auf dem der Zweig steht, und unterscheidet die zwei Faelle, die im Log identisch aussahen: running_bs>0 : "decode is in flight, this is a normal hold" running_bs=0 : "NOTHING IS DECODING EITHER; if a client is waiting, its request never reached this scheduler (sgl-project#1028)" VIERTE instrument-text-luegt-Instanz des Tages, und die einzige, die mich Zeit gekostet hat: die Zeile schickte die Suche nach einem haengenden Decode, den es nie gab. Detektion richtig, Erklaerung erfunden. Prior-Art-Gate gelaufen (rrf): naechste Verwandte sind sgl-project#962 (batch_is_full- Latch nach tp_to_pp), #888b D1 (Sitz von einem Residenten gehalten, den die Phase nicht fahren darf) und die Stranded-Decode-Surcharge-Commits vom 2026-08-15. KEIN Neubau abgeleitet -- die Wurzel ist nicht dieselbe. == ABNAHME-MENGE KOMPLETT, alle fuenf Packs auf oder ueber Referenz == toolcall-15 13/15 Ref 12 instructfollow-15 15/15 Ref 14 structoutput-15 14/15 Ref 14 dataextract-15 13/15 Ref 11 reasonmath-15 14/15 Ref 7 SUMME 69/75 Ref 58/75 RM-13, die Frage der Strandung, lief diesmal DURCH (96,7 s -- auffaellig langsam gegen die sonst ~20 s, aber bestanden). Deadman still. ZWEI SCHRANKEN, die das Ergebnis NICHT ueberschreiten darf: 1. Es ist KEIN Ein-Build-Durchlauf. Packs 1-3 liefen auf dem Stand VOR sgl-project#1027, Pack 4 auf dem sgl-project#1027-Stand, Pack 5 auf diesem. Keiner der beiden Fixes aendert Generierungsinhalt (greedy, gleiche Token), aber gemessen ist es ueber drei Staende, nicht einen. 2. DASS RM-13 durchlief, ist KEIN Beleg, dass sgl-project#1028 behoben ist. Ich habe einen LOG-TEXT geaendert, sonst nichts. Der Defekt ist intermittent und hat diesmal nicht gefeuert. sgl-project#1028 bleibt OFFEN. BELEG-STUFE: Lokalisierung BOOT-BEWIESEN (Ingest des Strandungs-Logs, Zeit- schnitt und Hold-Zensus). Wurzel NICHT bestimmt. Label-Fix DESK-BEWIESEN plus boot-gelaufen. Abnahme-Zahlen BOOT-GEMESSEN ueber drei Staende.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 30, 2026
…inert/unerreichbar -- die Suche zieht auf S1. Und die Inventur haelt am Pin NICHT. Fokussierter Durchgang auf den zwei einzigen als erreichbar+UNKLAR gefuehrten S0-Intake-Gates. Kein Schnitt gebaut: es gab nichts zu schneiden. == G-06 `drain_recovery_request` -- INERT, NICHT die Wurzel == Zeile haelt am Pin (scheduler.py:2860 in `process_input_requests`, ein resolved Caller). Der Code liest `RECOVERY_CHANNEL_ATTR` und gibt bei None sofort zurueck; den Kanal legt AUSSCHLIESSLICH der Watchdog-Post-Pfad an. Ohne erkannten Wedge ist das ein getattr und ein None -- die `waiting_queue` wird nicht angefasst. Empirisch am Strandungs-Boot (boot_855_fix1027_..._112900.log): Kanal NIE angelegt. WEDGE-RECOVERY genuine 0, RecoveryOutcome 0, Attribut 0. NEBENBEFUND, Lehrstueck fuer die sgl-project#995-Regel: 'recovery channel' zaehlt bare 31 / genuine 0 -- reine Prosa-Erwaehnungen. Ein blanker grep -c haette hier 31 "Treffer" gemeldet und das Gate faelschlich als aktiv ausgewiesen. VERDIKT: nicht die sgl-project#1028-Ursache. Und KEIN Loesch-Kandidat auf Kanal-Ebene: der Kanal ist die Thread-Grenze (Watchdog -> Scheduler-Thread) eines fork-eigenen Features, kein zweiter Datensatz der waiting_queue. Die Inventur-Beschreibung "Recovery-Request vor den Input-Strom injiziert" ueberzeichnet den gesunden Pfad. DESIGN-FORK, GEMELDET STATT ENTSCHIEDEN: das FEATURE Wedge-Recovery ist seinerseits eine Kompensationsschicht fuer fork-eigene Wedges, und das ist per Upstream-Minimal-Gesetz ein Loesch-Kandidat auf FEATURE-Ebene. Loeschen aendert aber nutzer-sichtbares Verhalten (ein gewedgtes Rig erholt sich dann nicht mehr selbst). Das ist ein echter Wert-Trade -> Operator-Entscheid. == G-04 Prefetch-Gruppenvotum -- UNERREICHBAR auf der Ship-Config == Die Inventur nennt scheduler.py:5085,5139. Am Pin steht dort etwas anderes (`routed_experts_start_len` bzw. ein Prefetch-Docstring). Ueber den EMITTIERTEN Literal statt ueber die Zeile relokalisiert: der Code lebt in `disaggregation/decode_hicache_mixin.py:152-197`, also im PD-Disagg-Pfad. Unser Boot faehrt `disaggregation_mode='null'`; der Mixin wird nur von `disaggregation/decode.py` verwendet. Marker `anchor_no_vote` im Strandungs-Boot: bare 0 / genuine 0. VERDIKT: auf dieser Form nicht erreichbar, also nicht die sgl-project#1028-Ursache. Die "decisive check"-Frage der Inventur (ueberlebt ein Konsument des Votums G-32?) ist auf der Ship-Config gegenstandslos; sie bleibt fuer die Disagg-Form offen. == META-BEFUND, der die sgl-project#968-Arbeitsweise betrifft == BEIDE von mir geprueften S0-Zeilen hielten am Pin NICHT: G-06 ueberzeichnet die Wirkung, G-04 nennt die falsche DATEI und eine falsche Erreichbarkeits-Spalte. INVENTAR-1003 steht auf `feat/969-deletion-cut @ 90c5adab2e`, einem fremden Branch, und ist einen Tag alt. Die Inventur bleibt wertvoll als Karte, WO zu suchen ist -- ihre Erreichbarkeits-Spalte traegt am Pin aber KEINEN Schnitt ohne Gegenpruefung. Fuer den restlichen sgl-project#968-Umbau gilt damit: jede Zeile wird vor einem Schnitt per emittiertem Literal am Pin relokalisiert und per Marker-Zaehlung am Boot-Log auf Erreichbarkeit geprueft, nie per Zeilennummer uebernommen. (Das ist die Determinations-Schnappschuss-Regel, jetzt mit zwei Belegen.) == FOLGE FUER sgl-project#1028 == Station S0 ist als Verlustort AUSGESCHLOSSEN: von sieben Fork-Gates sind drei strukturell unerreichbar (G-01/02/03), zwei lassen den Request per Verdikt ohnehin durch (G-05/G-07), und die beiden UNKLAR-Zeilen sind inert bzw. unerreichbar. Die Suche zieht auf S1 (ROUND ENTRY / Admission) weiter -- die Station, an der auch das Admission-Verdikt sitzt, das nach der sgl-project#968-Order zu PP0 gehoert. Damit faellt der sgl-project#1028-Einstieg mit dem Umbau-Kern zusammen, statt daneben zu liegen. BELEG-STUFE: DESK-BEWIESEN (Code am Pin) + BOOT-BEWIESEN (Marker-Zaehlung trapsafe am Strandungs-Log). Kein Boot ausgegeben, kein Code geaendert.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 30, 2026
…ONGRUENT ZUGELASSEN -- meine "nie angekommen"-Erklaerung ist FALSCH S1-Durchgang, Schritt 1. Die rid-genaue Timeline aus dem Strandungs-Log kippt meine eigene Diagnose, und zwar in die praezisere Richtung. == DIE TIMELINE (logindex, boot_855_fix1027_..._112900, voll ingested) == Nach 11:57:30 nennt das Log GENAU EINEN rid: 2fe8dab34ab1. admission n=18 11:56:14 .. 11:58:05 flip_event n=100 11:56:17 .. 12:02:21 Die 18 Admission-Zeilen sind SECHS Runden zu je drei Raengen, und JEDE ist "sgl-project#788 PP-ADMISSION verdict=ADMIT n_reqs=1 rids=2fe8dab34ab14d" auf Rang 0 UND 1 UND 2. Die Raenge waren sich EINIG. Letzte Zulassung 11:58:05; letzter Prefill 11:58:07; danach nichts mehr. Und der Flip-Apparat nennt denselben rid noch bis 12:02:21 in FLIP EXTENT PROBE auf allen drei Raengen -- der Request ist also die ganze Strandung ueber RESIDENT, nicht verschwunden. == SELBSTKORREKTUR (fuenfte, und sie stand im CODE) == Mein Commit 70d85ed schloss: "DER REQUEST IST OBERHALB DER PHASE-POLICY VERLORENGEGANGEN", und ich hatte diese Erklaerung in die sgl-project#1028-Log-Zeile geschrieben ("its request never reached this scheduler"). Das ist FALSIFIZIERT: er hat den Scheduler erreicht, wurde sechsmal von allen drei Raengen zugelassen und blieb danach resident. Die Zeile haette den naechsten Leser genau so fehlgeleitet, wie mich "decoding in tp" fehlgeleitet hat -- also derselbe Fehler, den ich am selben Tag viermal katalogisiert habe, von mir selbst begangen und in den Baum committet. Text korrigiert auf "admitted and then stopped progressing somewhere DOWNSTREAM of admission". Der Grund, dass ich es fand: die rid-Timeline, nicht erneutes Nachdenken. == FOLGE: DER VERLUSTPUNKT LIEGT NICHT AUF S0 UND NICHT AUF S1 == Intake (S0) war bereits ausgeschlossen. Admission (S1) ist hiermit ebenfalls ausgeschlossen -- sie hat kongruent ADMIT gesprochen. Der Defekt liegt ZWISCHEN Zulassung/Prefill und dem laufenden Batch, also auf der MERGE-Bahn (S2). Damit ist die Station benannt, an der weitergesucht wird. == EIN KANDIDAT, AUSDRUECKLICH NOCH NICHT ALS URSACHE BEHAUPTET == Am Strandungspunkt feuert auf allen drei Raengen "SELF-MERGE REFUSED: last_batch is running_batch (bs=1)" (scheduler.py:7427-7457). Formal ist das genau die vom Gesetz verbotene Form: ein Guard, der einen Zustand erkennt, den sein eigener Kommentar "the resident set is corrupted" nennt, und dann REFUSAL-UND-WEITER macht statt die Gruppe zu stoppen -- und der Kommentar sagt selbst "a detector that only declines to act cannot stop a doubling -- the instance still died". Nach Upstream-Minimal ist ein Defekt in einer Kompensationsschicht ein LOESCH-KANDIDATEN-Befund; die eigentliche Frage ist, warum `last_batch is running_batch` ueberhaupt gilt (Aliasing). ABER, INDIKATOR-GESETZ: der Marker feuert 166.173-mal auf diesem Boot, also auch waehrend der ~26 Minuten, in denen alles funktionierte. Er ist damit NICHT hinreichend fuer die Strandung und wird hier als KO-OKKURRENZ gefuehrt, nicht als Ursache. Wer ihn ohne diese Zahl zitiert, berichtet eine Korrelation als Wurzel. == NAECHSTER SCHRITT (nicht mehr in diesem Zug) == S2/Merge-Bahn mit derselben Disziplin: Zeilen per emittiertem Literal am Pin relokalisieren, per trapsafe zaehlen, und die Frage stellen, die die sgl-project#1031-MERGE-PATH-PROBE (scheduler.py:7462ff) bereits woertlich formuliert -- "`#running-req: 0` heisst entweder der Prefill hat NIE gemerged, oder er merged und sgl-project#856-no-carry hat ihn vor der Decode-Runde retracted; nichts Gemessenes trennt die beiden". Genau diese Trennung ist jetzt die Aufgabe, und die Probe dafuer liegt schon im Baum. BELEG-STUFE: BOOT-BEWIESEN (rid-Timeline aus dem voll ingesteten Log). Kandidat SELF-MERGE: BEOBACHTET, ausdruecklich nicht kausal belegt.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 30, 2026
…gl-project#1027 einen Aufruf frueher -- mein eigener Fix war halb. Merge-Frage: NULL. Reproduktions-Budget eingehalten: EINE Sequenz Pack4->Pack5. Sie strandete nach ~13 Minuten, bei DE-07 -- derselben Frage wie beim Original. UND DIESMAL WURDE VOR DEM RAEUMEN GEERNTET (die Regel, die ich letztes Mal gebrochen habe). Specimen /spinning/gpu-arb/W1028-LIVE-CATCH/. == DREI STACKS, EIN MOMENT == PP0 active all_reduce <- _update_uniform_pool_budget (scheduler.py:6186) PP2 active all_reduce <- _update_uniform_pool_budget (scheduler.py:6186) PP1 active+gil memory_stats <- memory_reserved <- _allocator_cache_bytes (corridor_admission.py:715) <- _takeable_cache_bytes:734 <- spendable_bytes:620 <- granted_width:635 <- _local_corridor_width_ceiling:8343 <- _update_uniform_pool_budget (scheduler.py:6121) Zwei Raenge warten im Kollektiv, der dritte hat es nicht erreicht. Exakt die sgl-project#1027-Form, anderer Aufruf. Eine fruehere Probe derselben Episode fand PP0 bei `available_size (memory_pool.py:383)` <- `get_num_allocatable_reqs` <- `_local_admit_limit (scheduler.py:6612)` -- die Straggler-ROLLE ROTIERT, die Region ist fuer mehr als einen Aufrufer langsam. == SELBSTKORREKTUR (sechste): MEIN sgl-project#1027-FIX WAR HALB == sgl-project#1027 legte `torch.cuda.memory_snapshot()` (:748-750) hinter eine Kadenz. Aber `_takeable_cache_bytes` ruft EINE ZEILE FRUEHER (:734) `_allocator_cache_bytes()`, und das geht ueber `memory_reserved()` / `memory_allocated()` ebenfalls durch `torch.cuda.memory_stats()`. Ich habe die innere teure Haelfte gedeckelt und die aeussere auf dem Pro-Runde-Pfad gelassen. Der Fix war ECHT (die sgl-project#1027-Signatur ist weg: kein Rang steht mehr im Snapshot-Zweig) und UNVOLLSTAENDIG. Jetzt ist der GANZE Wert cadenced. == DIE MERGE-FRAGE IST BEANTWORTET, UND ZWAR MIT NULL == Die sgl-project#1031-Probe war erschoepft, nicht stumm: sie verbrauchte ihren 200er- Deckel in 37 s (11:32:16-11:32:53) und schwieg 25 min vor der Strandung; der gestrandete rid kam in NULL Probe-Zeilen vor. Nachgeschaerft: Kopf-Stichprobe BEHALTEN plus ein Arm, der immer feuert, wenn ein Extend-Batch Requests trug und der Running-Batch danach leer ist (`why=NEVER-MERGED-CANDIDATE`) -- genau die Diskriminante, die der Proben-Docstring als ungetrennt benennt. Ergebnis ueber die ganze Episode: head 600, NEVER-MERGED-CANDIDATE **0**. Also: nichts wurde zugelassen-und-am-Merge-fallengelassen. S2 faellt als Verlustort aus. == DAMIT IST sgl-project#1028 VON ANFANG AN FALSCH GERAHMT GEWESEN == S0 ausgeschlossen, S1 ausgeschlossen (kongruentes ADMIT), S2 ausgeschlossen (Merge-Null). Es gibt keinen verlorenen Request: der Request ist da, und die GRUPPE STEHT, bevor sie ihn bedienen kann. sgl-project#1028 ist kein Intake-Verlust, sondern ein Liveness-Stall derselben Familie wie sgl-project#1027. Meine eigene Rahmung "der Request ging oberhalb der Policy verloren" ist damit zum zweiten Mal korrigiert -- erst zu "downstream of admission", jetzt zu "gar kein Verlust". == KLASSE, EINE EBENE HOEHER -- und das ist die sgl-project#968-Aussage == Nicht "ein langsamer Aufruf", sondern: `_update_uniform_pool_budget` leistet UNBESCHRAENKT teure lokale Arbeit in der Region zwischen Rundenbeginn und einem Kollektiv, das jeder Rang erreichen muss. Jeder Aufruf dort kann die Gruppe aushungern, und einen zu deckeln befoerdert den naechsten: sgl-project#1027 = memory_snapshot, dies = memory_stats, und `available_size`/`get_num_allocatable_reqs` (:6174) ist der naechste Kandidat. Der dauerhafte Fix ist KEINE dritte Kadenz, sondern die Region konstruktiv kostenfrei zu machen -- keine Allocator-Introspektion zwischen Rundenbeginn und Barriere. Das IST die sgl-project#968-Form: das Budget-Verdikt gehoert zu PP0 und wird verteilt, statt von jedem Rang vor der Barriere lokal neu gerechnet zu werden. Als Kommentar an der Fix-Stelle hinterlegt, damit der naechste Leser die Kadenz nicht fuer das Ziel haelt. == BELEG-STUFE == BOOT-BEWIESEN: drei Live-Stacks eines Moments, Straggler-Rotation, Proben- Zensus ueber die volle Episode, Reproduktion bei derselben Frage. NICHT BEWIESEN: dass dieser Fix die Strandung verhindert. Er ist gebaut, kompiliert, gebootet (Instrument feuert: "WHOLE value cadenced at 30s"), health 200, greedy kohaerent -- eine zweite Reproduktions-Sequenz zum Gegenbeweis ist NICHT gefahren. Wer "behoben" sagt, ueberschreitet die Daten.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 30, 2026
…z derselben Region. Per-Call-Kadenz ist WIDERLEGT. Gegenbeweis-Sequenz gefahren wie beauftragt (pack4->pack5, Deadman armiert, Live-Catch-Regel eingehalten). Ergebnis: FAIL, und der Fehlschlag ist der staerkste Beleg fuer den sgl-project#968-Umbau, den dieser Strang bisher hat. == WAS DER FIX NACHWEISLICH LEISTET == Pack 4 lief sauber durch: 13/15 (Referenz 11), DE-07 in 85,5 s -- also genau die Frage, an der die Gruppe zweimal starb. Die Sites sgl-project#1027 (memory_snapshot) und #1028a (memory_stats) tauchen in KEINEM Stack mehr auf. Die Deckel wirken, je Site. == WAS ER NICHT LEISTET == Bei RM-13 strandete es erneut: health 503, GPU 0% auf allen drei. Drei Stacks, ein Moment: PP0 idle all_reduce <- _update_uniform_pool_budget (scheduler.py:6186) PP1 idle all_reduce <- _update_uniform_pool_budget (scheduler.py:6186) PP2 active mem_get_info (torch/cuda/memory.py:842) free_bytes (corridor_guard.py:1086) spendable_bytes (corridor_admission.py:602) granted_width:635 <- _local_corridor_width_ceiling:8343 <- _update_uniform_pool_budget (scheduler.py:6121) `spendable_bytes:602` ist `free = float(guard.free_bytes())` -- die ERSTE Zeile der Funktion, VOR dem :620, den ich gedeckelt habe. == DIE DREI INSTANZEN == 1 memory_snapshot() corridor_admission.py:748 gedeckelt (sgl-project#1027) 2 memory_stats() corridor_admission.py:715 gedeckelt (sgl-project#1028) 3 mem_get_info() corridor_admission.py:602 UNGEDECKELT Alle drei in `spendable_bytes` oder dessen Callees, alle drei auf dem Pro-Runde-Pfad vor der Barriere. == VERDIKT: PER-CALL-KADENZ IST WIDERLEGT == Sie war ein vertretbarer erster Zug und wirkt je Site nachweislich. Aber die Region hat mehr Allocator-/Treiber-Aufrufe als Deckel, die Straggler-Rolle wandert auf den jeweils naechsten, und ein vierter Deckel befoerderte `available_size`/`get_num_allocatable_reqs` (:6174) -- den eine fruehere Probe bereits einmal als Straggler gefangen hatte. ICH BAUE KEINEN DRITTEN DECKEL. Das waere die dritte Kompensation fuer denselben strukturellen Fehler, und das Gesetz nennt genau das einen Loesch-Kandidaten-Befund statt eines Fix-Auftrags. == DIE WURZEL, jetzt empirisch belegt statt argumentiert == Nicht "ein langsamer Aufruf", sondern: JEDER RANG MUSS UNBESCHRAENKTE LOKALE ARBEIT ABSCHLIESSEN, BEVOR ER EINE BARRIERE ERREICHT, DIE JEDER RANG ERREICHEN MUSS. Drei Instanzen, drei verschiedene Aufrufe, dieselbe Region, dieselbe Signatur. == DESIGN-SKIZZE LIEGT VOR, BAU NICHT BEGONNEN == /spinning/gpu-arb/DESIGN_968_budget_verdict_to_pp0.md Kernpunkt daraus, gemessen: `_update_uniform_pool_budget` existiert in upstream `main` NULL mal, und `all_reduce` in upstream `scheduler.py` ebenfalls NULL mal -- gegen 8 im Fork. Upstreams Scheduler-Schleife macht GAR KEIN Kollektiv. Der ganze Mechanismus ist damit Fork-Zweitbuchhaltung ohne Upstream-Aequivalent, und die Beweislast liegt beim BEHALTEN. Aufwand ehrlich: L, mit einem XL-Risiko (Transport-Phase des sgl-project#791-Lap). Empfehlung: NICHT mit dem Voll-Schnitt beginnen, sondern mit der Slot-Klassifikation (Divergenz-Patch vs echtes physisches MIN) -- Desk- Arbeit, kein Boot, und sie bestimmt die Groesse alles Weiteren. BELEG-STUFE: BOOT-BEWIESEN ueber zwei volle Sequenzen, je eine Strandung, je drei Live-Stacks, je ein anderer Straggler-Aufruf. Serving wieder oben.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 30, 2026
…e steht, aber der Umbau loest den Stall NICHT -- zwei Korrekturen an meiner eigenen Skizze
Desk-Arbeit, kein Boot. Jeder Slot am Pin relokalisiert.
Volltext: /spinning/gpu-arb/DESIGN_968_budget_verdict_to_pp0.md
== DIE KLASSIFIKATION IST DREI-, NICHT ZWEIWERTIG ==
Die Order fragt "Divergenz-Patch vs echtes physisches MIN". Die acht Slots
zerfallen tatsaechlich in drei Klassen, und die dritte ist der Grund, warum
der Umbau kleiner ausfaellt als gedacht und den Stall nicht behebt:
(a) DIVERGENZ-PATCH -- ein VERDIKT, das jeder Rang rechnet und ueber das man
sich einigt: head_match (sgl-project#823 W9), admit_limit (:6167), Prefetch-Ballot
(#791b). DIESE DREI SIND DIE LOESCHLISTE.
(b) PHYSISCHE EINGABE -- eine per-Rang-Tatsache, die PP0 NICHT SELBST WISSEN
KANN: local_avail (#616g), admission (sgl-project#610), host (sgl-project#639), mamba (#639b),
corridor (sgl-project#794). Muessen weiter reisen, aber als EINGABE in PP0s Verdikt.
(c) DIVERGENZ-DETEKTOR -- die `x, -x`-Paare, die aus einem MIN zugleich Max
liefern, also Uneinigkeit ERKENNEN. Nach dem Rang-Gesetz ist die einzig
legale Reaktion CRASH/STOP; heute speisen sie Kompensation.
== KORREKTUR 1 AN MEINER SKIZZE: die Kadenz-Deckel fallen NICHT ==
§4 Punkt 5 meiner eigenen Skizze behauptete, die sgl-project#1027/sgl-project#1028-Deckel wuerden
mit dem Umbau gegenstandslos. FALSCH. Die drei teuren Calls (memory_snapshot,
memory_stats, mem_get_info) haengen unter Slot 5, und Slot 5 ist eine
PHYSISCHE EINGABE -- PP0 kann PP1s freies VRAM nicht selbst messen. Das
Verdikt zu PP0 zu verschieben nimmt den Followern die ENTSCHEIDUNG ab, nicht
die MESSUNG. Der Stall liegt damit auf einer ANDEREN ACHSE als die
Verdikt-Platzierung: die physische Messung darf nicht auf dem kritischen Pfad
zwischen Rundenbeginn und Barriere liegen (Off-Thread-Sampling; der
`corridor-trace`-Thread existiert bereits). Beides kombinierbar, aber keines
folgt aus dem anderen.
== KORREKTUR 2 / TRANSPORT-VERDIKT: der Ring-Lap traegt es NICHT ==
pp_admission_congruence.py:235 woertlich: eine Entscheidung braucht BIS ZU
`pp_size - 1` Runden (hier 2) ueber den Lap. Und die sgl-project#1027-Sicherheitsanalyse
UEBERTRAEGT SICH NICHT -- die Asymmetrie ist der Kern:
* `trapped` (sgl-project#1027) wird ABGEZOGEN -> ein zu alter, zu grosser Wert VERENGT
einen Cut. Sichere Richtung.
* `corridor_width` (Slot 5) ist eine OBERGRENZE -> ein zu alter, zu grosser
Wert WEITET den gewaehrten Chunk. UNSICHERE Richtung, und exakt der Fall,
vor dem der sgl-project#856-F6-Kommentar an spendable_bytes:606-619 warnt.
Ein Ein-bis-Zwei-Lap-altes Budget ist also fuer mindestens einen Slot in der
unsicheren Richtung. Der Lap traegt das Verdikt in seiner heutigen Phase
nicht. XL-Fork, geht zur Meldung statt in einen stillen Umbau.
Alternativen benannt: (1) frueherer Lap-Punkt -- aendert die Rundenphasen,
Risiko bei den Lockstep-Familien; (2) Piggyback auf bestehendem Kollektiv --
kein neuer Draht, aber PP0s Verdikt raeste auf demselben Reduce, den der
Umbau abschaffen soll. Dritte Moeglichkeit (konservative Marge gegen die
unsichere Richtung) NICHT empfohlen, aber benannt, damit sie nicht spaeter
als neu auftaucht -- sie waere eine vierte Kompensationsschicht.
== AUFWAND, PRAEZISIERT ==
Loeschliste Slots 6-8 zu PP0 M (Verdikte, kein Transportproblem)
Slots 1-5 als Eingaben behalten S (Payload schrumpft, Semantik bleibt)
Stall-Behebung (Messung vom Pfad) M-L (eigene Achse)
Slot 5 unter PP0-Autoritaet XL-Risiko, UNGELOEST
EMPFEHLUNG: Loeschliste und Mess-Achse sind unabhaengig und beide OHNE den
XL-Fork machbar. Der volle PP0-Umbau von Slot 5 wartet auf die
Transport-Entscheidung.
BELEG-STUFE: DESK-BEWIESEN (Slots am Pin relokalisiert, Archaeologie aus den
Einfuege-Kommentaren, Lap-Latenz aus pp_admission_congruence.py:235).
Kein Boot, kein Code geaendert.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 30, 2026
…em Code nicht stand -- die Slots sind GEMISCHT, nicht (a) oder (b)
GO lag vor fuer Stueck (1), Slots 6-8 als Verdikte zu PP0. Beim
Relokalisieren je Slot (Regel) faellt die Klassifikation, auf der das GO
beruht. Kein Code geaendert, kein Boot -- Meldung statt Bau, wie beauftragt
bei Verhaltens-Fork.
== SLOT 7 (admit_limit): MIXED, nicht (a) ==
`admit_limit_decision` (tp_head_congruence.py:254-255) argumentiert das MIN
selbst als PHYSISCHE Schranke, woertlich:
"MIN, and for the third time in this file it is the safe direction: the
group limit is <= every rank's own, so no rank is ever asked to admit
[more than it can]"
Das ist kein Einigungs-Argument, das ist eine Kapazitaets-Schranke. Der Slot
buendelt ZWEI Dinge: die physische Allocator-Kapazitaet des Rangs UND den
rank-lokalen Schwebe-Zustand `admission_limiter.current` (:6167-6171). Nur
das Zweite ist Divergenz. Den Slot als Ganzes zu PP0 zu verschieben wuerde
PP0s Kapazitaet Raengen aufzwingen, die WENIGER halten koennen -- also genau
die stille Korruption, die das Gesetz meint.
== SLOT 6 (head_match): ebenfalls MIXED ==
`build_head_order_payload` kodiert "this rank's OWN match length for each
canonical slot", also wieviel des Praefix DIESER Rang in seinem Radix-Cache
haelt. Das MIN liefert "die Praefixlaenge, die JEDER Rang bedienen kann" --
wieder ein physisches Schranken-Argument, nicht eine Einigung ueber ein
Verdikt. Ein Praefix zu ueberspringen, den ein Rang nicht hat, ist ein
Fehler, kein Kompromiss.
== FOLGE: MEINE (a)/(b)-TRENNUNG WAR ZU GROB ==
Sechste bzw. siebte Selbstkorrektur dieses Strangs, und die folgenreichste
fuer den Plan: die Slots sind nicht ENTWEDER Divergenz-Patch ODER physische
Eingabe -- DIESELBEN Slots sind BEIDES. Jeder buendelt eine physische
Tatsache mit einer Entscheidung, und das MIN erledigt beide Aufgaben
gleichzeitig. Genau deshalb sah die Liste sauber trennbar aus: ich hatte die
Einfuege-Kommentare (die die DIVERGENZ nennen, weil sie den Anlass nennen)
gelesen und die Entscheidungs-Docstrings (die die SCHRANKE nennen) nicht.
== WAS DER RICHTIGE SCHNITT STATTDESSEN IST ==
Nicht "Slot X wandert zu PP0", sondern je Slot: die physische Tatsache und
die Entscheidung TRENNEN. Tatsachen reisen weiter wie heute (sie muessen,
PP0 kann sie nicht wissen); nur der Entscheidungs-Anteil faellt bei PP0.
Fuer admit_limit hiesse das: die Allocator-Kapazitaet bleibt MIN-reduzierte
Tatsache, `admission_limiter.current` verschwindet vom Follower. Fuer
head_match: die Match-Laengen bleiben Tatsache, die ORDNUNG faellt bei PP0.
Das ist ein feinerer und GROESSERER Schnitt als das genehmigte M -- er
zerlegt Slots, statt sie zu verschieben.
== STATUS DER DREI STUECKE ==
(1) Loeschliste -- BLOCKIERT auf dieser Neubewertung. Nicht gebaut.
(2) Detektor-Konversion (Crash/Stop auf den x/-x-Paaren) -- UNBERUEHRT von
diesem Fund und weiterhin XL-frei; sie aendert nur den Aktionsarm eines
bestehenden Detektors, nicht wer entscheidet.
(3) Mess-Achse (Slot-5-Treiber off-thread) -- ebenfalls UNBERUEHRT; sie
beruehrt die Verdikt-Platzierung gar nicht und ist das einzige der drei
Stuecke, das den STALL adressiert.
EMPFEHLUNG: (2) und (3) bleiben freigegeben und sind der Weg; (1) braucht
eine neue Zerlegung je Slot, bevor irgendetwas daran gebaut wird.
BELEG-STUFE: DESK-BEWIESEN (Docstrings der Entscheidungsfunktionen am Pin,
tp_head_congruence.py:254-255 und build_head_order_payload).
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 30, 2026
…ypothese WIDERLEGT, Detektor existiert mit DECKUNGSLUECKE -- der Fix ist S Reiner Lese-Pass, kein Boot, kein Code. Drei Fragen in der vorgegebenen Ordnung, beide Quellen je Zeile. == (1) SCHLEIFENKOERPER: HYPOTHESE WIDERLEGT == `dispatch_event_loop` schickt auf einer Flip-Form JEDEN Rang in `run_phase_flip_event_loops` (:14251-14253, unbedingtes return). Dort wird zwischen `event_loop_normal` (TP-Phase) und `event_loop_pp` (PP-Phase) nach aktivem Stack gewaehlt -- ein echtes Divergenz-RISIKO, aber NICHT das, was im Specimen passierte: alle drei Raenge standen in `event_loop_normal` (PP0 :2681/:2711, PP1+PP2 in recv_requests aus :2668). GLEICHER Schleifenkoerper. Die richtige Beschreibung des Zustands ist damit nicht Divergenz, sondern: PP0 ist eine Iteration VORAUS und arbeitet seinen Durchlauf noch ab, waehrend die Follower schon im Broadcast der naechsten warten. Also wieder die STRAGGLER-Form -- nur an einer anderen Barriere und mit PP0 als Langsamem. SCHRANKE, ausdruecklich: ich habe von PP0 ZWEI Proben, beide in billigem Code an verschiedenen Stellen. Das schliesst "PP0 haengt in einem Aufruf, den ich nicht getroffen habe" nicht aus. Um "die ganze Iteration ist langsam" von "eine ungesehene Stelle haengt" zu trennen, braucht es ein PROFIL (py-spy record ueber Sekunden), keine Dumps. Nicht behauptet, benannt. == (2) DETEKTOR: ER EXISTIERT, UND DIE LUECKE IST PRAEZISE == `on_blocked_recv` (sgl-project#824 W5(b), request_receiver.py:89-95) ist genau der Detektor fuer diese Klasse. Sein eigener Kommentar nennt den Fehlermodus woertlich: "Without it that call is a blocking PP receive that records nothing, SO THE WATCHDOG CANNOT NAME IT -- the same blind spot sgl-project#821 left on the chain_receiver path, which is where two of three ranks wedged on boot_827." Er wird um den DIREKTEN KETTEN-EMPFANG gestampft (`point_to_point_pyobj`, :323-326). Er wird NICHT um den TP-BROADCAST gestampft (`broadcast_pyobj`, :380-404) -- und genau dort standen PP1 und PP2. Das ist keine fehlende Idee und kein Detektor ohne Aktionsarm, sondern eine DECKUNGSLUECKE eines vorhandenen Fixes. Und sie erklaert, warum dieser Wedge nur per py-spy zu finden war: der Watchdog konnte die Stelle nicht benennen, exakt wie der Kommentar es vorhersagt. Im ganzen File: kein timeout, keine deadline auf dem Broadcast-Pfad. Das Warten ist heute unbegrenzt. == (3) PRIOR-ART-GATE: TREFFER, ALSO LUECKE STATT NEUBAU == Dieselbe Stelle hat Wedge-Historie: `kill_window_lines.txt` (2026-08-01) zeigt einen Traceback ueber `recv_requests -> _broadcast_reqs_across_ranks`, und BEFUND-pp3solo-ring-wedge-1013.md haelt die Geschwister-Form fest (geschlossener Ring, alle in SEND). Kein Neubau abgeleitet. == VORGESCHLAGENER SCHNITT, ZWEIGETEILT == (a) DECKUNG, S: `on_blocked_recv` um den Broadcast stampfen, wie es um den point-to-point-Empfang schon geschieht. Wirkung: der Watchdog kann die Stelle benennen; der naechste Wedge dieser Art braucht kein py-spy. Reine Deckungserweiterung eines bestehenden Mechanismus, kein neuer. (b) AKTIONSARM, getrennt: heute ist `on_blocked_recv` ein AUFZEICHNENDER Haken, kein Aktuator. Der Rang-Gesetz-Teil (begrenztes Warten -> CRASH/STOP mit benannter Diagnose beider Seiten) braucht zusaetzlich die "was tut PP0 gerade"-Haelfte, und die ist ohne das Profil aus (1) nicht sauber formulierbar. EMPFEHLUNG: (a) jetzt, (b) nach dem Profil. (a) ist S und macht (b) ueberhaupt erst diagnostizierbar. BELEG-STUFE: DESK-BEWIESEN (beide Quellen je Zeile am Pin gelesen, Kommentar-Zitate woertlich). Die Stall-Beobachtung aus dem Vorlauf bleibt BOOT-BEOBACHTET mit der oben benannten Proben-Schranke.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 30, 2026
ROOT, corrected against the handover's framing. The handover read the store
census as "15457 KV pages vs 11 mamba anchors = grid behaviour" and ordered
the anchors published at every write-through. Measured on the same boot
(boot_855_1028fence), that premise is a PAGE-vs-NODE denominator mix and the
ordered fix is already in place:
* `#969H BACKUP` = 33 lines = n=1..11 on EACH of PP0/PP1/PP2 at identical
timestamps. The probe logs every call up to n<=40, so 11 lines means
`write_backup` reached its component loop exactly 11 times per rank in the
whole run -- and all 11 carried `mamba_value=has_value`.
=> mamba coverage OF THE HOST-BACKUP PATH is 11/11 = 100%, not 11/15457.
* All 11 `.mamba` hashes in the store are also full-KV page hashes
(intersection 11, mamba-only 0): one anchor per node at a real page
boundary, shared key namespace.
* The 15457 KV pages are the PAGES of those same 11 nodes:
`write_backup_storage` writes `keys=node.hash_value` (every page of the
node) while the mamba branch writes `keys=[node.hash_value[-1]]` (one
trailing page).
The real hole is one link earlier and is not mamba-specific: `_inc_hit_count`
returns before any backup when `chunked=True` (upstream's "skip the hit count
update for chunked requests"). Under chunked prefill NOTHING is published per
chunk -- so the 11 backups are the 11 FINISHED requests, and a chunked prefill
that never finishes publishes nothing at all.
That is why the 13179-token prompt found its deepest anchor at 3072 and
recomputed the remaining 10107 tokens: the anchors are as dense as finished
requests, not as dense as chunks.
FIX: allow a chunked-prefill node to reach the host tier, gated structurally
on (storage tier present AND a MAMBA component present). The per-chunk node
already carries a donated state on the device
(`MambaComponent.prepare_for_caching_req`, is_finished=False branch); this
early return was the only reason it never reached host or storage.
UPSTREAM-MINIMAL: the chunked skip IS upstream (`hiradix_cache.py`), so this
is a DEVIATION and carries its burden of proof. Named: (1) drain-and-flip --
a chunked prefill interrupted by a flip never reaches `cache_finished_req`
(sgl-project#856 removed the carry, the flip DISCARDS it), so upstream's publish-at-finish
never fires; (2) GDN hybrid -- a recurrent state is valid at exactly one token
position, so the per-chunk anchor has no pure-attention analogue. Gate off =
byte-identical to upstream (verified: branch truth table, 0 mismatches over
all 8 chunked/write_back/force combinations).
LAWS: `mamba-per-knoten-nicht-gitter` in its own words ("states per radix
node/chunk like KV pages"), and it waives write volume explicitly.
`kein-doppel-prefill` (sgl-project#939): loss bound becomes ONE chunk.
sgl-project#968 PP0 DEBT -- WHERE THIS PATH STAYS RANK-LOCAL: the publish decision is
taken at the scheduler's chunk boundary, which every rank runs for the same
request at the same split, so it is unanimous BY CONSTRUCTION, not by
agreement; this path holds no reduce (the `check_prefetch_progress` MIN is
TP-scoped and the boot runs tp_size=1/pp_size=3, so it is structurally
skipped). `raenge-nie-uneins` is met by construction and `#1028P
CHUNK-PUBLISH` is how the claim gets CHECKED: identical n at identical
timestamps across ranks, the evidence shape `#969H` gave for the 11.
The one rank-local input reachable from here is the sgl-project#581/sgl-project#773 write-through
pin budget, which fired ZERO times in that boot (trap-safe: bare 0, genuine 0)
because 11 backups never approached it. Per-chunk publishing makes it
reachable for the first time; `pin_skipped` rides on the same line so a
nonzero count next to a divergent n is the divergence, named in advance.
COST, QUANTIFIED NOT BUILT: one `.mamba` blob is 78446592 B = 74.8 MiB
(measured, all 11 identical); a KV page is 32768 B. A published 4096-token
chunk therefore adds 74.8 MiB of anchor on top of 128 MiB of KV (+58% L3).
Host RAM is UNCHANGED -- the host mamba pool is pre-sized at boot from
`hicache_ratio` (1.5) x device slots, so anchors roll through a fixed tier and
land on disk. The int8-anchor idea (sgl-project#1013) would cut the 74.8 MiB and is
deliberately NOT built here.
ALSO: #1028B FETCH CAP instrument at the `min` in `hicache_storage.py`, the
cap that decides how much of an existing KV prefix a prefetch may claim. It
printed nothing: `final_pages`, `kv_pages`, `boundary=`, `hit_pages` each
occur 0 times in the whole 5.87 MB log, so "anchors too sparse" and "KV prefix
too short" produced the same number and were NOT separable from that boot.
Now both terms print on one line.
Desk checks (error-class matched): ruff F821/F811/F841/E9 clean on both
changed files (new names + new attribute reads); branch truth table executed,
gate-off equivalence exact. The gate is deliberately NOT memoised --
`enable_storage` is False at __init__ and only set in `init_hicache`, and a
memoised early False would leave a wired-but-inert write path, the sgl-project#742/sgl-project#745
class this area has produced before.
NOT YET BOOT-PROVEN. Acceptance is the next boot.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 31, 2026
…ent; every rank applies that one number Re-attaches the admission arc for one field and replaces the sgl-project#1035 gate with a constructive form. The gate bought rank-uniformity by throwing the information away (nobody loaded back, every revived token recomputed on every rank); this keeps the uniformity and returns the tokens by taking the extent from ONE rank. WHY IT IS DECIDE-AT-N / APPLY-AT-N+1, not a same-pass stamp. The per-pass proxy frame is received at scheduler_pp_mixin.py:4476, AFTER that rank has already planned its batch at :4292 -- a full admission later. There is no arc in the loop that lands a PP0 fact before planning: the request chain is the only pre-planning receive and its own induction argument promises delivery "at the top of the current or NEXT pass", and a blocking pre-planning receive is the shape of the arc sgl-project#1015 deleted after it deadlocked PP3-solo. So PP0 does not apply its own offer either; the row makes one lap and every rank, PP0 included, first applies a given extent on the same pass. Uniformity is constructive, not a bet that two ranks measured the same thing. The cost is one pass per rid and it lands on a chunk boundary: the first chunk of a cold-warm request runs without the prefix -- that is the batch whose frame carries the fact -- and every later chunk honours it. Bounded by ONE HiCache chunk, the standing sgl-project#939 bound, not by the prompt. Absent fact = no load-back on any rank, never a local substitute. A rank told an extent its own host tier cannot cover refuses loudly (PPScheduleRefused, both numbers named) rather than loading less, which would be the 1815081d46 shape divergence arrived at by being helpful. Carrier: PPAdmissionEntry.load_back_len, appended at the end of the wire row and read by index under the existing width guard, so a shorter row from an older sender reads back as None. Popped on receive before PPProxyTensors is built (the slice path maps v[key] over every entry). Relayed verbatim by middle ranks so PP2 applies PP0's number and not a re-derivation. Also deletes two stale comments that each asserted a live mechanism over code where it is dead: * ":4662 sgl-project#1015 SEND IS UNCONDITIONAL NOW" -- the contract 60fdee3 [#969J] deleted, sitting directly above the guard that does the opposite. Cost a full design round on this slice. * ":4437 pp_output_payload_with_return_trip as an independent, unaffected carrier" -- that function has 1 definition and 0 call sites, as does reconcile_pp_admission_decision. Evidence, boot_855_939reread_0840f82601_0830_232150: 15/15 genuine sgl-project#1035 refusals, 5 rids x 3 ranks, host hit rank-IDENTICAL for every rid (1278, 350, 4618, 4618, 350). Read as a hazard, never as a licence -- the docstring says so explicitly so no later optimiser adds a local fast path. Desk checks: codec round-trip with the new field, width tolerance (row 11 -> 10 reads back None), refusal path raises with both numbers, honest-miss returns None without falling back to the local hit, pp_size<=1 unchanged. Ruff finding set identical before/after (172/172, no new rule types).
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 31, 2026
… with_key / published Boot 3 (a4c9a7a, prefix-key + S1 clamp, cell with traffic): still 0 applied load-backs, and the promote instrument added in that commit reads 0 as well. That is the useful half of the result -- it localises the break to the PUBLISH side, because PP0 fills `pending` directly from the decision it just built with no wire in between, so a zero there cannot be a lost hop or a missed consume. Static reasoning has now picked the wrong half three times (host_hit not set at the read point -- refuted, add_one_req 2080-2412 writes it nowhere; site visited once per rid -- refuted then confirmed under a different dwell; lifetime -- fixed and did not help). This prints the halves instead: the DENOMINATOR (entries) beside with_offer and with_key, so the next zero is attributable to 'no entries', 'no offer' or 'no key' rather than to the chain. Flip-latency figures from boots 2 and 3 are NOT ship-representative (user ruling): --phase-flip-image-file-backed was a mitigation experiment, and its +53.5s/flip is the cost of pushing dirty pages through FS writeback, not a cost of flipping. Ship form is the 4.24s class. Dropped from boot 4 on.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 31, 2026
…not off can_run_list The publish instrument from 54f7bb2 answered the question three boots of static reasoning could not. Measured on boot_855_968ratio1_..._0831_072638: sgl-project#968 LOAD-BACK PUBLISH n=2 entries=1 with_offer=0 with_key=1 published=0 | first=[('bce57cf8', None, 'key')] with_key=1 on every entry and with_offer=0 on every entry. The key was fine; the EXTENT was never there. Root: the offer was read off `can_run_list` after the admission loop, but the request that HAS a host hit is the one that defers at the load-back site and does not reach the decision on that pass -- the sole published entry was a health-check request. So the offer was always sampled from a member whose host_hit_length is 0, while the rank holding the 4618-token hit stood at the deferral line. Fix: capture the offer at the load-back site itself, in the branch that only runs when needs_host_load_back() is true, so the hit exists by construction and is the same number the deferral line prints. It rides on the REQUEST, so whenever that request next reaches a decision it carries the extent with it, however many passes later that is. This also explains why the two previous carrier fixes could not have worked: sticky lifetime (7e411de) and prefix-key keying (a4c9a7a) both operate downstream of a publish that was empty. Neither was wrong; both were behind the binding term. Desk checks: offer captured as 4618 at the deferral site; honest miss still returns None; no hit -> no offer; told path unchanged and does not overwrite the offer.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 31, 2026
…omote, and the silently-wrong pair ONE build closing the publish -> cached_tokens chain, plus the health-probe confound that made every measurement of it ambiguous. THE TWO BINDING TERMS (both desk-proven at the tree, both root, not symptom): 1. The promote `pending -> effective` existed at exactly ONE site, inside `_event_loop_pp_body`. The warm prefill on this rig runs boot-measured in the TP phase (the instance flags it itself: `sgl-project#838 work_in_wrong_layout class=prefill phase=tp`, 9 genuine violations), where that body never runs. PP0 published into `pending` and nobody ever promoted it: `sgl-project#968 LOAD-BACK PROMOTED` = 0/0/0 over three whole boots, and that is a REAL zero -- its cadence counts promotions, so the first would have printed. Fix: `promote_pp_load_back_pending()`, idempotent, called from both loop bodies AND from `_get_new_batch_prefill_raw` (the phase-neutral consumer), above every early return. 2. `init_pp_loop_state` nulled `_pp_load_back_pending` UNCONDITIONALLY while the line directly below guarded `_pp_load_back_effective` with `hasattr`. The unconditional null was deliberate ("only pending is a per-pass quantity") and is only fatal BECAUSE the promote was phase-bound. Fix 1 is the root; this is the guard that carries the fact across the cutover. REGRESSION IN e0bc960, FOUND AND FIXED: that commit moved the offer write to the load-back site but kept only the `_hit > 0` half, deleting the only deleter -- the old `= _hit if _hit > 0 else None`. The comment it removed states the lost property verbatim ("goes to None on its own"). The offer then outlived its own truth: stale-HIGH re-publish -> a peer told an extent its host tier no longer covers -> `EXTENT UNHONOURABLE` -> PPScheduleRefused, which voids the pass for the WHOLE GROUP. Deleter restored at the spend. STAGE A: the stamp population and the entry population were two different sets -- the stamp sits behind eight `continue` branches (`already_in_batch` is the sgl-project#946 shape: `add_chunked_req` appends the continuation to `can_run_list` BEFORE the loop, which then skips it), while the decision is built from `can_run_list`. Boot-measured in the gap: `loop_skips( prefetch_pending=1(first=bce57cf8...))`, 3x, the same 4618-token rid. The key is now stamped over `can_run_list` itself, so the two populations are identical by construction. This also closes the NEXT link, which was already visible: the publish filter needs `load_back_len AND load_back_key`, so an entry with a live offer and no key would still have published 0. SILENTLY-WRONG PAIR, mandatory in this build because fixes 1+2 are what arm the path -- once live it returns wrong tokens rather than crashing: * The adopted GDN state is the node's END state, at `_applied`; the S1 clamp cuts KV to `told` and cannot cut a transfer that already ran. The scan would resume at `told` from a state that has consumed `told.._applied-1`. No assert can fire; the KV geometry is self-consistent at `told`. And it is the EXPECTED relation, not a corner (a4c9a7a: "stale-low by construction", measured 1215 -> 1216 -> 2114). The whole load-back now falls instead; the state is NEVER trimmed, per the hazard the code already spells out. The slot is returned before the raise, because the exception bypasses the sgl-project#991 revert site. * Mamba slot starvation used to skip the restore while the KV prefix grew to `told` -- warm-booked prefix over a state never loaded. It now fails the whole load-back. KV extent and GDN state stand or fall together, one rule. HEALTH ISOLATION (sgl-project#942, standing user order): a /health_generate probe is a liveness instrument, not work. Upstream only dispatches one when the box is `is_fully_idle`, so at idle the probe IS the entire backlog, and under purity `tp_threshold` is 0 -- its single token decided the layout of the whole instance. Excluded from all FOUR backlog terms via `_pending_prefill_tokens(include_health=False)` and `_admissible_prefill_tokens(include_health=False)`, at the economy readers only. THE SPLIT IS AT THE CALL SITE, AND THAT IS THE WHOLE POINT. A blanket exclusion is the obvious form and is wrong in the silent direction: `tp_compute_fits_in_one_chunk` grants only while `0 < pending < chunk`, so subtracting the probe there too collapses the sgl-project#887 grant and the probe is served by nothing at all. Service readers keep the default; economy readers exclude. No new tag: upstream already stamps the rid at the /health_generate source, and its own predicate reads `.rid` via getattr, so it applies unchanged to Req, TokenizedGenerateReqInput and PPAdmissionEntry. MEASURABILITY (without these the next boot cannot read its own result): * `cached_tokens` was structurally blind for exactly the population the warm acceptance lands on: the booking sits under `if not req.retracted_stain` and the stain is an ever-flag, while the cutover design retracts and re-admits everything. Now booked per admission by assignment (never `+=`, so the double count the stain guards stays impossible) and the stain is kept, because two other consumers read it. * The publish probe counted PASSES: with fewer than 64 publishes the `%64` arm never fired and the whole budget went to the boot's cold head, leaving every warm opportunity unobserved. Now event-cadenced, and health is its own column rather than mixed into the denominator. * `sgl-project#783` named a term that was not the one firing (it printed two identical numbers); each of the three terms now names itself. * The `sgl-project#998` sample printed `items()[:3]` of a never-pruned dict, i.e. the OLDEST entries forever -- one genuine event echoed 35k+ times, which reads as a request that stayed resident all boot. Now `[-3:]`. Ordering guard at `truncate_prefix_to`: it zeroes `host_hit_length`, which the offer is captured from. Dormant only because sgl-project#1015 deleted the receiving end; whoever restores that wire must re-check this order first. Tests: test/srt/test_health_isolation_942.py, 7 tests against the production functions, all green; can-fail proven by mutation (exclusion -> no-op gives 3 failures, incl. "a health probe armed the tp-ward flip"). Cross-module exception identity for the new refusal verified as identical. AST checks on signature/call-site agreement (9 sites) and on control-flow ordering (35/35, 24 failures against pristine HEAD). ruff 108 = 108 vs HEAD, no new findings. Not proven on metal at the symptom -- that is the next boot.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 31, 2026
…y carrier Deletes a four-stage side channel that was emulating two properties the row and the request already have between them. Net -180 lines. WHAT WENT, AND WHY IT COULD: pp_load_back_offer -> pp_load_back_key -> _pp_load_back_pending -> promote -> _pp_load_back_effective -> keyed lookup at the application site * DELIVERY across ranks is the row, and ONLY the row. It is the sole arc that carries a PP0 decision to its peers. The other candidate -- writing the fact on the request at intake -- is impossible here, and the edge is named: each rank builds its OWN `Req` from its own copy of the wire object (`handle_generate_request`, scheduler.py), and `_pull_raw_reqs` runs at the head of the round, before PP0's decision exists, once per request. There is no shared object to write and no second forward to carry a later value. * LIFETIME on one rank is the request itself. A `Req` is rank-locally resident, and the cutover retracts and re-admits it from the local waiting queue rather than re-receiving it, so `pp_load_back_told` survives the cutover BY CONSTRUCTION. The sticky map and the content key were emulating exactly that, in a second place -- which is where BOTH binding terms of this slice lived, and where the offer's only deleter was lost in e0bc960. So the row now carries `load_back_len` built straight from each admitted member's live `host_hit_length` at the decision site, and the receiver stamps it onto its own requests BY RID. The rid is the one identifier that is the same value on every rank, which is what lets the content-key column go. THE ONE-LAP DELAY IS PRESERVED, AND IT IS LOAD-BEARING. Measured in the loop body: planning (`get_next_batch_to_run`) sits ~190 straight-line lines BEFORE the proxy receive, in the same iteration, with no loop or function boundary between them. So the row a peer receives in pass N is first honoured in N+1 -- which is the documented contract ("stamped by PP0 on the frame of the pass that ADMITS the request ... every later chunk honours it"), and the reason the acceptance needs a MULTI-CHUNK request. This delay must not be "fixed": a rank applying an extent on the pass it learns it would sit at a prefix its peers cannot reach, which is the divergence boot 1815081d46 died in. PP0 now takes the same lap through its own row rather than seeding a private map, so the timing is uniform across ranks by construction instead of by a matching pair of side-maps. An earlier hypothesis that the row would arrive in time to apply on the SAME pass -- which would have fixed the outstanding application term for free -- was tested against the tree and REFUTED by that measurement. The lag is a property of the loop structure, not of the side channel, and it hits every carrier equally. The collapse is still right (less mechanism, same semantics); the application term is a separate link. ZOMBIE-COUNTER TEST (deleted plumbing must mean deleted emitters): sgl-project#968 LOAD-BACK PUBLISH 1 -> 0 emitters sgl-project#968 ENTRY-STAMP RAISED 1 -> 0 sgl-project#968 PUBLISH PROBE RAISED 1 -> 0 sgl-project#968 LOAD-BACK PROMOTED 3 -> 0 (one comment remains, no emitter) sgl-project#988 LOADBACK live emitter INTACT (acceptance stage ii) EXTENT UNHONOURABLE live emitter INTACT new: sgl-project#968 LOAD-BACK ROW APPLIED / ROW UNREADABLE Symbols: load_back_key 12 -> 0, promote_pp_load_back_pending 3 -> 0, pp_load_back_applied 3 -> 0, _pp_load_back_pending/effective 9 -> comments. `offered_prefix_key` is KEPT: a different field (`prefix_key`) still uses it. Check matched to the error class -- a width change on an index-read wire and a rid match, both invisible to py_compile: decision -> to_wire -> from_wire round-trip preserves rid and load_back_len at the new width with the key column absent; apply-by-rid stamps only the named request; a row naming an absent rid invents nothing. ruff 170 = 170 vs HEAD. Health-isolation anchor still green (7/7). Not proven on metal: no boot yet. Boot 8 decides, on a three-stage acceptance whose first stage is "was the host path entered at all" -- because a run that never enters it is UNDECIDED, and reading that as pass or fail is how this strand lost boots before.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 31, 2026
…anchor, and measure the loss KV is DIVISIBLE, the recurrent (mamba/GDN) state is POINTLIKE. Every length-shifting operation in the load-back chain is KV-built, so the extent it produces lands, for mamba, on a boundary with no state behind it -- and reusing a KV prefix there resumes a scan from a state that consumed different tokens. That is silently wrong, and today it is answered ALL-OR-NOTHING: the whole load-back falls and the whole prompt re-prefills. The user's grant is the opposite: re-prefill at most one HiCache chunk, from the KV position that matches the most current GDN state. WHAT THIS COMMIT DOES * Publishes the anchor depth the match walk already computed but discarded. `MatchResult.state_anchor_depth` is the absolute depth of `best_match_node`, i.e. of the deepest node EVERY component accepted -- mamba's acceptor being `is_resume_candidate` itself. The predicate is REUSED, never re-derived; a second anchor rule would be the second bookkeeping the upstream-minimal law rejects, and sgl-project#747 records what two anchor lineages do to each other. * `MatchResult.key_match_depth` beside it: how far the KEY matched with no validator asked. The PAIR is what separates "the prefix was never stored" from "the prefix is here and its anchor died with an evicted node" (sgl-project#1039). One hit number collapses them. * `state_aligned_load_back_len()` -- ONE writer, called by BOTH PPAdmissionEntry constructors, rounds PP0's extent DOWN to the anchor and counts what it gave back. `None` (no state-bearing component) keeps upstream byte-for-byte; `0` (no anchor on this path) is the CORRECT "load back nothing" under leaf-only mamba data, never an error. * `zero_match_result` zeroes the anchor depth too -- a refusal that reaches back to the root has no anchor left to point at. Same contract as sgl-project#1018 fixed for `cache_protected_len`. THREE VERIFICATIONS THAT CHANGED THE BUILD (desk-proven at this tree) * mamba_component.py's `best_depth` is NOT the number to plumb: its block needs `SGLANG_MAMBA_CKPT_STRICT_RESUME` (default False) AND `cache_controller is None` (false under HiCache), and it sums DEVICE value chunks, which diverge from the accepted-anchor depth exactly when `separate_device_match` is on. * The extent is ALREADY state-aligned RANK-LOCALLY: `host_hit_length` is measured from `best_match_node` (full_component.py), and that node is only set where the mamba validator accepted. A rank-local rounding is therefore a no-op, and is not built as one. * The real misalignment is CROSS-RANK, at the S1 clamp: PP0's extent is aligned in PP0's tree, the cut lands in the receiving rank's. That seam is MEASURED here (the FIX-3 refusal now prints the local anchor depth and whether it AGREEs with the told extent), not yet fixed -- the population decides the design. INSTRUMENTS (each names its denominator) * `sgl-project#1040 EXTENT STATE-ALIGN`: kv / extent / loss / anchor_depth / device_len / key_match_depth / class, with running totals. The round-down loss is kept APART from tokens forgone because no anchor existed -- pooling them inflated loss_max from 200 to 300 on the check fixture, which is how it was caught. * `sgl-project#988 LOADBACK` gains the KV/MAMBA split: kv_applied vs mamba_restored vs kv_only. KV moved while the restore refused is a HALF SUCCESS with a named link, never a green one. * `sgl-project#968 LOAD-BACK ROW APPLIED` gains `anchors=` and `retract_survivors=`. * `reset_for_retract` stamps retraction survival -- the free pre-measurement for the lifecycle half (sgl-project#1039); monotone, never cleared, nothing stale behind it. CHECK (speed mode: one matched check, not a battery) devtools/check_1040_rounding.py -- hermetic, CUDA-free. Named failure class of this edit: unit/coordinate error (absolute anchor depth vs the row's delta), off-by-chunk at the boundary, empty candidate set treated as an error. Trips the rounding on empty / below / exactly-at / above / pure-KV / no-hit, and walks `_state_anchor_depth` over a stub chain to pin the unit. ALL PASS, after it failed on the pooled loss denominator and that was fixed. py_compile + import smoke on all seven files; ruff clean on the three most-edited. cell_1039_ingeneration.sh: stage (iii) moved off `sgl-project#968 LOAD-BACK PROMOTED`, which the row collapse DELETED (0 live emitters, only a prose mention left -- the sgl-project#995 trap, it would have read 0 forever), onto `sgl-project#968 LOAD-BACK ROW APPLIED`. Adds the KV/mamba split, the measured loss median/max, the anchor-absent population, and a zombie test over the four abolished markers.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 31, 2026
… it without admission BOOT-8 ROOT, MEASURED. The extent was derived inside `build_pp_admission_decision`, reached only from `_get_new_batch_prefill_raw`'s tail -- after an admission loop with eight `continue` branches and an `if len(can_run_list) == 0: return` above it. On the passes where a host hit was live, the holder was skipped at scheduler.py's `prefetch_pending` branch before the adder ever saw it, the list came back empty, the method returned, and NO decision was built: 09:13:52 PP0/PP1/PP2 sgl-project#788 PP-ADMISSION verdict=DECLINE n_reqs=0 queue=1 reason=loop_skips(prefetch_pending=1(first=f7f997c0...)) 09:13:54 PP0/PP1/PP2 sgl-project#968 LOAD-BACK DEFERRED rid=f7f997c0... (kv=4618) ... holds no PP0 extent for it yet The chain fed itself: hit present -> prefetch pending -> skipped -> empty list -> no decision -> no extent -> deferral. `sgl-project#1040 EXTENT STATE-ALIGN` read 0 in the whole log while its sibling emitter logged 9 times, which is what localised this. TWO HALVES, both mechanism-agnostic on purpose. 1. CHOICE MOVES TO THE WRITER. `stamp_state_aligned_extent` runs at the two sites that write `Req.host_hit_length` -- `Req.init_next_round_input` and `match_prefix_for_req` -- both unpacking one `match_prefix` result. `Req.__init__` only zeroes the field and `truncate_prefix_to` is dead (0 callers, 0 name reads), so a request CANNOT hold a hit without passing one of them. Every `can_run_list` filler (`add_one_req`, `add_chunked_req`, `add_one_req_ignore_eos`, the dllm pair, `_add_scheduled_req`) must match before it is executable, so the match dominates all six. The dominator argument is made over the WRITERS deliberately: the call graph cannot carry it -- `call_path add_chunked_req -> match_prefix_for_req` walks past 156 unresolved edges and finds nothing, which is a bounded negative and proves nothing. The row builder now READS the stamped field on both branches and derives nothing. 2. PUBLICATION DECOUPLES FROM ADMISSION. `_publish_pp_decision_1041` is the one publisher and BOTH exits of `_get_new_batch_prefill_raw` go through it, including the empty-list return that boot 8 died on. Everything the loop SAW and did not admit rides as an `admitted=False` FACT CARRIER. Collected at ONE site at the top of the loop, before any skip -- appending inside each skip branch would be the per-path retrofit this slice exists to avoid, and would have missed the second, still-unproven decline mechanism exactly as the first was missed. CARRIER SAFETY IS STRUCTURAL, NOT CAREFUL. `forwarded_schedule` already filters `e.admitted and not e.retracted`, so a carrier can never enter `_pp_scheduled_extents` and therefore never reaches the sgl-project#791 membership compare (scheduler.py:10508/:10522) -- the PPScheduleRefused-storm direction is closed at the source. `reconcile_pp_admission_decision` passes it through verbatim; `forwarded_last_chunk`/`forwarded_fill_carry` key on `fill_len`, which it does not carry; `apply_pp_load_back_row` stamps it by rid, which is its whole purpose, and an unheld rid is already a counted no-op there. STANDING INSTRUMENT. `sgl-project#1041 EXTENT POPULATION seen/published/delta` per pass. `delta != 0` means a request held an extent and no entry carried it, i.e. a bypass. The three legitimate differences are structural and produce no delta: no host hit stamps no extent, `pp_size<=1` never reaches the publisher, and an unheld rid is the receiver's counter. A future bypass is now loud instead of a silent zero that costs a boot to read. CHECK (speed mode: one matched check). devtools/check_1041_factcarrier.py, hermetic, CUDA-free. Named failure class: non-admitted entries reaching readers that iterate the decision, dangerous direction a PPScheduleRefused storm. The three pinned directions: (1) carrier passes without refusal and is absent from forwarded_schedule / last_chunk / effective while still delivering its extent through reconcile and apply; (2) a real membership violation STILL refuses -- an admitted rid the rank does not hold is still nameable as MISSING, pinned so the gate cannot go quiet; (3) unknown rid raises nothing and stamps nothing. 20/20 PASS. sgl-project#1040 check re-run green (no regression), py_compile + import smoke, ruff clean on the edited congruence module. cell_1039: adds `sgl-project#1041 EXTENT POPULATION` delta==0 and PPScheduleRefused==0 as acceptance criteria, both voiding the PASS branch.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 31, 2026
…ole filler BOOT 9 MEASURED THE DETECTOR LYING GREEN. Every emission read `seen=0 published=0 delta=0` beside `admitted=1`: a pass that admitted a request while the counter claimed to have seen nothing, and reported delta=0 for it. Root: `_seen_this_pass` collects only what the WAITING-QUEUE LOOP visited, but `add_chunked_req` (scheduler.py:9878) fills `can_run_list` BEFORE that loop runs. A pass serving only chunked continuations therefore visits nothing, and a detector whose denominator excludes an entire `can_run_list` filler cannot detect that filler's bypass -- the exact denominator trap this instrument was built to prevent, reproduced inside the instrument. Population is now the UNION of what the loop visited and what was admitted, so every filler is inside the denominator. Fact carriers are derived from the same union, so a touched-but-not-admitted request cannot fall out of publication either. Both matched checks re-run green. This is an instrument correctness fix; the sgl-project#968 application term is untouched and still open.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 31, 2026
…erted with the architecture BOOT 15 CRASHED AT 10:59:42, all three schedulers, and the cause is the sgl-project#1046 cut -- reported as mine, not as a pre-existing condition. sgl-project#968 LOAD-BACK EXTENT UNREACHABLE for rid=c9d14e69...: PP0 published an extent of 4618 token(s) and this rank's load-back yielded only 0 1448 times on one rid, refusing the forwarded schedule on every rank every pass, until the ring wedged (sgl-project#789 PROXY READINESS TIMEOUT) and the schedulers died. ROOT: sgl-project#1042's "a hitless match must never clear" was CORRECT while the extent was consumed A LAP LATER by the delivery row -- the fact had to outlive the match that made it. sgl-project#1046 moved consumption into the SAME match and I carried the old rule across unchanged. The extent then outlived its own validity: rid c9d14e69 kept extent=4618 through a readmit whose match read `host_hit=0`, and the clamp demanded 4618 from a tree that could serve 0. THE LESSON IS THE LIFECYCLE LAW ITSELF: a table is valid for ONE architecture. It must be RE-DERIVED when the consumer moves, never inherited. I built the table, then broke it by moving the consumer without re-deriving it. TWO FIXES, both following from the same inversion: 1. A hitless match now CLEARS (`hitless_clear`, was `hitless_noop`). Under local consumption the extent is only valid for the match that produced it. 2. `_applied < _lb_extent` is no longer a PPScheduleRefused. That raise existed because `_lb_extent` was PP0's PUBLISHED number, so a rank that could not reach it would diverge from peers who could. Since sgl-project#1046 the extent is this rank's own, so a shortfall means only that this rank's stamp went stale -- local staleness, not divergence. It now takes what its own tree can serve and says so (`sgl-project#1048 EXTENT STALE`), which is uniform because every rank re-derives from its own tree. Leaving it a group refusal is what turned a stale number into a ring wedge. ALSO REPORTED: the boot-15 reproducibility run is CONFOUNDED, not negative. Two cell runs landed on a server that was dying and then dead (deadman CRASH 10:59:47); the repro window's `sgl-project#988 genuine=0` measures the death, not the mechanism. It is not evidence either way and is not counted as such. check_1042 updated to pin the INVERTED rule and re-run green; ruff clean apart from pre-existing E402.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 31, 2026
…fork turns on: told prefix vs local Boot 27 died because two ranks admitted the same pass at different widths (PP0 extend=4096, PP1 extend=2596; same slot, same fwd_ct, same rids; exactly one divergent (slot,fwd_ct) pair in the whole boot). The fix form is a real value fork and BOTH arms already killed a boot: per-rank refusal on an uncoverable told value -- boot 15 (sgl-project#1048): PP0 published extent 4618, a rank yielded 0, 1448 refusals on one rid until the ring wedged and the schedulers died. sgl-project#1048's own fix deleted the raise. rank-local derivation -- boot 27, above. So this commit changes NOTHING and only sizes the open quantity: how often does PP0's published prefix exceed what a peer can cover, and is it concentrated at flip boundaries? The row already arrives and is already relayed verbatim (632ba36); sgl-project#1046 removed only its consumer. The receive point therefore stashes the told prefixes into a dict that NOTHING but the census reads. IT MUST NEVER WRITE _pp_admission_incoming_effective. That field is the armed predicate of the clamp in _get_new_batch_prefill_raw; populating it would arm PP0-published widths together with the refusal that killed boot 15. A separate dict cannot. The matched check is an AST scan proving the new function writes only _1058_* attributes, plus a census that the armed predicate still has exactly its 4 None/{} writers -- py_compile is structurally blind to this failure class and would have passed either way. DENOMINATOR LAW BUILT IN, not remembered: five counters, and the ABSENT case is one of them. A census counting only comparisons would report '0 overshoots' identically whether PP0 never overshot or no told value ever arrived. The census prints all five on a fixed cadence, and the per-event line is rate limited with its occurrence number. Desk: py_compile green, AST matched check passed, import smoke binds the method, ruff clean on the added lines (the file's 105 findings are all pre-existing and untouched). Behaviour: none -- the caller does not read a return value and the clamp predicate is unchanged. Boot 28 is a MEASUREMENT boot and may die at the known blocker; the harvest is this distribution up to and including the death. Analysis: DESIGN_968_PP0_AUTHORITATIVE_STATIC_HALF.md 5c-CORRECTION.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 31, 2026
… the epoch, not to a rank's span Boot 30 died 1 minute into load. `#1059c` gave the row a sender for the first time, a told prefix of 12288 arrived, and it was applied to a request the cutover had just re-admitted -- whose pinned span was legitimately 0, because that same cutover dropped the tree one line earlier (`RESIDENTS RELEASED ... the prefix tree dropped returning 15943 row(s)`). `uniform_pass_geometry` raised `UniformWidthPromiseBroken` and crashed the group. The told value was not wrong. It was STALE ACROSS A CUTOVER, and the guard's premise -- "told <= pinned holds by construction" -- is true only WITHIN one cutover epoch, which nothing enforced. THE TRIGGER IS THE EPOCH AND NOT THE LOCAL SPAN, and that is the whole design. The obvious formulation -- "void when told exceeds MY pinned span" -- reads a RANK-LOCAL quantity and is therefore the 26th divergent input into the one replicated decision. The guard's own message already forbids exactly that: "compensating locally here would move the batch and reappear as sgl-project#631 on a peer." `PhaseFlipRuntime._epoch` advances once per COMPLETED cutover on every rank and the runtime's consensus reduction raises DESYNC if two ranks disagree, so `row.decided_epoch != current epoch` yields the SAME verdict everywhere without any rank consulting its own state. * PP0 stamps `decided_epoch` at PUBLICATION (the instant the row becomes a promise to the group). A relaying rank re-sends the raw row verbatim, so the epoch that travels the chain is PP0's. * The column rides at the END of the wire row under the same index-and-width discipline as sgl-project#987's pair and sgl-project#968's `load_back_len`. Per ENTRY, not per decision, because the outer payload is unpacked as a FIXED 2-arity tuple -- growing THAT is the fixed-arity crash the row's width tolerance exists to avoid. * The apply compares against the LIVE epoch through a registered read-through accessor, not a cached int: boot 30's apply ran INSIDE `_release_residents_for_cutover`, so a value refreshed per pass would have been one generation stale precisely where the staleness had to be seen. * A mismatch (or an unverifiable half-absent pair) routes into the contract's OWN already-proven no-adopt path -- boot 29 ran it for its whole life without a divergence. That is a way ONWARD, never the boot-15 per-rank refusal that re-fired 1448 times and wedged the ring. * `UniformWidthPromiseBroken` is NOT softened. It stays as the in-epoch invariant's backstop and is now unreachable: if it ever fires again the pin itself has failed, which is a group crash by `raenge-nie-uneins`, as written. SECOND HALF -- #1060b: THE TOLD COUNTER MOVES TO THE APPLY SITE. Boot 30 proved the row arrives by DYING on it, while `sgl-project#1058 TOLD-VS-LOCAL CENSUS` read `evaluated=13 absent=13` on PP0 and `evaluated=0` on the two ranks that crashed. The census sat at the CONSULT -- and PP0 makes the offer and never receives one. A fact's arrival must be counted where it takes EFFECT. `apply_reached` is the denominator; `adopted>0` is the only positive proof that a row travelled AND was applied. Emitted unconditionally at teardown and on the death path, like #1058b. MATCHED CHECK -- red-first at the boot-30 specimen plus the mandatory danger-direction mutant. The replay reproduces the raise with the log's own numbers (told=12288, pin=0), so the gate is proven to be what prevents it; the mutant asserts that the LOCAL-SPAN rule produces a SPLIT verdict across three ranks differing only in their span while the epoch rule produces one identical verdict -- if a future edit swaps the trigger, it goes red. Plus a wiring proof that drives `apply_uniform_pass_geometry_1059` itself with a live epoch source, because the pure-function tests prove the RULE and not that the apply consults it, which is the present-wired-never-populated shape that cost boot 29 a window. 11/11 green, plus 47/47 on the existing sgl-project#1059/sgl-project#791 suites (no regression) and 6/6 on sgl-project#1060. ruff clean on the added lines, py_compile green. Evidence: /spinning/evidence-665-f1/specimen_1060cens_boot30_uniformwidth_crash/
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 31, 2026
… and builds from the row The sgl-project#968 end state, second cut (DESIGN_631_PP0_GEOMETRY_AUTHORITY.md slices 1+3). Boot 631cut died at readmit lap 15 on the same class the /dev/shm bulletin was built against: on the bulletin's stale-epoch laps the DEVICE prefix stayed rank-local (PP1 36575 vs PP2 3807, same rid), and the pass crashed at PP0's output stash (bonus_tokens [2] vs indices [1]). The admission row already rides the proxy frame; what was missing is ORDER. A downstream rank now probes frame presence non-blockingly (the first three exits of _pp_wait_for_dict_readiness, taken once -- never the blocking pre-plan receive sgl-project#1015 deleted), takes the frame BEFORE planning, reconciles its row against local state (_pp_reconcile_incoming_admission and _pp_void_retracted_pass restored verbatim from 01a391f^), and the admission loop EXECUTES that geometry: membership by pp_not_named, prefix by truncate-to-told, shortfall by group-uniform void with observed_local riding the return trip home so PP0's sgl-project#630 guard learns the floor (PP0 defers its raise to the group floor -- the slice the under-coverage counter ordered). No frame posted -> the rank plans nothing for the slot; a locally-derived batch on a frameless pass is voided (counted). PP0's learned-floor clamp re-arms on the same predicate (pp_row_authority_enabled), so the two halves can never be armed apart (sgl-project#1039). The /dev/shm bulletin halves are retired; the match-writer enforcement (cap_req_geometry) stays and is fed from the row (one mover, one payload). Kill switch: SGLANG_PP_ROW_AUTHORITY=0. Matched check (speed mode): py_compile all four files + heavy module import + hermetic wiring smoke (pp_row_authority_enabled gate, plant_from_row round trip) -- ROW-AUTHORITY WIRING SMOKE OK. Metal proof is the boot.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 1, 2026
Companion to LOESCH_INVENTAR_968.md. One test per deleted layer, in the direction that matters: four green guards pin the Schicht-1/2 cut (the strict clause and the runnability oracle stay deleted -- including the structural guard that chunk_blocks_quiescence never regrows its strict=/ prefill_runnable_here= keywords), two RED-FIRST tests define the Schicht-3 cut (take_agreed_reissue and the _reissue_pending ledger must go; the upstream-equivalent hold is per-request check_prefetch_progress). Measured on metal: 5 passed, 2 failed exactly as designed (vote+ledger still present). Only the new test file is committed; the in-flight Schicht-1/2 working-tree edits belong to the rebuild strand.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 1, 2026
… normal path Extends the deletion-falsifier file per F2b's Slice-B call: (a) the resident requeue leaves the release path (deferred carrier _pending_seam_readmit, requeue behind the rebind so the intake prefetch opens on the INCOMING binding) plus the W31 count-law guard (retracted==readmitted survives the move); (b) RED-FIRST pin that the outgoing-binding reissue shim (#1025b reissue_seam_prefetch) disappears -- objectless once (a) lands the first issue on the right binding. Measured against F2b's in-flight tree: 7 passed, 3 failed exactly as designed (group vote, reissue shim, owed ledger -- all awaiting the Schicht-3/ Slice-B cut). One transient extra red during the run was a race against the live edit, re-run clean.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 1, 2026
…only prefetch verdict Against the committed rebuild (8bac764): (c) _post_cutover_readmit exists, consumes the _pending_seam_readmit stash one-shot (exactly one stasher module-wide, explicit None-clear), and carries the sgl-project#1066 POST-CUTOVER FRESH-FETCH execution proof; (d) inside the PP admission arm exactly one prefetch-pending skip exists, it is prefetch_pending_pp0, guarded by pp_rank == 0, and the follower credit-only path survives -- the ballot hold in the non-PP elif arm is the upstream-equivalent per-request hold and deliberately stays outside the pin's scope (first pin draft counted globally and went red on that legitimate arm; scoped to the PP arm). Full file: 13 passed.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 1, 2026
…ot end a pass PP0 launched `_pp_void_retracted_pass` let ONE downstream rank decide that the GROUP's pass ran nowhere. Its own docstring named the return trip that made that safe -- "the void output carries the observed local match home, and PP0's guard learns it as a floor" -- and sgl-project#969 CUT V had already deleted that emitter (`_PP_VOID_OUTPUT_KEY`: zero originating senders at ca0ee3a). The verdict therefore travelled downstream only. PP0's `mbs[slot]` stayed set while the last rank's did not, so no output was ever sent and PP0 blocked in `_do_recv` until the deadman -- the exact invariant `_do_recv`'s own comment relies on ("sender and receiver ask one question of one batch"). Measured, twice, and the second is on the stall second itself: 1068cap 07:34:02-09 sgl-project#797 void on rank 1 ONLY (no void/retract line on PP0 or PP2); PP0 parked, PP2 spinning. 1069cohort 08:00:54/55 sgl-project#791 unhonourable on PP1, told=12493 local=8397 then told=13399 local=12493 -- `local` exactly one pass behind `told`. After 08:00:55 only ranks 1 and 2 emit at all (slot_occupant / output_fill / width_agreement run to the takedown at 08:13:32, 4177 and 7973 lines; rank 0 emits nothing). That last measurement also refutes the occupant-sleep node as the halting member: ranks 1 and 2 are alive and turning; the `sgl-project#1000 SLOT-OCCUPANT reasons={'no-statement'}` spin is an INERT probe whose carrier sgl-project#1015 EDIT-F made permanently None. The only halting member is PP0's unbounded output receive. Repairing the return trip would repair a compensation layer for a rank-local verdict, which is the arc the sgl-project#968 order forbids continuing; under upstream-minimal the repair carries the burden of proof and the deletion does not. So the verdict is deleted and the disagreement is DETECTED instead (RAENGE-NIE-UNEINS: a detected divergence stops the group, never a compensating wait): * `_pp_assert_told_honourable` replaces it -- an unhonourable told names rank, slot, rid, told and local and raises. No clamp: clamping to this rank's own local match is rank-local geometry, i.e. sgl-project#631. * The chain-receive throttle arm gets a horizon (SGLANG_PP_OCCUPANT_HORIZON_S, default 90 s, 0 disables) and a named stop. Taking the arm is legitimate and frequent; outliving it never is. * `PpChainReceiver.recv` is bounded the way its sibling `consume_up_to` already was (runaway guard + reported counter), and the launcher now sets SGLANG_PP_CHAIN_RECV_STALL_S=60 -- the sgl-project#824 mechanism has existed since 2026-08-24 and shipped disabled by default, which is why it never fired in either stall. (A-i) is WITHDRAWN rather than built: its counter proof is blind at that site (the rendezvous bumps `sent` only on recv entry) and the DEFER one-shot is itself compensation for the rank-local verdict this commit deletes, so its trigger is removed at the source. Its two red-first tests are replaced by zombie tests for the deletion. Desk evidence: hermetic import + AST (deleted verdict absent, watchman and horizon present, recv bounded); test_968_deletion_falsifiers 24 passed, 1 failed -- test_C_the_void_relay_is_wired_or_deleted_but_never_half_built, which stays red until the relay SYMBOLS are swept out too. The relay is already unreachable at runtime (no rank originates a void any more, and `_pp_absorb_void_output` has no caller in production), so that sweep is a dead-code deletion scheduled beside this commit, not a runtime dependency of it. Belegstufe: DESK-BEWIESEN. Boot pending.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 1, 2026
…sends, nobody relays, one rank absorbs sgl-project#969 CUT V deleted the void-output EMITTER on the premise that the batch is the verdict ("sender and receiver ask one question of one batch"). What it left behind was the rest of the arc, and the arc has been dead ever since: _PP_VOID_OUTPUT_KEY: True constructed at exactly ONE site -- inside _pp_absorb_void_output, i.e. only when re-forwarding a void already received. Zero originating senders. _pp_void_forward_payload 1 writer, 0 readers. Computed and never sent. _pp_absorb_void_output 0 call sites (ast over python/sglang). pp_void_forward_payload called only from the absorber. pp_void_relay_stop_rank called only from the forward payload. pp_void_relay_launched_verdict same. pp_first_retracting_rank called only from the forward payload. A closed orphan subtree, whose own docstring states the sgl-project#801 relay invariant it can no longer keep: "a non-last rank that took exactly one message off this wire for a ring generation must put exactly one back on it, void included". WHY DELETED AND NOT WIRED. Wiring it back means rebuilding the second bookkeeping sgl-project#969 CUT V removed, and under the upstream-minimal law (user order 2026-08-29) repair carries the burden of proof that upstream semantics cannot carry the goal. It can: PP0 owns the verdict and the travelling batch is the verdict. Half a relay is the worst of the three states -- PP0 parks on an output the mid-rank void swallowed and its successor throttles on an occupant nobody will speak for, which is the shape both measured stalls took (1068cap 07:34:09 and 1069cohort 08:00:55, roles swapped, same halting node). Tests of the deleted mechanism go with it rather than being patched green: the five files whose SUBJECT is the void relay (sgl-project#797 retracted-pass void, sgl-project#798 chunked-retracted void slot, both sgl-project#801 relay files, #791b output-ring retraction), plus test_pp_continuation_cross_slot_rehome_968b (28 of its 30 tests drive the deleted absorber transitively) and test_pp_void_lock_ref_969 (its harness is the deleted method). Files that merely mentioned it keep their pins; only the individual test that exercised the deleted site is removed. Comments naming a deleted symbol are rewritten rather than left to send the next reader after a ghost. Desk-proven: py_compile + import smoke (scheduler and mixin), the sgl-project#968 deletion falsifiers 25/25 with the wired-or-deleted-but-never-half-built contract now green by the deletion arm, ruff unchanged at 104 pre-existing findings on both touched files (baseline taken from HEAD under the same config).
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 3, 2026
…; one timeout source; the store witness replaces the seam stamp ROOT (boot weg1b3 @ 6980c75, rid 679e4568, 84,027 tokens, cutovers 3+4): _prefetch_timeout_check_linear_func charged base + len(hash_value) x per_page and hash_value is empty until the serial prefetch thread's store probe has run, so the every-pass drain reaped the LONG re-admission at the bare base (effective 1.0 s: the sgl-project#968/sgl-project#1065 re-pricing 2.0/1.0 was a pair of dead locals overwritten by the hybrid parse's 1/0.25) with completed=0. The store had the pages; nobody asked it in time. phase_purity then counted the retract stamp as 'restored' and licensed a P=0 TP prefill (6 x 4096 recomputed). FIX F1a unified_radix_cache.py: _prefetch_priced_pages = len(hash_value) or len(token_ids)//page_size; _prefetch_timeout_budget_s = base + pages x per_page; the linear check compares against it (hiradix sibling same form under its own cfg.max; hi_mamba unreachable, registry.py:106-107). The unified budget is deliberately UNCAPPED (no PrefetchTimeoutConfig.max): an unprobed 1M-token op prices ~1000 s and admission waits on it through the PP0 _prefetch_done_for hold. Named, not hidden. F1b one timeout source: hybrid_cache_controller.parse_storage_backend_ extra_config pops its defaults from PrefetchTimeoutConfig (2.0 s + 1.0 s per KiToken); dead 2.0/1.0 locals and the 3.0/0.25 re-attach literals deleted; 'sgl-project#1157 PREFETCH TIMEOUT base= per_ki_token= source=' printed once per attach. F1c the reap is a line: 'sgl-project#1157 PREFETCH REAPED req= probed= requested_pages= hit_pages= completed= elapsed= budget=' per termination that is not a local completion. PrefetchOperation.probed_hit_tokens is stamped by the prefetch thread after its MIN; the record the admission loop pops (prefetch_loaded_tokens_by_reqid) is a PrefetchOutcome(int) annotated with hit_tokens/probed, written at completion, reap and revoke. F1d the seam premise is a measured witness: store_witness() reads the tree's own prefetch state (pending / hit / bounded / cold / unprobed); the `cache_protected_len>0 or cached_prompt_tokens_at_retract>0` stamp arm is DELETED. StoreWitnessContradiction is raised from the premise and from both admission arms and re-raised through the three fail-open probes; it leaves get_next_batch_to_run uncaught and is the group STOP (run_scheduler_process -> SIGQUIT), never a P=0 admission. REVIEW FIX (operator decisions 2026-09-03): B1 PrefetchOutcome now round-trips pickle/copy.deepcopy: positional __new__(loaded, hit_tokens=None, probed=False) + __reduce__. The keyword-only form survived dumps but not loads and rode req.storage_hit_length -> cached_tokens_storage -> details['storage'] -> send_pyobj -> detokenizer death on the first partial store hit. Both admission writes store int(loaded_tokens). Int subclass kept over a dataclass: smaller diff, every existing int reader untouched. B2 beside a stamp the witness MEASURES the stamped span: 'hit' only if loaded > 0 and stamp - hit_tokens <= one HiCache chunk; allowance = tree._prefetch_chunk_tokens (chunked_prefill_size, the one-chunk bound the sgl-project#1068 L2 truncation line already prices; fallback prefetch_threshold when the tree has no term). A revoke (loaded=0, the 40-token chat header answering every probe) or a probed shortfall beyond the allowance beside a stamp is a contradiction. Cold requests (stamp 0) keep today's reading. B3 raise text renamed to 'sgl-project#1157 STORE WITNESS CONTRADICTION ...' and the class to StoreWitnessContradiction: 'SEAM RESTORE' tripped the sgl-project#1068 seam-copy zombie gate (test_968_seam_copy_deleted_1068 red on R1, green now). Functions renamed store_witness / assert_store_witness_at_admission. N1 rank-uniform reap annotation: probed (MIN) and hit_tokens (MIN) ride two extra slots of the EXISTING packed all_reduce in check_prefetch_progress (the one that reduces min_completed_tokens); the record and the REAPED line are derived from the reduced vector only, never the thread-timing stamp. No new collective. N2 phase_policy.py hold reason now names the store witness instead of 'premise verified on the retract credit'. POPULATION CHANGES NAMED: (a) 'bounded' state: a stamped request shorter than prefetch_threshold counts as restored (no read can exist; recompute bounded below the threshold; the /health_generate shape). (b) A stamped request with no record, no ongoing prefetch and a prompt >= threshold (rate-limited, storage off, deferral refused) is now 'cold' -> premise refused -> exemption closed, where the stamp used to open it. (c) A mixed queue still opens on the witnessed request and a cold sibling rides at P=0 (pre-existing); the boot-4 count 'sgl-project#1157 PREFETCH REAPED probed=False completed=0' = 0 for retract re-admissions is the metal proof no LONG rides at P=0. (d) PP followers (pp_rank>0) run assert_store_witness_at_admission too: a follower raising is a process death via SIGQUIT (a STOP), not a verdict; it is not gated to pp_rank==0 here. RANK UNIFORMITY of the witness inputs: ongoing_prefetch removed only after the group MIN / under the drain barrier / at the cutover sweep; prefetch_loaded_tokens_by_reqid written from the reduced vector (N1) or on the revoke path whose enqueue the prefetch thread's MIN precedes; prefetch_deferred set from a rank-local counter but cleared/retried under the group gate (sgl-project#1068 slice 3 fix). TESTS (hermetic, CUDA_VISIBLE_DEVICES="" PYTHONPATH=<tree>/python) test/registered/unit/mem_cache/test_1157_reaper_prices_requested_span.py (20) test/registered/unit/managers/test_1157_seam_witness.py (25) Red measured before the fix on the R1 build: pickle.loads/deepcopy TypeError; _witness_from_outcome(stamp=80009, PrefetchOutcome(0,hit=40,probed)) == 'hit'; (4096,hit=4096) beside 80009 == 'hit'; no _reap_annotation_from_packed; no StoreWitnessContradiction. On the parent e63fd08 both files fail at collection (PrefetchOutcome / StoreWitnessContradiction absent). Inverted tests carry withdrawal docstrings: 861j test_a_stamp_without_a_store_read_no_longer_opens_the_gate, W30 test_a_stamp_alone_no_longer_opens_the_exemption, 968 test_premise_with_stamps_and_host_content_no_longer_holds_alone. Mutants killed (5/5): M1a keyword-only __new__ restored -> 2F; M1b int() dropped at the TP admission site -> 1F; M2 shortfall term dropped -> 2F; M3 reap annotation read from the local stamp -> 1F; M4 'SEAM RESTORE' token restored -> 3F (incl. the sgl-project#1068 zombie gate). SUITE (bounded selection, identical on both trees: test/registered/unit/ mem_cache + distributed/test_prefetch_progress_symmetry_580.py + managers test_*phase_purity*/test_*phase_policy*/test_*seam* minus test_phase_flip_spec_seam_631.py + test_968_starvation_umbau.py + test_tp_decode_formation_861j.py; pytest -q -p no:cacheprovider -rf, single process; the two new files EXCLUDED from the parent run, appended on the fixed run): parent e63fd08 (scratch worktree): 125 failed / 3446 passed / 927 skipped (174 s) fixed (this tree): 125 failed / 3492 passed / 927 skipped (172 s) per-test FAILED-id diff (comm): 96 FAILED ids on each tree, IDENTICAL sets (comm -13 and comm -23 both empty): 0 new failures, 0 newly passing; +46 passed = the 45 new tests plus one (not attributable from -q output; FAILED, ERROR and skipped sets identical) pre-existing failing files (parent, top): test_phase_policy.py 35, test_pool_invariant_live_double_912b.py 12, distributed/test_prefetch_progress_symmetry_580.py 8, test_seam_abandon_cap_631.py 7, test_mamba_double_free_924.py 5. Ruff parity measured per touched file (fixed / parent): cache_controller 14/14, phase_policy 0/0, phase_purity 0/0, scheduler 102/102, hicache_storage 0/0, hiradix 1/1, hybrid_cache_controller 0/0, unified_radix_cache 1/1, 968 0/0, W30 5/5, 861j 9/9; new files 0/0; totals 132 = 132. Not claimed clean. EVIDENCE TIER: DESK-PROVEN. Boot 4 proof lines: 'sgl-project#1157 PREFETCH TIMEOUT base=2.00s per_ki_token=1.00s source=PrefetchTimeoutConfig' once per rank; 'sgl-project#1157 PREFETCH REAPED ... probed=False' = 0 lines for retract re-admissions; 'HiCache prefetch success req=<LONG> completed_local=N>0' at the first pp_to_tp cutover; 'sgl-project#788 ADMIT ... prefix_lens>0' for the LONG; 'sgl-project#1157 STORE WITNESS CONTRADICTION' genuine count 0 (trapsafe_count.py --marker 'sgl-project#1157 STORE WITNESS CONTRADICTION' --genuine-regex 'RuntimeError: sgl-project#1157 STORE WITNESS CONTRADICTION|StoreWitnessContradiction: sgl-project#1157'); a nonzero is a group STOP naming rid/stamped/probed_hit/loaded/ allowance/shortfall.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 3, 2026
…follower speaks before it can be stuck
boot_855_weg1b5_cd5bb69607_0903_115008, rid 0c34259f, 11:55:13-11:55:30.
All three ranks issued the same re-admission prefetch (gen 4, keys=13224,
byte-identical FETCH CAP lines). PP0's completed in ~3 s, printed
completed_synced=12288, and ADMITted prefix_lens=12288. PP1's and PP2's had
not terminated. PP1 took the forwarded row into execute_scheduled_prefix and
raised the designed group STOP 14 s later. The number PP0 admitted on was
rank-local by construction: the MIN reduce behind "completed_synced" runs
only under tp_world_size > 1, and this boot is --tp-size 1 --pp-size 3 --
attn_reduce_world=1 on 307/307 HICACHE-ROUND lines of the whole log.
E1 managers/pp_prefetch_completion.py (new, pure, no I/O, no clock) plus a
per-rid completion carrier on the sgl-project#791 ring lap, modelled exactly on
sgl-project#968's parked-continuation table (stamp on the way up, absorb at PP0).
No new all_reduce, no new message, no new blocking point on the
admission path -- the PP0-authority order records a collective there as
fatal. PP0 admits only when the group floor covers what it wants to
schedule; a peer that is silent or still running contributes NO NUMBER
(INCOMPLETE, never a zero), otherwise the rid is DEFERRED by name while
other work proceeds. When the same length-priced bound the follower's
own wait uses expires, PP0 CLAMPS to the group floor through the
existing sgl-project#1059 note_observed_coverage channel instead of over-telling.
want <= 0 (no store span) admits unconditionally, so a boot with no
storage hit takes exactly the pre-sgl-project#1175 path. Kill switch
SGLANG_PP_GROUP_COMPLETION=0 restores the old admission for an A/B.
completed_synced now prints synced=yes|no and attn_reduce_world=N beside
itself, so the field can no longer claim a sync it did not do.
E2 pp_admission_congruence.execute_scheduled_prefix now DRIVES the writer it
used to suspend: after each poll it calls check_prefetch_progress when
the tree reports that path collective-free (world 1 = every all_reduce
skipped by construction), and the expiry text carries
prefetch_driven_in_loop=<bool> so an expiry can never be read as "the
bytes were not there" when nothing drove the sole writer. Bounds
unchanged. The sgl-project#1157 reaper's comment now states where it structurally
cannot fire (it reports terminations; a prefetch that never terminates
produces no line, so 0 REAPED is not evidence that nothing was reaped).
E3 Every follower prints one bounded "sgl-project#1175 PREFIX-EXEC UNDER-COVERAGE"
line at ENTRY, before any bound can expire, naming rid/local/scheduled/
deficit/bound. PP2 printed nothing at all about this rid and its silence
was indistinguishable from health. The line also states honestly that a
rank which never RECEIVES a decision row never calls this function and
therefore still emits nothing -- that case is what E1+E2 remove.
E4 (a) the healthy local == scheduled path no longer returns silently: one
bounded, counted "sgl-project#968 PREFIX-EXEC no-op" line, so "0 materialised lines
on the whole boot" reads as "never needed" rather than "never reached"
(INDIKATOR-GESETZ). (b) the sgl-project#939 census line now names its population
(population=retract_closure_only) -- SEAM_READMIT_ATTR is stamped only
by the retract closure, so the two 13225-token queue-occupant
re-admissions of this boot produced not one census line. The field is
placed BEFORE fence_proceeds so sgl-project#1068's tail pin still holds.
EVIDENCE (DESK-PROVEN; no boot, no GPU)
red-first, parent cd5bb69 + only the three new test files:
16 failed, 3 passed, 1 collection error (pp_prefetch_completion absent)
fixed tree: 36 passed (25 managers + 11 mem_cache)
mutants: 12/12 killed, >= 3 per decision (E1 x4, E2 x3, E3 x3, E4 x2)
matched checks re-run on the fixed tree: test_pp_admission_congruence_791,
test_968_starvation_umbau, test_968_deletion_falsifiers,
test_producer_phase_census_631, test_double_prefill_census_fence_1068,
test_producer_phase_census_wiring_1061 -> 114 passed, 1 failed
(test_the_module_imports_no_torch_at_all -- identical failure on the
parent, "import torch" count 1 on both trees: pre-existing)
bounded suite once, -n 8, hermetic, managers + touched mem_cache files:
parent 262 failed / 5435 passed / 12 errors
fixed 286 failed / 5472 passed / 12 errors
name-level comm: 35 "regressions" and 11 "cures", ALL of them inside
test_unified_radix_cache_unittest.py; 0 outside it, 0 involving the new
files. That module run SOLO and SERIAL is 642 passed / 860 skipped /
0 failed on BOTH trees -- the delta is the known -n 8 crowding family
(sgl-project#862/sgl-project#899), not this diff.
ruff --select=F401,F821,UP037: 2 errors on both trees, the same two
pre-existing ones; black/isort per file identical on both trees for all
five touched production files, all four new files clean.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 4, 2026
…(matched+loaded), not loaded alone BOOT weg1b6 @ 06a605f, log boot_855_weg1b6_06a605fc20_0903_160236.log:134985-134996. rid 1e95e023, stamp 6008, allowance 4096, three ranks re-admitting one prefix after a cutover: PP1/PP2 completed_local=6008 matched=5966 loaded=42 PP0 REAPED at 7.87 s (policy=timeout, queue-lagged behind its siblings in the cutover burst -- the mirror of sgl-project#1175): completed_local=3456 matched=3456 loaded=0 sibling ce45cd48 seconds earlier: matched=40 loaded=5971 (path B WORKS) matched + loaded == completed_local on every line. PP0 raised StoreWitnessContradiction (stamped=6008 probed_hit=6008 loaded=0 shortfall=0) and STOPped the group, although 3456 tokens WERE present: shortfall 2552 is inside the one-chunk allowance = a sanctioned sgl-project#939 bounded re-prefill. ROOT: phase_purity.py:1388-1425 `_witness_from_outcome` read `loaded` alone and ignored `matched` (the already-device-resident prefix, unified_radix_cache.py:4140-4145 `insert_result.prefix_len`). CLASS: the instrument measured the TRANSFER instead of the PRESENCE -- the same class the sgl-project#841 comment names for `loaded` at unified_radix_cache.py:4136-4139. FIX - hicache_storage.py PrefetchOutcome gains positional-with-default `matched` plus the read-only `materialized` = matched + loaded; __reduce__/__repr__ carry it (review-B1 lesson kept: positional ctor, survives pickle.loads). int(outcome) stays the loaded count, so every existing reader is unchanged. - unified_radix_cache.py:4148 passes matched=insert_result.prefix_len (the complement of loaded against completed_synced, host_span_unclaimed branch included). The revoke drain near :4617 passes matched=0 with the reason named: a revoke ran no insert, so no measured resident prefix exists there. - phase_purity.py judges presence = outcome.materialized; shortfall = stamp - presence; "hit" iff presence > 0 and shortfall <= allowance. The raise now prints matched= and materialized= beside loaded= and says "shows nothing materialized" vs "fell short ... by more than one chunk". A bare-int record (hiradix_cache.py:1937, hi_mamba_radix_cache.py:2364) keeps its old reading unchanged. probed/unprobed/cold untouched. EVIDENCE - red-first, final test file on parent 06a605f (scratch worktree, new file only): 12 failed / 1 passed. Green after the fix: test_1176_witness_materialized.py + test_1157_seam_witness.py 36 passed. - mutants: m1 `materialized` ignores matched -> 7 failed (case (a) red); m2 allowance comparison removed -> 5 failed (case (c) red, plus two sgl-project#1157 shortfall pins). Both reverted. - tool check: import smoke of the three modules OK; ruff parity per file 0/0/0 against the parent, new test file clean. RANK UNIFORMITY (reported, NOT built) Boot 6 raised on PP0 only (1 occurrence, PP0-tagged): PP1/PP2 held loaded=42 and read "hit", PP0 read "contradiction" -- the ranks DID diverge on this verdict. Under --tp-size 1 --pp-size 3 the N1 packed MIN all_reduce is not taken (`if self.tp_world_size > 1`, unified_radix_cache.py:3879-3907; attn_reduce_world=1 synced=no on every sgl-project#1028 line of this boot), so the record is rank-LOCAL and every rank evaluates seam_transport_premise_holds independently (phase_purity.py:1009 <- scheduler.py:8925, which runs on all PP ranks). The sgl-project#1064/sgl-project#1175 carrier runs the WRONG WAY for this: it is follower->PP0 by construction ("PP0 is the only consumer", scheduler_pp_mixin.py:2174-2191). There is no PP0->follower channel for the seam premise, so no one-line "skip verdict, take PP0's told prefix" exists; building one would be a second mechanism. Filed as a raenge-nie-uneins hazard for the sgl-project#968 PP0-authority rebuild instead.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 4, 2026
…was asked for, and only the rank that owns the verdict may STOP the group Three blocking findings from the adversarial review of 4b277ff, each re-verified at file:line on that tree before the edit. (b) PRESENCE UNDER-COUNTS BY THE REGISTRATION-TIME MATCH -- the same class as sgl-project#1176 itself, not closed by it. `matched` is `insert_result.prefix_len` (unified_radix_cache.py:4140-4148): the prefix of the FETCHED SPAN the tree already held, NOT this request's whole device-resident prefix. The span excludes what was matched when the prefetch was registered -- scheduler.py:5322 `_matched_len = len(req.prefix_indices) + req.host_hit_length`, :5350 `_new_input_tokens = full_untruncated_fill_ids[_matched_len:_match_end]`, handed to unified_radix_cache.py:3271 -- while the stamp is the WHOLE prompt prefix (schedule_batch.py:2593). So `matched + loaded <= stamp - _matched_len` BY CONSTRUCTION. Demonstrated on 4b277ff: stamp=20000, matched 10000 at readmit, a 9999-token span completed IN FULL -> raised with shortfall=10016 on a prefix that was 19984/20000 present. Boot weg1b6 hid it because the tree was reset at the cutover (_matched_len 0, span == stamp); it becomes MORE reachable exactly as the store starts serving, because `host_hit_length` feeds `_matched_len`. FIX: `demand = min(stamp, span)` where the span is the rank-local stamp scheduler.py:5354 already writes (`req._prefetch_span_tokens`, one writer, written in the same call that registers this prefetch) -- no new plumbing. `min` keeps the stamped prefix as the ceiling for an output-bearing request whose `_match_end` runs past its prompt. A record whose request carries no span stamp keeps the stamp as the demand (unchanged reading). The raise now prints span= and demand=. (f) TWO OF THE REVIEW'S OWN MUTANTS SURVIVED on the axis this work is about. MUT-B (`shortfall = demand - presence` -> `- hit`) survived because every case in both files had hit == presence: nothing separated "the probe ANSWERED" from "the prefix is MATERIALIZED". Pinned by class H -- stamp=6008, hit_tokens=6008 (probe answered the whole span), matched=0, loaded=100: correct verdict RAISE (shortfall 5908 > 4096), mutant verdict "hit" = admission at P=100 against a 6008-token stamp, the exact kein-doppel-prefill violation the witness exists to prevent. MUT-C (`presence > 0` -> `>= 0`) survived because case (d) reaches the raise through the SHORTFALL arm, so the "nothing materialized" term was never load-bearing. Pinned by class I -- stamp=100 (inside the 4096 allowance), presence 0: the raise is reachable ONLY through that term. (d) RANK DIVERGENCE ON THE VERDICT, measured on boot weg1b6 and previously filed as a hazard instead of fixed. The packed MIN all_reduce over the prefetch group is taken only under `tp_world_size > 1` (unified_radix_cache.py:3879-3907) and that boot ran --tp-size 1 --pp-size 3 (`synced=no attn_reduce_world=1` on every sgl-project#1028 line), so every rank evaluated its own record: PP0 raised, PP1/PP2 read "hit". Any completed-span spread wider than the allowance splits the verdict, and the dangerous half is a FOLLOWER dying while its peers admit and enter a collective one rank short. Both reachable sites are covered: seam_transport_premise_holds (phase_purity.py:1009 <- scheduler.py:8925, the site that raised in weg1b6) and both admission arms (scheduler.py:11298 / :11351 -- and the PP arm runs on EVERY rank of the group, not only PP0). FIX uses the authority that already exists rather than a second channel: `witness_stop_authority` = PP0, or any world that is not a pipeline group (there the record is the only one or MIN-reduced). sgl-project#968 names PP0 as the single verdict site and the #969Z note in that same loop already says followers "credit only and decide nothing". A follower now REPORTS -- returns the state "contradiction", deliberately absent from the tuple `seam_transport_premise_holds` accepts, so it licenses nothing -- with a rate-limited WARNING naming the divergence. This is not compensating a recognised disagreement (raenge-nie-uneins): a follower cannot SEE PP0's presence, so there is no disagreement to recognise; it declines a verdict it was already declared verdict-free for. A stand-in without a pipeline identity is its own authority -- absence of `ps` must never silence the witness. EVIDENCE - red-first on the parent 4b277ff (the new cases only; test_1157 was untouched and green there): test_1176_witness_materialized.py 7 failed / 20 passed. The 7 are the four span cases (b) and the three follower cases (d); H and I are mutant-killers and pass on correct code by construction. - after the fix, both witness files: 50 passed (test_1157 23 + test_1176 27). - mutants, one per finding, all killed: M-b span never narrows the demand -> 3 failed M-f1 shortfall = demand - hit (MUT-B) -> 3 failed M-f2 presence >= 0 (MUT-C) -> 1 failed M-d every rank is the authority again -> 2 failed Each reverted from a pristine copy; `git diff --stat` clean afterwards. - two existing pins updated because this commit changes their subject, not their claim: test_1157's admission-site regex now demands the `is_authority=witness_stop_authority(self)` call form on BOTH arms (it still pins two arms, the tree, and the int(...) credit), and its message pin carries the new span=/demand= fields. - tool check: import smoke of phase_purity / scheduler / hicache_storage / unified_radix_cache OK plus a direct authority-predicate probe (pp0=True, follower=False, no-ps=True); ruff clean on phase_purity and both test files, scheduler.py 103 = 103 against the parent (pre-existing). NOT CHANGED, named - The bare-int record path (hiradix_cache.py:1937, hi_mamba_radix_cache.py:2364) keeps its old reading; probed/unprobed/cold are untouched; the 40-token chat-template false hit still STOPs. - `_prefetch_span_tokens` is rank-local and stamped at registration. It is paired with the record this witness reads (same call), which is why the narrowing is safe; a stale-LARGER span cannot widen the demand past the stamp, and a missing one falls back to the stamp.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 4, 2026
…ves, presence is the sum, and a follower never splits the group silently Closes the three blocking findings of the be3ec17 review. B1 (LAW WEAKENING). be3ec17 derived the demand from req._prefetch_span_tokens, a number stamped once at registration (scheduler.py:5355) that nothing in the tree ever clears. Req.truncate_prefix_to (schedule_batch.py:2357, called from scheduler.py:11495 and :10975 under the sgl-project#791/sgl-project#930 PP-told rule) empties prefix_indices AND host_hit_length and leaves that span standing, and the premise path re-reads the record non-destructively on every pass (phase_purity.py:1631). Worked breaking input: stamp 80009, registration match 79000 -> span 1008; the prefetch delivers 1008; PP0 then tells told=0 and the device-resident prefix is gone; the next pass read demand=min(80009,1008)=1008 against presence 1008 and called it a "hit", licensing a P=0 re-prefill of 79001 tokens on a stamp -- the exact kein-doppel-prefill (sgl-project#939) violation this witness exists to prevent. The parent RAISED on that record; the reviewed commit did not. FIX (the preferred remedy, upstream-minimal): the demand is max(0, stamp - resident) with resident = len(req.prefix_indices) + req.host_hit_length read AT WITNESS TIME -- the same expression the registration site computes. A truncation restores the full demand by construction: no new state, no clearer, no lifecycle to keep in step. phase_purity no longer reads _prefetch_span_tokens at all (AST-pinned); the field keeps its one legitimate consumer in scheduler.py. B2 (UNCAUGHT MUTANT). presence = matched + loaded is the single arithmetic the whole sgl-project#1176 fix turns on, and no case separated it from max(matched, loaded): every one had matched==0, or loaded==0, or a split whose larger half still landed inside the allowance. Shipped code was correct; the regression pin was missing. Added the separating input (stamp 20000, matched 9000, loaded 9000, allowance 4096: sum -> shortfall 2000 = hit, max -> shortfall 11000 = raise) on the property, on the witness, on the admission site, and on the duck-typed getattr default. B3 (A LOUD STOP TRADED FOR A SILENT RANK DIVERGENCE). be3ec17 made a follower stop raising -- correct under sgl-project#968/#969Z -- but left the returned state outside the tuple seam_transport_premise_holds accepts, so the follower still WITHHELD the seam premise. That boolean gates the whole prefill-batch build (phase_purity.py:1009 -> scheduler.py:8926 new_batch = None) and store_witness reads RANK-LOCAL records: under --tp-size 1 --pp-size 3 the packed MIN all_reduce (unified_radix_cache.py:3879-3907) is never taken. Measured input from weg1b6: stamp 6008, PP0 matched=5966/loaded=42 -> hit -> premise True; PP1 reaped at matched=100/loaded=0 -> contradiction -> premise False. Mismatched collectives -- a silent split, which raenge-nie-uneins forbids more strongly than the loud stop it replaced. FIX = option (ii) of the three offered: the follower COUNTS the candidate (taking PP0's standing verdict, #969Z) and REPORTS the contradiction on the EXISTING follower -> PP0 completion carrier (sgl-project#1175), where PP0 raises once, loudly, naming the peer. Option (i) -- making the whole premise PP0-anchored -- was not built: there is no PP0 -> follower channel for this verdict at that point in the pass, so it would have needed a new message or a collective on the admission path, and a collective there is a recorded fatal under the PP0-authority order. Option (iii) (restore the loud follower raise) was not built either: it is the very trade the review rejects, and it kills the follower while its peers admit. pp_prefetch_completion gains a CONTRADICTION sentinel (never min()'d into a floor, same rule as PENDING) plus the pure helper peers_reporting_contradiction, read in _admit_under_group_completion BEFORE the `want <= 0` early-out -- the dangerous combination is exactly "PP0 fetched nothing while a peer measured a contradiction". Evidence. Red-first on the parent be3ec17 in a scratch worktree with ONLY the two test files copied in (source untouched, git status shows two test paths): 16 failed / 52 passed -- 10 on B1 (classes G/K + the message pins in C and test_1157) and 6 on B3 (class M). B2 is green on the parent by construction (shipped code correct) and is proven by mutant M3/M4 instead. Fixed tree: 68 passed / 3 subtests. Neighbour suites (869c, w30, 968, 861j, 1173, 1068, 1060) 198 passed with 2 failures in test_tp_decode_formation_861j that reproduce identically on the parent worktree (pre-existing, not this diff). ruff parity per touched file against the parent: identical (0 findings each). Hermetic import smoke of all four edited modules passes.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 4, 2026
… the span reading, and every rank raises on its own contradiction
CLASS 1 -- the presence frame (boot-killer direction).
Round 3 compared `matched + loaded` against the WHOLE retract stamp and
deleted the residency term. That frame is wrong in the direction that
kills boots: a request whose prefix is already ON THE DEVICE contributes
nothing to the span reading, so a stamp covering the full prompt reads as
a shortfall the size of the resident head.
The frame is now
resident = len(req.prefix_indices) # device-resident head
span_present = outcome.materialized # matched + loaded
presence = resident + span_present
shortfall = stamp - presence
and the gate is `presence > 0 and shortfall <= allowance` -- the
`presence > 0` requirement is PART of the gate, not a branch above it, so
"nothing present at all" can never be waved through by a small stamp.
WHY THIS SHAPE (tree facts). `span_present` covers only
[registration_match, ...) by construction -- the prefetch is registered
against a span, and `matched + loaded == min_completed_tokens` is an
algebraic identity OVER THAT SPAN (unified_radix_cache.py:4022,
:4140-4145). The head below the registration point is exactly
`len(prefix_indices)`, read at a point where `match_prefix_for_req`
(scheduler.py:10524, calc_priority) has already run and `init_load_back`
(schedule_policy.py:2272) has not -- the witness fires at :11336/:11398,
inside the admission loop at :11122. `host_hit_length` is deliberately
NOT added: after init_load_back `len(prefix_indices) = device_original +
host_loaded` while `host_hit_length` is never cleared
(schedule_batch.py:3637-3645), so adding it double-counts the load-back.
HONEST about the overlap: round 2's disjointness argument does NOT hold as
stated. `resident` and `matched` can overlap by up to min(resident,
matched). Both terms describe REAL present tokens, so the error is a
double COUNT of real presence, never invented presence -- the witness can
only ever be too lenient by that margin, never falsely loud. The
non-over-crediting alternative `max(resident, matched + loaded)` was
FALSIFIED and is recorded in the `_witness_from_outcome` docstring: it
raises on the reaped-partial-fetch shape that sgl-project#1176 itself is an instance
of (PP0 reaped at the 7.87s budget with completed=matched=3456, loaded=0).
R3 TESTS INVERTED, NOT WORKED AROUND. test_1176_witness_materialized.py
class G was `G_PresenceIsJudgedAgainstTheWholeStampedPrefix` (:366, :391,
:411, :432) and demanded a RAISE on exactly the shape this round declares
a HIT. Those four are now
`G_PresenceIsTheResidentHeadPlusTheSpanReading`, each annotated with the
r3 pin it inverts and why the r3 reading was the boot-killer. Classes J
and M (the carrier tests) are DELETED with comment blocks naming the three
deletion proofs in their place. Classes A-F, H, I, K, L are untouched --
they construct requests with prefix_indices empty, so the new term is
zero for them by construction.
CLASS 2 -- the contradiction carrier is DELETED (licensing direction).
Rounds 2+3 built a follower->PP0 report channel so a follower could ADMIT
on a contradiction while PP0 raised a lap later. Round 3's own review
proved it cannot deliver on three independent axes:
(a) ONE-LAP LIFETIME -- scheduler_pp_mixin.py:2315-2317 wipes the
reporting rank's whole table slice every lap;
(b) FIRST-PASS UNREACHABLE -- the contradiction is measured on the same
pass the follower must decide;
(c) phase_purity.py:1927 counted 'contradiction' as `restored`, i.e. the
seam-transport premise read a contradiction as a SUCCESS.
A repaired carrier would be a compensation layer for a rank-local fact
that never needed to travel. Deleted instead (upstream-minimal).
The disposition is now uniform and LOUD: any rank that measures a TRUE
contradiction on its own record raises StoreWitnessContradiction. This
does not take admission authority from PP0 (sgl-project#968/#969Z) -- a raise is a
crash, not a state-changing verdict, and raenge-nie-uneins asks for
exactly this: detected disagreement STOPs the group, never compensates.
Deleted: PREFETCH_CONTRADICTION sentinel + its rationale block +
peers_reporting_contradiction (pp_prefetch_completion.py); the
CONTRADICTION branch in group_completion_verdict; the wire pass-through
and the contradiction post in pp_prefetch_completion_own and
_pp_store_witness_contradicts and the relay withdrawal exemption
(scheduler_pp_mixin.py); the peers_reporting_contradiction consult and the
deferred raise in _admit_under_group_completion (scheduler.py); the
'contradiction' branch in seam_transport_premise_holds with
_note_follower_contradiction_deferred, _WITNESS_FOLLOWER_REPORTS,
_WITNESS_FOLLOWER_DEFERRALS, witness_stop_authority, and the is_authority
parameter of assert_store_witness_at_admission (phase_purity.py); and
test_1176_contradiction_carrier.py.
ZOMBIE GREP over python/ and test/: PREFETCH_CONTRADICTION 2,
peers_reporting_contradiction 3, _pp_store_witness_contradicts 2,
witness_stop_authority 2, _note_follower_contradiction_deferred 2,
is_authority 5, _WITNESS_FOLLOWER_* 0 -- every remaining occurrence is an
ORPHAN ASSERTION (class I of the new fixture file, plus the
test_1157 source-inspection pin) or one prose line naming the deletion.
Zero live references.
NON-BLOCKING, named not fixed. `cached_prompt_tokens_at_retract`
(schedule_batch.py:2593) has exactly ONE writer, `reset_for_retract`, and
NO clearer anywhere in the tree. It is monotone by design and the whole
comparison rests on it, so the hazard is now named at the READ site in the
`_witness_from_outcome` docstring: a stamp that outlives the state it
described can only make this witness LOUDER, never quieter.
TALLIES (measured, not recalled).
RED on parent 8e73b2a, new fixture file test_1176_presence_frame_r4.py:
12 failed, 7 passed, 17 warnings in 10.60s
(F2, F3, all four F4, three of four H, all three I fail; F1 both, F5,
F6 both, G and H::test_pp0_raises already pass -- they pin behaviour
round 3 got right.)
GREEN on this commit, the three touched test files:
61 passed, 3 subtests passed, 0 failed, in 8.42s
(test_1176_presence_frame_r4.py + test_1176_witness_materialized.py +
test_1157_seam_witness.py)
NEIGHBOUR SUITES touching the deleted symbols (1175 group completion, 968
starvation, 1173 arm quiescence, w30 seam exemption, 869c seam premise,
861j tp decode formation): 117 passed, 2 failed. Both failures are
test_tp_decode_formation_861j.py::TestTheHoldHasABoundedExit and both
reproduce IDENTICALLY on parent 8e73b2a in a clean scratch worktree
(2 failed, 12 passed there) -- pre-existing, not this diff.
MUTANTS -- seven applied to a scratch worktree carrying this exact diff,
anchor text asserted present before each patch (an absent anchor aborts;
a no-op patch is asserted != original), reverted after each:
M1 presence = span_present alone (the r3 defect) -> 10 failed DIED
M2 resident += host_hit_length (the overlap trap) -> 4 failed DIED
M3 gate drops the presence > 0 requirement -> 1 failed DIED
M4b is_authority parameter back, follower returns early -> 1 failed DIED
M5 CONTRADICTION sentinel resurrected -> 1 failed DIED
M6 shortfall = stamp - max(resident, span_present) -> 4 failed DIED
M4 suppression keyed on an invented `_is_pp0` attribute -> 61 passed SURVIVED
M4 is recorded, not hidden: it invents an attribute no fixture and no
production Req carries, so it is inert by construction, not a live defect
shape. M4b is the reachable form of the same idea (the parameter r3
actually used) and it dies on the signature pin and the test_1157 source
pin. /spinning/wt-weg1 left at 0 porcelain lines beyond this commit.
RUFF: parity with parent. Identical finding set modulo line drift, minus
one E402 (the empty parenthesised import left by the deleted sentinel is
gone). Six F401 the deletions introduced in the test file were cleaned.
`ruff format --check` flags phase_purity.py on parent AND here -- pre-existing.
Import smoke: phase_purity, scheduler, scheduler_pp_mixin,
pp_prefetch_completion all import clean under CUDA_VISIBLE_DEVICES="".
COUNTING HONESTLY: the round-2 commit body claimed 12 failures on
1634bc3 where both reviewers measured 13. Every number above is a
number this round ran; the red 12/7 and green 61 are quoted from the
pytest summary lines verbatim.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 4, 2026
…f; one rank owns the STOP The store witness is a sgl-project#939 tripwire, and both of its failure directions are fatal: a false raise kills the boot, a lenient one licenses the double prefill. Round 5 closes the five blocking findings of the two adversarial reviews without trading one direction for the other. Presence frame (B1/B3/B4, phase_purity.py ~1613-1660). `matched + loaded == min_completed_tokens` is an identity over the SPAN, not over the prefix, so neither term alone can be compared against the stamp. The reading is now resident = len(req.prefix_indices) current_match = resident + req.host_hit_length head = min(max(0, registered), current_match) presence = max(resident, head + span_present) with `registered` = `req._prefetch_registered_prefix_len`, stamped once at registration (scheduler.py:5377) from `_matched_len` = device + host, disjoint from the span by construction (span cut at :5350). The registration head enters as a CAP, never as a credit: `truncate_prefix_to` (schedule_batch.py:2357) slices prefix_indices and zeroes host_hit_length in one block, so the current match is the only honest ceiling for a stale stamp -- that is what keeps the round-2 truncation case from becoming a "hit" (B4, licensing direction). `host_hit_length` is inside the cap (B1, the false-STOP direction). The outer max is an independent lower bound: rows the device holds right now cannot double count, and a request registered at head 0 whose device match grew afterwards must not read presence 40 against a 30000 stamp. Authority (B2/B5, raenge-nie-uneins / sgl-project#968 / #969Z). Exactly one rank and exactly one call path may raise. `witness_stop_authority(scheduler)` returns True on PP0 or with no pipeline; both admission sites pass it as `may_stop`. `store_witness` and `seam_transport_premise_holds` return "contradiction", which is not in the restored set, so the premise refuses and the flip demand is raised the normal way -- no raise on a reader that runs on every rank inside the group-uniform census gate (scheduler.py:8926), which is the divergence measured on weg1b6. `assert_store_witness_at_admission` now RETURNS the state instead of dropping it; the admission sites ignore it deliberately (a follower credits and decides nothing). Test contract rewritten, not extended: the r4 files pinned the boot-killer as intended behaviour, so classes G/H/I in test_1176_witness_materialized.py and class III in test_1157_seam_witness.py were replaced (including two deliberate inversions and their can-fail companions), and the source pin now requires the `may_stop=witness_stop_authority(self)` form at both sites. Evidence red-first: 31 failed / 44 passed on parent c6fccf7 (three r5 suites copied in), 77 passed / 0 failed on this tree mutants: 5 written, all die, each anchor-asserted and applied to a copy -- M1 host half dropped from the cap (5F), M2 head as bare credit (6F), M3 premise reader regains the raise (5F), M4 one admission site claims authority unconditionally (2F, anchor x2), M5 outer max(resident, ...) deleted (1F); restore run 77 passed suites: 142 passed / 2 failed over the six files touching the API; the two (test_tp_decode_formation_861j TestTheHoldHasABoundedExit) fail identically on parent c6fccf7 -- 0 new failures ruff: 203 -> 204 findings over the five files, delta = one UP045 (Optional[str] return annotation), the rule these files already carry 56 times import smoke on scheduler / phase_purity / phase_policy: ok
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 4, 2026
…it in a named stop BOOT weg1b7 (03:49:20 -> 03:50:24Z) died in a circular PP ring wait: PP0 parked in recv_object[src=2], PP1 tore at the 60 s chain-stall bound, both downstream ranks ran their two ring-cut drain turns and the group died. ROOT (built against, and it is NOT the ring cut). The sgl-project#631 row probe peeks the head proxy frame's admission row and, when the row names a rid this rank cannot locate, answers False and leaves the frame in the inbox. That protection is right (boot 631row14: a frame consumed before its request hop plans nothing and the ring dies upstream-waiting) and is untouched here. What it lacked is a BOUND, and the defer is not free: PP0 has ALREADY launched the pass the frame belongs to and is ALREADY parked on its output, so an unbounded defer closes the ring BY CONSTRUCTION. The defer's own premise -- "an unlocatable rid PROVES a chain send is in flight, bounded by rendezvous+transfer" -- is false for both populations measured in weg1b7: * a rid PP0 RETRACTED after sealing the row. PP0 shipped sgl-project#631 PROXY-SEND t40 naming 772368da and c25108f3, then the discretionary #888b parked- carrier relief retracted c25108f3 in the NEXT scheduling iteration (#969AD RETRACT site=_retract_decode_and_requeue fwd_ct=157). A sealed row cannot be amended, so _missing can never empty. * a re-admitted resident (sgl-project#968 READMIT CACHED, last_queued_as=cutover- requeue) requeued rank-locally by _add_request_to_queue -- no chain hop for it exists or ever will. Ranks disagreeing about a rid is RAENGE-NIE-UNEINS, and the sanctioned answer there is a bounded, NAMED stop -- never a silent unbounded wait. sgl-project#1071's occupant horizon is the precedent this follows, down to "0 disables". CHANGE python/sglang/srt/managers/pp_row_defer_horizon.py (new, 300 lines) RowDeferHorizon: per-slot clock over the (frame stamp, missing-rid set) identity. First sighting defers. A CHANGED missing set is a hop landing and restarts the clock -- the boot 631row15 world (43k hot defers on a TURNING ring) therefore never reaches the bound. A DIFFERENT frame also restarts it, so a slot whose head alternates cannot inherit a predecessor's age. Only the same frame with the same missing set, held past SGLANG_PP_ROW_DEFER_HORIZON_S (default 20 s), answers defer=False with a message naming slot, wait, occurrences, rids, BOTH measured shapes, what is deliberately not repaired, and the remedy knob. PURE: no logger, no wire, no scheduler attribute -- the caller owns the raise, as parked_carrier_relief and min_free_slots_delayer are built. 20 s is chosen against three measured neighbours: orders of magnitude above the healthy case (weg1b7's three defers of one frame land in the same log second), BELOW the 60 s chain stall bound so THIS names the contradiction before the ring cut misreports it as "closed ring on the request chain", and BELOW the 90 s sgl-project#1071 horizon. scheduler_pp_mixin.py:9184-9243 the defer consults the horizon and raises PpRowDeferHorizonLapsed past the bound. It does NOT consume the frame (that revives boot 631row14) and does NOT emit a void (that revives the sgl-project#801 reverse corpse). The DEFER log line now carries held=%.1fs. scheduler_pp_mixin.py:9266-9271 a satisfied or unreadable row clears the slot's clock, so a resolved wait cannot age a later one into the bound. scheduler_pp_mixin.py:8912-8941 _pp_row_chain_pending's docstring corrected: its _pp_row_chain_owed arm returns True on an INFERENCE, not on proof of availability, and the receive it opens is bounded by this horizon rather than by transfer time. Do not read that True as uniform evidence of a posted message. EVIDENCE RED FIRST on parent 2615514 (scratch worktree /spinning/wt-1180-red, only the new test file copied in): 12 failed / 2 passed. Two of the reds are BEHAVIOURAL, not import errors -- test_the_defer_is_not_unbounded: "the row probe deferred the same unsatisfiable row 4096 times over an hour of its own clock without ever stopping" (imports nothing new, on purpose); test_a_satisfied_row_clears_the_clock_its_own_defer_armed: "the defer must have armed a clock". FIXED: 14 passed / 0 failed. MUTANTS 6/6 died, each patch verified applied: M1 never raise (fix inert) DIED M2 bound never lapses DIED M3 a changed missing set does not restart the clock DIED M4 satisfied row leaves its clock behind DIED M5 no frame token in the identity DIED M6 DANGER DIRECTION: stop on the FIRST defer DIED M4 survived the first round -- the locatable-row test was vacuous (no horizon object existed to inspect). The recovery test above was added to make the clear observable, and M4 then died. ruff parity: 3 pre-existing errors on the parent, the same 3 after (F841 carries_flip_arm, E741 l x2). Import smoke hermetic (CVD=""). SUITE ONCE, both trees, same command, sequentially (crowding-free box, load ~2.9), test/registered/unit/managers with the five pre-existing collection-error modules ignored (the same five on both trees: the sgl-project#1044 import-broken *_631 quartet plus test_quiescence_no_carry_858): parent 2615514 : 240 failed / 4767 passed / 2 skipped / 638 subtests fixed : 240 failed / 4781 passed / 2 skipped / 638 subtests Delta = +14 passed, exactly the new file; the FAILED NAME SETS are byte identical (diff empty, 236 names each side). Counting probe declared honestly: 236 extracted names vs the summary's 240 on BOTH trees -- a symmetric extraction gap of 4 that is not investigated here and cannot affect the A/B, since both sides carry the same 236 names and the same summary. RESIDUALS, deliberately NOT fixed here * The stop is RANK-LOCAL, exactly like sgl-project#1071's: the deferring rank raises, the others then die on their own collectives or the deadman. A group-uniform stop would need a collective on the wedged path, which is what the ring cut already refuses. * #888b's discretionary yield is untouched. Making it protect published rids is refused: the entry decision and the victim count must be rank-uniform (the sgl-project#583 precondition stated in _maybe_yield_parked_carrier itself), and only PP0 builds rows, so a PP0-only term would make ranks pop different numbers of victims -- a silent rank divergence traded for this deadlock. * The ring cut's arc asymmetry (pp_flip_drain_leftover_dicts receives only from the draining rank's own upstream, scheduler_pp_mixin.py:6796) is left as it is: it is fork-own compensation, and under upstream-minimal a defect inside a compensation layer is a deletion candidate, not a repair order -- and widening it could not clear PP1's _missing anyway.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 4, 2026
…ll-clock seconds Review round 1 blocked the horizon build on reachability: a wall-clock horizon's lapse was unreachable on the weg1b7 specimen, so the guard could not have fired on the boot it was built for. The bound is now counted in ring laps, which is the quantity the deadlock is actually made of. The premise the defer rests on is named in the module and is FALSE for two populations measured in weg1b7: * a re-admitted resident (sgl-project#968 READMIT CACHED, last_queued_as= cutover-requeue) is requeued rank-locally -- no chain hop exists to wait for; * a retracted-after-sealing rid (the #888b parked-carrier relief runs after the admission row was sealed) names a rid that will never arrive. Both make "an unlocatable rid PROVES a chain send is in flight" untrue, and a frame deferred for ever closes the ring by construction: PP0 has already launched the pass and is already parked in the receive for its output. pp_row_defer_horizon.py -> pp_row_defer_cap.py (the name now says what it counts). The sgl-project#631 row-probe protection itself is unchanged and unweakened; this only gives it an end. EVIDENCE Red-first (falsifiers copied onto parent 8f45927, scratch worktree): 17 failed / 3 passed of the 20 pins in test/registered/unit/managers/test_pp_row_defer_cap_1180.py. Green on this tree: 20 passed. Mutants: 8/8 died (harness /spinning/wt-1180-mut/run_mutants.py, every patch byte-verified as applied before its run). They cover both danger directions: M6 turns the documented `0 disables` escape into an instant killer, M8 stops the group on the ordinary first-sighting hedge. M3 (fork the cap into a local literal) was the mutant that exposed a vacuous test and forced the AST pin described under B3. One further mutant was DELETED rather than reported as a survivor: it edited a docstring sentence only, which no behavioural suite can distinguish, so it tested the harness, not the coverage. Its behavioural twin M4b dies. Suites, once, both trees, same five ignores (sgl-project#1044 import-broken modules: test_phase_flip_spec_seam_631, test_quiescence_no_carry_858, test_phase_flip_decode_relay_631, test_phase_flip_draft_bootstrap_631, test_pp_proxy_stamp_631 -- ImportError x4 + AttributeError pp_flip_drain_tensor_dicts, identical on both trees): parent 8f45927 : 264 failed, 4761 passed, 18 skipped, 5 errors (890s) this tree : 247 failed, 4764 passed, 18 skipped, 0 errors (938s) The whole difference is accounted for, by name, not by tally: - FAILED/ERROR name sets diffed. Names appearing ONLY on the fixed tree: ZERO. This change introduces no new failure. - The 17 fewer failures are exactly the 17 red-first falsifiers above. - The 5 errors are the collection errors of the five ignored modules; the parent scratch worktree collected them, this tree does not. - Collected node-ID sets diffed (collect-only, both trees): 5039 vs 5025. The 14 collected only on the parent are the entire retired test_pp_row_defer_horizon_1180.py -- the file this commit RENAMES. Each of its 14 names has a 1:1 successor among the 20; six pins are new. No behaviour lost coverage. One retired name is a deliberate SEMANTIC INVERSION, not a rename: test_the_bound_is_exclusive_at_its_own_value became test_the_cap_is_inclusive_at_its_own_value. This is B3 doing its work: pp_admission_congruence.py:1036 escalates only after "more than UNRESOLVED_DEFER_CAP consecutive passes", i.e. CAP passes are permitted and the stop falls on CAP+1 -- inclusive. `occurrence <= bound` matches the admission layer; the horizon's exclusive reading did not. Adopting the shared object without adopting its arithmetic would have been a second accounting wearing the first one's name. ruff: parity. The same 3 pre-existing errors on both trees; none in the files this commit touches. Not run: no boot, no GPU. This is desk work only. FINDINGS CONFIRMED AND CONSCIOUSLY LEFT B4 (the stop is rank-local; a defer taken by one rank alone is itself a divergence) CONFIRMED VERBATIM, NOT FIXED. The text is not a review opinion, it is the admission layer's own docstring at pp_admission_congruence.py:443-446: "ON THE WIRE because the rank that OBSERVES the miss is never the rank that can ACT on it: only PP0 chooses `told`. Downstream ranks report; PP0 owns the count and the escalation (`UNRESOLVED_DEFER_CAP`). A defer that only one rank takes IS the next divergence, so no rank takes one alone." This cap is rank-local and therefore stands in real tension with that rule. Left deliberately, for a reason that is itself the RAENGE-NIE-UNEINS law: the remedy for a rank-local decision is to put it on the wire, and the wire here is inside the region this stop exists to protect. Adding a collective to the row-probe path would give the deadlock a new place to live -- the failure this ticket is closing. The honest shape is: the cap raises, it does not compensate; every rank on the same unresolvable identity reaches the same bound at the same lap, so the stop is expected to be group-wide in practice, but that is an ARGUMENT, not a measurement. Making it a group fact is sgl-project#968's PP0-authoritative rebuild, not this fix. B5 (a wall-clock horizon can lapse from scheduling noise alone) DISSOLVED BY CONSTRUCTION rather than fixed: the unit is now ring laps, the identity restarts on a new frame stamp, there is no wall clock anywhere in pp_row_defer_cap.py, and the zero-call-site clear_all() of the horizon module is gone (grep count 0). A finding about a clock cannot survive the removal of the clock.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 15, 2026
…o an anchor the key match reaches Boot xsn128 (e0e3f11, write_back on both groups): the round trip held (P leg 1 -> publish sweep 'unbacked=3 issued=3' at the flush -> D leg 2 cached 4314/4316; pin-skips 0, anchor drops 0, deferrals 0, flips 1.85-1.89 s sleep / 2.06-2.28 s wake). Then the in-flip request rid ca49dc53 (Q1 prefix + 7k) killed PP0: 'sgl-project#968 LOAD-BACK GDN ANCHOR OFF-EXTENT: PP0 published an extent of 4031, this rank's load-back yielded 4095, and the mamba restore already adopted the anchor state at 4095' -> sgl-project#791 STOP, the group died, every later request failed. `state_aligned_load_back_len` took `host_hit_length` (4031: only the node the read had just landed; the leading 64-token node had come in hitless on the earlier Q2 request) while the key match reached 4095 with the anchor AT 4095 -- and the load-back applies the key match up to the anchor. Under write_through (xsn122) the same read stamped kv=4095; under write_back the host accounting of that leading node differs. The extent is now raised to the anchor when the key match reaches it and the anchor lies above the host hit (`raised_to_anchor` counter on the sgl-project#1040 census); rounding DOWN for an anchor below the hit is unchanged, as is the pure-KV path. Tests: test_1245 (+1: raised / not raised / rounded down) 7 passed; 1157 seam witness 21 passed, 1 failed identically before and after (socket).
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 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
Oct 1, 2026
…ss a kept told verdict, and acks only what it can resume (N1 dkr27browauthoritybar1fs10010740 PP1 sgl-project#968 death) N1 boot (image 32fc268 = 341d089 + L1,5 shadow), PP1 07:46:29Z, rid weg2-10-16: PP0 PF TOLD-ACKED told=17406 acks={1: 17406, 2: 17406}, PP0 sgl-project#988 LOADBACK mamba_restored; PP1 "sgl-project#1423 INSERT-PLACED matched=17406 deepest=122", "H91 STORE-TOLD KEPT told=17406 credit=0" (not seated in the told visit), then "[sgl-project#928 anchor] REFUSING resume ... match_tokens=17406 best_value_len=0", "sgl-project#1175 UNDER-COVERAGE local=0 scheduled=17406", 19 s, "sgl-project#968 PREFIX MATERIALISATION SHORTFALL" -> group stop. (a) Root: weg2_store_told.admission popped the credit with pop_prefetch_loaded_tokens, which also released the sgl-project#1417 span pin -- and the recurrent anchor ANCHOR-PIN (341d089) keeps under it. A request the adder does not seat in that visit (H91 KEPT) then waits with its anchor unlocked on the mamba host LRU. Now the credit is popped and the pin stays (_pop_credit_keep_pin); p_intake.settle_told releases it together with the kept verdict when the request leaves the queue; an abort releases it as before. (b) Riegel: the follower's PF ack (weg2_told_fallback.own_prefix) named its KV depth. It now asks the told-fidelity probe (the sgl-project#928 rule read-only): KV without a recurrent state at its end acks the resumable depth ("PF TOLD-ACK UNRESUMABLE"), PP0 sees own != told and answers told=0 for EVERY rank -- a rank-agreed re-prefill instead of a 19 s wait and a group death. No probe = no verdict (the KV count stands). Tests (CUDA_VISIBLE_DEVICES="", real check_prefetch_progress + real FULL+MAMBA tree, array keys): new test_told_anchor_pin_ack_n1_1001.py red on 341d089 (2 failed: host_lock_ref 0 after the told admission; KV-only follower acks 16 of 16), green here (3 passed incl. "anchored follower acks told" = no false fallback). Changed area (pin 1417 x3, anchor pin, PF x2, told 1400/1416e/1416f/TF x2/TK x2/SL, shortread, dual x2, p_intake/h91): 261 passed; 1 failure (test_weg2_p_intake_h91a source-text assertion) fails identically on 341d089.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Oct 1, 2026
…and a follower that cannot hold the told load-back acks 0 (dual1k PP1 sgl-project#968, weg2-0-10) NVFP4 dual1k (dkr27bnvfp4dual1kbar1fs10010950, image y6e = 90945ae), PP1 09:55:20Z, rid weg2-0-10 (fork twin of weg2-0-7): PP0 P-KV PP0 GRANT weg2-0-9 tokens=61440, then weg2-0-10 tokens=20480; PP1 MAPPED-BY-GRANT tokens=20480 returned=83886080 B (level stays 61440); TWIN-TOLD told=16383, PF TOLD-ACKED acks={1: 16383, 2: 16383}; PP0/PP2 resident=16383 (the twin head on the device), PP1 resident=0 host_hit=16383; PP1 "SF LOADBACK-ROOM PP-RESIDUAL kv_tokens=12288 avail=1717 evictable=0"; "sgl-project#968 ... prefix_len=16383, holds 0 after 0.00s". (a) Root -- no anchor-depth off-by-one (16383 on every rank): the dual P KV mapping is ONE high-water level shared by every request P holds (map_granted), and pp0_grant sized each grant for its own prompt only, so weg2-0-10's 20480 "fit" under weg2-0-9's 61440 level while weg2-0-9's prefill was filling that pool. PP1, the only stage holding the twin head on its host, had to load 16383 back and found 1717 rows. GRANT-SUM: the grant asks this prompt plus every other request that holds a grant (running batches, chunked, queue, store hold; deduplicated, finished excluded) -- dual_p_kv_stage.live_grant_tokens. (b) Riegel on the twin path too: the twin told is a PF read-ahead, its follower acks are PF acks. ACK-ROOM (weg2_told_fallback._room_own): when the told span is HOST-only on this rank and does not fit even with every evictable row freed, the ack says 0 ("PF TOLD-ACK NO-ROOM") and PP0 answers told=0 for every rank -- a rank-agreed re-prefill instead of an SF residual and sgl-project#968 after PP0 admitted. Read-only; no probe = no verdict. Tests (CUDA_VISIBLE_DEVICES=""): new test_dual_told_room_dual1k_1001.py red on 90945ae (3 failed: no live_grant_tokens; grant asked [19745] instead of [81249]; host-only follower without room acked 16 of 16), green here (4 passed incl. "a follower with room acks told"). Changed area (dual stage/rid reuse, told PF/z30y14/1400/1416e/1416f/TF x2/TK x2/shortread, anchor pins, twin/dual files; 38 files): 313 passed, 3 failed -- the margin-own-model replay tests that read live /proc/meminfo, failing identically on 90945ae.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Oct 16, 2026
…robe findet die END-ANCHOR-Tails -- sie liest die gemeinsame Aufzaehlung pp_request_locations statt ihrer eigenen vier Orte Boots 1016_150003 (weg2-6-94) und 1016_151644 (weg2-0-20), derselbe Client-Request nach jedem Neustart: 89664 Tokens, 89600 gecacht, uncached Rest 64. Der Rest passt ganz in einen Chunk, also teilt die END-ANCHOR-Regel (sgl-project#1233, Anker bei floor_grain(N-1), grain 4) ihn in Body 60 + Tail 4. Mit fnFL2 H42 (multi anchor tails) lebt der Tail in Scheduler.anchor_tails -- absichtlich NICHT im einzigen chunked_req-Feld (das fuehrte weiter weg2-0-18: 'sgl-project#992 CHUNKED CONTINUATION NOT NAMED rid=weg2-0-18 decision_names=weg2-0-20'). PP1/PP2 mintet denselben Tail aus der weitergeleiteten Geometrie (ANCHOR-TAILS minted_rids=weg2-0-20 bei slot 1). PP0s slot-2-Zeile nennt den Tail; die sgl-project#631-Row-Probe in _pp_proxy_frame_pending zaehlte aber nur waiting_queue, chunked_req, den Slot-Chunk und running_batch -> "not yet locatable" ohne Aenderung -> 4 Laps -> PpRowDeferCapExceeded, RANK_EXCEPTION. Der Early-Settle (equal/short_satisfied) ist nur der Weg zum ganzen-Chunk-Rest, nicht die Ursache. Fix: _known = pp_request_locations(self) (sgl-project#946: jede Stelle, an der ein Request leben kann, inkl. anchor_tails und Slot-Ring) plus der Chunk des genannten Slots. Keine Lap-Grenze geaendert; eine rid, die an keinem Ort liegt, wird weiter verschoben und endet benannt. Tests: test_pp_row_probe_anchor_tail_1016.py 3 gruen (weg2-6-94 ueber die Lap-Grenze hinaus lokalisierbar, weg2-0-20 nach equal-Early-Settle, eine rid an keinem Ort wird weiter verschoben); auf 1f4b3e7 rot 2. Mutant: anchor_tails aus pp_request_locations entfernt -> ROT 1. Regression 9 Dateien (Row-Probe/sgl-project#1180/#791T/sgl-project#968/sgl-project#946/sgl-project#961/sgl-project#971/H42/K14/244): Kopf 221/1 rot = Basis 221/1 rot (vorbestehend test_weg2_p_multi_anchor_tails_h42::test_count_arm_uses_the_fresh_admission_count). Kaltstart-Rig s7s8 28/28 GRUEN.
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.
Thank you for your contribution, we really appreciate it. The following instructions will help improve your pull request and make it easier to receive feedback. If there are any items you don't understand, don't worry. Just submit the pull request and ask the maintainers for help.
Motivation
To simplify the
get_new_prefill_batchModification
Add a class to maintain the information of prefilling requests choice.
Checklist
pre-commit run --all-filesor other linting tools are used to fix potential lint issues.