Skip to content

Lazy-import third-party backends - #794

Merged
Ying1123 merged 1 commit into
sgl-project:mainfrom
bgyoon:feat/faster_import
Jul 29, 2024
Merged

Ying1123 merged 1 commit into
sgl-project:mainfrom
bgyoon:feat/faster_import

Conversation

@bgyoon

@bgyoon bgyoon commented Jul 29, 2024

Copy link
Copy Markdown
Contributor

Motivation

import sglang imports all backends(e.g., LiteLLM, OpenAI)

Especially importing litellm takes about 1.5 sec to import(#606) and has issues with proxy environment variables.(#521)

I presume most users of sglang probably use first-party backend, which is RuntimeEndpoint. Importing all third-party backends when importing sglang seems to be inefficient.

Modification

In order to have third-party backends available by sgl.OpenAI rather than by sgl.lang.backend.OpenAI, python/__init__.py needs to import them which slows down import sglang.

Apparently lazy import is what you do for this(e.g., https://pypi.org/project/lazy-imports/) but using library for tens of lines can do seem unnecessary. So I added code directly to __init__.py.

Checklist

  1. Ensure pre-commit pre-commit run --all-files or other linting tools are used to fix potential lint issues.
  2. Confirm that modifications are covered by complete unit tests. If not, please add more unit tests for correctness.
  3. Modify documentation as needed, such as docstrings or example tutorials.

@Ying1123
Ying1123 merged commit b688fd8 into sgl-project:main Jul 29, 2024
@Ying1123 Ying1123 linked an issue Jul 29, 2024 that may be closed by this pull request
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 21, 2026
…tarts deciding it

The prefill admission guard measured the 2026-08-21 17:33 OOM exactly and
changed nothing about it. From boot_735_bal785.log, in order:

    corridor law 1024 MiB (prefill admission, 8192 tokens)
    corridor shortfall of 981 MiB for rank 0 (was 953 MiB)
    corridor cannot be restored ahead of this chunk
    ... F.linear in in_proj_qkvz: 256.00 MiB asked, 131.69 MiB free

The guard is advisory by construction: it returns evidence and the caller
admits either way. Halving the width to 4096 by hand did not close it -- at
18:01 the same rank died one allocation further down the same layer
(causal_conv1d, 80.00 MiB asked, 5.69 MiB free). A static width cannot answer
a free column that moves.

The actuator is a SPLIT, never a refusal. corridor_admission's docstring
refuses a rank-local refusal, correctly, and names the prerequisite for one:
"a reduction on this path". A split needs no reduction to be safe, only to be
uniform, and those are met in different places. Safe, because the GDN prefill
transient is first-order in the chunk width, so a chunk the card cannot fund
always has a prefix it can -- nothing is refused, the same tokens are admitted
over more passes. Uniform, because the cut is taken where the pass geometry is
already decided: under PP that is PP0, whose (rid, prefix_len, extend_len) the
ring carries and which every downstream rank must reproduce exactly or void
the pass. A cut downstream would be a refusal, then a void, then the same
request again. No collective was added to the admission path; on pp_size==1
with a TP group wider than one the actuator declines to narrow and names the
close (one more term in _update_uniform_pool_budget's packed MIN reduce).

The price is the config-derived GDN estimate, extended with a tokens override
so the same formula prices a narrower width instead of a slope taken from it
-- the ceil(T/64) state term does not scale with T. It is the only price that
exists on a default boot: the rig's log answers "pricing source NONE, want is
0" on all three ranks, so the gate priced the chunk it died on at zero. The
forward-peak probe, where it has measured the bucket, calibrates that bound
downward only.

The budget is the OOM line and deliberately not the corridor law. The 1024 MiB
law is a fill-quality target that "may not block, delay or refuse anything on
its own" (user decision 2026-08-16, corridor_guard.py:949-953); on this rig
the free column sits far below it at admission time as a matter of course, so
sizing the cut against the law would narrow every chunk to the floor and stall
the instance. Budget is therefore NVML free after the relief ladder, plus the
allocator's own cache, minus the guard's existing delta watermark.

The cut saturates at 64 tokens. A width of zero admits nothing, and the
corridor does not recover while the request that would free it is the one
being refused.

TESTS
  test/registered/unit/managers/test_corridor_width_794.py: 26 new, green.
  Two can-fail proofs EXECUTED, not asserted: patching the actuator back to
  advisory fails 5 including the crash simulation; patching the entitlement
  rule so downstream PP ranks also narrow fails
  test_a_downstream_pp_rank_never_narrows (assert 64 == 4096). Both reverted,
  26 green.
  test_corridor_admission_631.py + test_uneven_tp_args.py + the new file: 178
  green, so the "it never refuses" contract and the exact-formula pin hold.
  test/registered/unit/managers/ + planner/ (minus the known-hanging
  test_pp_proxy_readiness_contract_789.py): 5804 passed, 7 failing test ids
  (41 counting subtests). All 7 fail identically on a clean checkout of the
  four touched files, verified by reverting and re-running: they are
  test_vacuous_decode_exit_730 (PhasePolicyConfig kwargs) and
  test_rejected_evidence_pins. No regression from this change.

NOT YET PROVEN ON METAL: the actuator has not run under load. That is the
next step, on the rung-4 acceptance boot, whose 8192-token width is exactly
the case this exists for.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 21, 2026
… only lower it

The rig's first forward-peak row corrected the model this calibration was
built on. forward_peak_794.tp0.json, written by the 18:32 boot: 38436864
bytes of transient over 122 extend tokens, about 315 KiB/token -- roughly
twice the per-token share of the config figure at that width.

The clamp assumed the config figure is an upper bound on what the forward
takes. It is not. gdn_prefill_scratch_mib prices the intermediates of ONE GDN
layer; the OOM is decided by the peak of the WHOLE forward, which is what the
probe reports. Clamping the calibration at 1.0 therefore priced the chunk
BELOW its cost, in the one direction this mechanism must never err: an
underpriced chunk is a chunk that is not cut, and a chunk that is not cut is
the 2026-08-21 crash.

The scale is now a plain ratio. An unmeasured bucket still falls back to the
config shape rather than to no price at all.

TESTS test/registered/unit/managers/test_corridor_width_794.py 27 green (26
before), test_corridor_admission_631.py green alongside it. The replaced test
asserted the clamp and would have kept it; the two that replace it pin the
ratio itself against the probe row above, and that a forward measured as
dearer than the config share narrows the chunk FURTHER instead of being
clamped away.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 21, 2026
…itched itself off

The first metal run of the actuator printed the gap it was told to name, and
the gap turned out to be the whole use case. From all three ranks at 18:41:52:

    sgl-project#794 CORRIDOR WIDTH ACTUATOR OFF on this topology:
    tp_cpu_group world=3 with pp_size=1

The flip changes the topology under the same process. In the PP phase this
scheduler reads pp_size=3 with a tp_cpu_group of world 1, and PP0 decides the
pass geometry for the ring -- which is what the previous commit relies on. In
the TP phase the SAME process reads pp_size=1 and tp_cpu_group world=3, every
rank builds its own prefill batch, and the actuator correctly refused to take
a rank-local cut there. But this fork runs prefill in the TP phase
(--phase-flip-purity prefill_in_tp), and the 2026-08-21 17:33 OOM happened
inside the first flip. So the actuator was off exactly where it was needed.

The close is the one the gap note itself named: one more int on a reduce that
already runs. _update_uniform_pool_budget contributes this rank's corridor
width ceiling, MIN-reduces it with everything else it already packs, and the
call site takes min(requested, reduced). No new collective -- that is the
class that deadlocked instr22/instr23.

Contributed UNCONDITIONALLY so the payload width never depends on a per-rank
capability, and every failure path (no gate, no guard, no price, an exception)
contributes the CONFIGURED width, which makes that rank a non-binding vote
rather than one that silently narrows the group. The element sits between the
mamba pair and the ballot: everything above is indexed from the head and the
ballot from the tail, so both readings keep their meaning.

The offload branch takes no reduce of its own and therefore publishes None,
and the consumer declines to narrow rather than narrow on a rank-local
reading -- the same named gap sgl-project#639 and #791b leave there, with the same close
(one more term in update_dcp_admission_state's packed reduce).

TESTS test/registered/unit/managers/test_corridor_width_794.py 34 green (27
before): the TP phase narrows to the group's tightest card, does not narrow
when the group is not short, never narrows on an unreduced iteration, and the
contributed ceiling is never a silent narrowing.

BudgetHarness in test_collective_family_siblings_610.py gained the new member.
Its drift guard caught this addition unprompted -- the fifth time (#616g,
sgl-project#639, #639b, #791b, now sgl-project#794) -- and binding only the name it reported would
have shipped the same incident again, so uniform_corridor_width was bound
beside it.

Reduce-related suites: 375 passed, 3 failed. All 3 are the pre-existing
PrefillAdder stub drift (chunked_admission_enabled / commitment_ledger),
verified failing on a clean checkout earlier in this session.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 23, 2026
…-project#701's commitment ledger

`_budget_state_stub` had drifted behind `PrefillAdder.rem_total_tokens`
again: sgl-project#701 appended the cross-pass COMMITMENT LEDGER to the tail of that
property (schedule_policy.py:883-885) and the stub carried neither name, so
both admission cases died with

    AttributeError: 'PrefillAdder' object has no attribute
    'chunked_admission_enabled'

This is the sixth drift of this harness after #616g, sgl-project#639, #639b, #791b and
sgl-project#794, and the sixth time `TheAdderStubTracksTheBudgetPredicate` named it
instead of letting an AttributeError surface inside an unrelated admission
assertion. The guard keeps earning its place.

BOTH NAMES ARE BOUND, not just the one the failure reported.
`chunked_admission_enabled` was the reported miss; `commitment_ledger` was
the next one queued behind it. Binding only the reported name is exactly
what reshipped this incident at #639b, whose own note says so.

THE PAIR EXERCISES THE SHIPPED CHOKEPOINT RATHER THAN STEPPING AROUND IT.
`effective_rem_total_tokens` returns its input unchanged when the ledger is
None (planner/chunked_admission.py:233-235), so enabling the flag runs the
real tail and provably cannot move the budget this harness is about.
Setting the flag False would ALSO make the guard green while quietly taking
that tail out of the tested path -- the weaker of the two bindings, and the
one this file's own history argues against.

TESTS (hermetic, CVD="", CPU only)
  test_collective_family_siblings_610.py 11 passed (was 3 failed / 8 passed).
  The can-fail is already resident: `test_the_guard_can_fail` plants a
  field that does not exist and asserts the guard reports exactly it.

  Battery over the 7 files that carried every failure, under
  /spinning/htsglang-gpu/.venv (datasets 5.0.0, full collection):
    base 500be7e   22 failed / 35 passed
    before this       15 failed / 46 passed
    after this        12 failed / 49 passed
  -3, exactly the tests repaired here. This branch still adds none.

Found while opening sgl-project#823: the enforcer there has to add slots to the same
packed reduce this harness models, so an already-drifted guard would have
been the thing standing between that change and a silent index shift.
Repaired first, deliberately.

No boot was run. This is desk work.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 23, 2026
W9 wiring, part 1 of 2: the group now COMPUTES the uniform decision every
TP-loop iteration. Consuming it in batch formation is part 2.

PLACEMENT. The block sits between the mamba pair and the ballot, at the same
seam the sgl-project#794 corridor width uses and for the same reason its comment gives:
everything above is indexed from the HEAD and the ballot is indexed from the
TAIL (`len(vals) - (PREFETCH_BALLOT_SLOTS + 2)`), so an insertion here leaves
both readings intact. Both new blocks capture an explicit index BEFORE
appending and are read back by it; nothing is read by a negative offset,
which is the mistake #639b's note records -- "the `t[-2]`/`t[-1]` the host
floor used to read would have silently started reading MAMBA availability".
The full payload order is written out in the comment so the next person does
not have to reconstruct it.

THE PULL-FORWARD, and it is not a new idea in this function. The sort key
`num_matched_prefix_tokens` is populated by `calc_priority`, which runs LATER
in the pass, so at reduce time it is zero or last pass's value and reducing
it would make the group agree on a stale number. #791b already solved this
exact shape here for the prefetch verdicts: pull the RANK-LOCAL computation
forward to the reduce site -- no collective, once per TP-loop iteration --
and memoise it for the batch formation to consume. `_local_head_prefix_matches`
does the same, bounded to the canonical head, against a tree `calc_priority`
was about to walk in full anyway.

THE COUNT VOTE GETS ITS OWN SLOT rather than being derived from the
availability floor, because `get_num_allocatable_reqs` is bounded by
`admission_limiter.current` (:6526-6529) -- rank-local floating state the
availability reduce does not capture, so a count derived from the uniform
avail would still diverge.

Neither vote can break the reduce: both are wrapped, and a rank that cannot
price contributes the absent/unpriced sentinel, which can only delay
admissions or leave the local limit untouched. Never a collapse to bs=0.

THE DRIFT GUARD CAUGHT ME, WHICH IS THE POINT OF HAVING REPAIRED IT FIRST.
Widening the payload made `TheHarnessTracksTheProductionSurface` fail with
    BudgetHarness has drifted behind Scheduler._update_uniform_pool_budget:
    ['_local_admit_limit', '_local_head_prefix_matches']
-- the seventh drift of that harness after #616g, sgl-project#639, #639b, #791b, sgl-project#794
and sgl-project#701, and the FIRST caught in the same change that caused it rather than
a quarter later. Then it named `get_num_allocatable_reqs` behind them, the
transitive member, exactly the cascade the file warns about.

Both votes are BOUND from Scheduler so the harness keeps modelling the real
contract, and both ride neutrally there: the harness's waiting_queue is
empty, so the head vote is an empty canonical set of absent sentinels. For
`get_num_allocatable_reqs` the guard's own message offers a stand-in as the
alternative to binding, and a stand-in is right: the shipped method is
bounded by the admission limiter and carries the sgl-project#677 parking branch, so
binding it would oblige this harness to model a limiter and a phase policy
to answer a question it is not asking. Constant and EQUAL on both ranks
deliberately -- a divergent count is test_tp_head_congruence_823's subject,
and making it diverge here would put a second unrelated variable into the
budget cases.

TESTS (hermetic, CVD="", CPU only, real gloo where the suite uses it)
  55 passed across test_collective_family_siblings_610 (the harness that
  models this reduce), test_pp_prefetch_ballot_791b (the tail-indexed ballot,
  i.e. the reading most at risk from a widening), test_prefetch_ballot
  _divergence_823 and test_tp_head_congruence_823.
  That the ballot suite still passes IS the evidence that the tail indexing
  survived the insertion.

STILL PART 2, so W9 stays preflight_pass N: `calc_priority` and the candidate
loop do not yet consume `_uniform_head_match_lens` / `_uniform_admit_limit`.
The decision is computed and published; nothing acts on it yet, so this
commit changes no batch.

No boot was run. This is desk work.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 27, 2026
…eciding who

DESK BUILD of TICKET_943_REISSUE_REACHABILITY.md. sgl-project#937 refuses to publish a
prefetch whose binding generation went stale across a cutover -- correctly: the
sgl-project#943 bisection put the garbage fix at exactly that commit, and every pin that
publishes stale spans returns 1/7 coherence. What the refusal leaves behind is a
request owed its prefix, and the only correct way to return it is a FRESH fetch
under the binding that is current now.

THE SHAPE, and every piece of it is chosen to avoid inventing a second version
of something that exists:

  * At the refusal, the req_id is recorded as owed -- a NAME and a COUNT, never
    the operation, the span or the indices. Keeping any of those is what would
    tempt the re-stamp that `StaleStampRewrite` (a882e64) already refuses.
  * `take_agreed_reissue` picks ONE request the whole group agrees on, using the
    shape `drain_retired_prefetch` already proved: MIN over `[d, -d]` yields the
    group min and max in one pass, and only `min == max != 0` is agreement.
  * The candidate set is the INTERSECTION of "owed" and "present in this rank's
    waiting queue". Voting on "owed" alone could agree on a request some rank
    cannot act on, and that rank would then sit out the collective its peers
    entered -- the failure, not a smaller version of it.
  * The re-issue itself runs through the ordinary `Scheduler._prefetch_kvcache`,
    so it inherits the existing participation vote, the rank-local eligibility
    handling and the symmetric-mode branch instead of reproducing them.
  * The count is REPORTED, never gated. `_MAX_PREFETCH_REISSUES` already carried
    that rule in its own docstring; a cap would be a rank-local predicate
    deciding collective participation.

I WROTE THE sgl-project#580 FAILURE INTO THE CODE MEANT TO PREVENT IT, and it is recorded
at the site rather than quietly corrected. The first draft of the scheduler
block read `if self.tree_cache._reissue_pending:` before calling the gate -- a
rank-local predicate in front of a collective, so a rank with nothing owed would
skip the all_reduce its peers had already entered. The comment on the reap two
lines up states the rule verbatim for the same reason. The call is now
unconditional and the vote answers 0 for an empty candidate set precisely so it
needs no guard.

WHY THE LIVE MEASUREMENT WAS NOT ACCEPTED AS THE PROOF. Boot a810ef6 measured
the refusal verdict rank-uniform (DIVERGES 0, AGREES 3, over 111 cutovers and 48
refusals). That is one boot on one rig at TP=3. Building a collective on it
would make the uniformity load-bearing and checked nowhere, so the sgl-project#580
direction is held by a TEST that INJECTS the divergence the boot never showed.

TESTS, hermetic (CUDA_VISIBLE_DEVICES=""), /spinning/htsglang-gpu/.venv.

  GLOO FALSIFIER, three spawned processes, the real gate and the real
  `_all_reduce_attn_groups` in each child, both arms bounded by a deadline so a
  hang is a REPORTED timeout:
    * split verdict (ranks disagree WHICH request): guarded -> no rank takes,
      no rank enters the follow-on vote, all three finish. Ungated -> rank 0
      takes req-A while ranks 1 and 2 take req-B and all three act, i.e. the
      ranks re-register DIFFERENT requests. That is the assertion, measured:
      `distinct taken == {req-A, req-B}`. The first version of this arm was a
      three-way OR that any outcome satisfied; it was sharpened after checking
      what the mutant actually did.
    * lonely verdict (only rank 0 owes): ungated -> one rank enters the
      collective alone, the literal wedge. Guarded -> nobody enters.

  ANCHOR SURVIVES A CUTOVER, the coverage the bisection exposed as missing --
  no test pinned what happens to a prefix across a cutover at all. Pinned as
  BOTH halves at once, because pinning only the first is satisfied by the very
  defect sgl-project#937 removed: the prefix is RECOVERABLE (an agreeing round hands the
  request back to be re-fetched) and the old span is UNRECOVERABLE (the stale
  operation cannot be re-stamped; the retained state is a count, asserted).

  RED-FIRST against the pre-#943b tree: 7 failed, 5 passed; extracted
  FAILED-name count 7 == summary "7 failed".

  THE DRIFT GUARD CAUGHT ME, which is the system working. The frozen A/B went
  45 -> 47 failures: `test_collective_family_siblings_610` noticed that the
  drain grew a member (`_prefetch_kvcache`) its harness did not carry. That
  guard's own comments count the previous times it paid for itself (#616g, sgl-project#639,
  #639b, #791b, sgl-project#794, sgl-project#701, sgl-project#823); this is the next. Fixed by giving the harness
  a STAND-IN -- it exercises the budget reduce, not the prefetch path, and with
  `enable_hicache_storage` False the shipped drain returns {} before reaching
  the re-issue -- and the stand-in raises if it is ever actually called, so a
  moved early-return cannot leave these cases silently pinning nothing.

  FAMILY, FROZEN A/B over the same 66 files, base vs this tree, after the fix:
    base   45 failed, 1472 passed, 865 skipped  (extracted names 45)
    built  45 failed, 1472 passed, 865 skipped  (extracted names 45)
    diff of the FAILED-name sets: IDENTICAL.

  New + touched files together: 31 passed. ruff: scheduler 103 findings before
  and after (none introduced), everything else clean. black clean.

NOT PROVEN, AND IT IS THE WHOLE POINT OF THE NEXT WINDOW: that this actually
returns the prefix on metal. The acceptance is encoded in
devtools/bisect_869b_anchors.sh as a CONJUNCTION -- cached>0 on a repeated
prompt AND 7/7 coherence, never one alone -- and verified to FAIL both known
states: the pre-sgl-project#937 pin (cached=0, 1/7) and the current tree (cached=0, 7/7).
It can only pass in the state no pin in f1a3391..dd0e3bc has reached.
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 Sep 27, 2026
… Gruppe -- Worker uebernehmen ihn, Uneinigkeit ist ein benannter Stopp

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

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

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

Tests test_nf_form_a_admission_follow_h105.py: dpr-Form ueber das echte add_one_req und die echten Scheduler-Methoden (Basis 9417507 rot: Host NO_TOKEN, Worker admit), Aufrufzahl-Riegel, kein Aushungern (Pass n abgelehnt, n+k zugelassen, Raenge einig, Warte-Zeile mit beiden Preisen), Aus-Pfad.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 28, 2026
…roup P execute its row -- counters + sgl-project#1180 chain receiver re-built, carrier split per PP0 term, told stays armed

WHY IT WAS OFF. fb3631c (sgl-project#1233 S0, 07.09.) un-wove the phase flip and pinned pp_flip_counters /
pp_chain_receiver to None, the value they had with the flip flag off ("Every value this commit pins
is the value the expression already produced with the flag off") -- not a crash, leak or crawl
finding. On group P the followers since plan from their own pool (rc12o P log 1807/1811 "sgl-project#631 ROW
AUTHORITY DISABLED"): the class W27, sgl-project#1004, TF and SF closed term by term. 5c97a22 (sgl-project#973) then
disabled the PP0 carrier terms on purpose (sgl-project#973 RING COMMIT TIMEOUT: PP0 withheld, followers
admitted). What re-arming must address, read off the code: (a) the frame probe
_pp_proxy_frame_pending needs the counters, and the loop's pacemaker _pp_row_chain_pending needs the
chain receiver too -- without it the follower blocks in the chain recv each iteration, visits slot k
before frame k exists and falls a slot behind (631row5 crawl class); (b) pp_row_carrier_present=True
would DISARM the told carrier P runs on (weg2_store_told.armed) and re-arm every PP0 term at once.

weg2/p_row_authority.py (SGLANG_WEG2_P_ROW_AUTHORITY, DEFAULT OFF by operator order -- activated per
profile / --env-p in the proof boot; off = both stay None, every image byte for byte):
  * init_request_receiver: PhaseFlipCounters (all PP ranks, attn rank 0, swept at boot) BEFORE the
    PpChainReceiver (followers; consumed count published through the counters) -- the flip-era
    builders minus the flip gate -- and the receiver is handed to SchedulerRequestReceiver;
  * the chain receive is bounded: SGLANG_WEG2_P_ROW_CHAIN_STALL_S (default 120 s; 0 or unset -> 120,
    never unbounded); expiry raises the named PpChainRecvStalled (no stall service wired: a stop, not
    a local decision);
  * START CHECK: switch on on a PP group but counters (any rank) or the receiver (a follower) missing
    -> "W-P-ROW Weg2RowAuthorityIncomplete" at startup; armed -> "P-ROW-AUTHORITY armed" line;
  * pp_row_carrier_present(scheduler, term=None) split: on the row form every PP0 term answers its
    own switch, DEFAULT OFF -- SGLANG_WEG2_P_ROW_WITHHOLD (sgl-project#1066/sgl-project#1175), _FLOOR_CLAMP (sgl-project#1039),
    _CORRIDOR (sgl-project#794); no term -> False, so weg2_store_told stays armed and the sgl-project#1245 drop keeps its
    answer; off the row form the counter-based answer is unchanged;
  * P-ROW-COST (followers, 60 s): plan ms of row-executed passes p50/p90, frames, probe calls/
    drained/delivered/vanish/quiet/head_other.
Existing protections are the executor's own: frame without a row -> "sgl-project#631 ROW AUTHORITY" stop;
frame before its requests -> left in the inbox (631row14); no frame -> nothing planned (#969J);
sgl-project#1004 / sgl-project#1233 W27 / sgl-project#791 FORWARDED SCHEDULE UNEXECUTABLE STOP.

Tests: test_weg2_p_row_authority_0927.py 15 (default off incl. terms; stall bound finite; counters
built/swept only when on; receiver gets the stall bound and the consumed hook, none on PP0;
half-armed follower / PP0 refused by name; complete arms, off silent; init wiring order and the
receiver handed on; carrier split per term, no term False, old form unchanged; told armed on the
row form; the three PP0 sites pass their term; pacemaker model: counter-gated follower executes
every frame at its slot, the blocking-chain mutant falls behind; P-ROW-COST line and hook).

Profile switch (operator 27.09.): ModelProfile.p_row_authority (default False, both registry rows) feeds
switch_defaults()[SGLANG_WEG2_P_ROW_AUTHORITY]; p_row_authority.enabled(): an explicit env wins, unset
follows the published form's profile default (off everywhere). The proof boot switches it on per docker
profile gpu-arb/docker/profiles/27b-row-authority.env (27b-release-draft.env + _form
SGLANG_WEG2_P_ROW_AUTHORITY 1; K0-K3 criteria in the file). Rebased onto unified 2494e7e.
Test: + registry rows all off, profile default followed, explicit env wins (16 total).

Rebased 28.09. from b16128a onto unified 7055ec7 (cherry-pick, no conflict). Targeted
suites on 7055ec7+Fix B: p_row_authority 16, unify_s2 16, unify_s3 35, told (27b_fidelity 11,
array_key_rc12z2 4, store_told_1400 24, hold_tk 8), pp_chain (abort_check_824 4, receiver 8,
row_defer_cap_1180 20) all passed; pp_chain_flush_deadlock_788 3 failed -- identical 3 on
7055ec7 without Fix B (stub lacks _weg2_vote_pass_hook/_pp_post_send), pre-existing.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 28, 2026
f833fcb, D-Log TP0 19:51:39 'WEG2-POST-WAKE-PASS n=3 ... batch_full_break=1(first=weg2-16-54)': 6 Sitze (max_running_requests=6 = Request-Slot-Pool, model_runner_kv_cache_mixin.py:3908/4150), 4 laufend, der letzte Chunk von weg2-16-53 (von sgl-project#794 auf 2688 gekuerzt) in can_run_list. Der Zaehlarm verglich len(can_run_list)=1 >= min(6-4, available_size()=1) und schloss den Batch; die Fortsetzung zaehlte doppelt (als Listen-Mitglied und als belegter Slot), weg2-16-54 wartete den Pass und danach jede Decode-Runde hinter dem klebenden batch_is_full. Fix: get_num_allocatable_reqs(running_bs, slot_held) gibt den gehaltenen Slot einmal zurueck (scheduler.py available_size()+slot_held); der Zaehlarm zaehlt die Traeger in can_run_list vor der Schleife (_carried_slot_held; 0 mit Anchor-Tails, dort nimmt _carried_n sie schon heraus), die Gruppen-Stimme (_local_admit_limit) gibt ihn ebenso zurueck (_chunk_rest_slot_held, nur pp_size 1: unter PP kann eine Naht-Verweigerung die Fortsetzung aus der Liste halten, dort bleibt die Stimme die kleinere Zahl und der MIN haelt die Gruppe). Alle anderen Aufrufer unveraendert (Default 0; Harnesse mit Ein-Argument-Signatur bleiben gueltig). Tests test_weg2_chunk_rest_seat_0928 (6): Metallform 4 laufend + Rest + 1 wartend = nicht voll, danach voll (nie sieben); Stimme 2 statt 1; unter PP 1; ohne Slot/mit Tails unveraendert; alle 6 rot auf 560db6e (API: slot_held/_carried_slot_held fehlen dort), gruen mit Fix. Pin in test_weg2_d_seat_vram_h95c auf die neue Signatur nachgezogen. Nachbarn 14 Dateien (823-Kopf/Enforcer, 888b/677 Parked, Adder, 959, 681, H95/H95c/H91b-Sitze, Intake-Stall) 218 gruen auf Fix und Basis.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 28, 2026
f833fcb, D-Log TP0 19:51:39 'WEG2-POST-WAKE-PASS n=3 ... batch_full_break=1(first=weg2-16-54)': 6 Sitze (max_running_requests=6 = Request-Slot-Pool, model_runner_kv_cache_mixin.py:3908/4150), 4 laufend, der letzte Chunk von weg2-16-53 (von sgl-project#794 auf 2688 gekuerzt) in can_run_list. Der Zaehlarm verglich len(can_run_list)=1 >= min(6-4, available_size()=1) und schloss den Batch; die Fortsetzung zaehlte doppelt (als Listen-Mitglied und als belegter Slot), weg2-16-54 wartete den Pass und danach jede Decode-Runde hinter dem klebenden batch_is_full. Fix: get_num_allocatable_reqs(running_bs, slot_held) gibt den gehaltenen Slot einmal zurueck (scheduler.py available_size()+slot_held); der Zaehlarm zaehlt die Traeger in can_run_list vor der Schleife (_carried_slot_held; 0 mit Anchor-Tails, dort nimmt _carried_n sie schon heraus), die Gruppen-Stimme (_local_admit_limit) gibt ihn ebenso zurueck (_chunk_rest_slot_held, nur pp_size 1: unter PP kann eine Naht-Verweigerung die Fortsetzung aus der Liste halten, dort bleibt die Stimme die kleinere Zahl und der MIN haelt die Gruppe). Alle anderen Aufrufer unveraendert (Default 0; Harnesse mit Ein-Argument-Signatur bleiben gueltig). Tests test_weg2_chunk_rest_seat_0928 (6): Metallform 4 laufend + Rest + 1 wartend = nicht voll, danach voll (nie sieben); Stimme 2 statt 1; unter PP 1; ohne Slot/mit Tails unveraendert; alle 6 rot auf 560db6e (API: slot_held/_carried_slot_held fehlen dort), gruen mit Fix. Pin in test_weg2_d_seat_vram_h95c auf die neue Signatur nachgezogen. Nachbarn 14 Dateien (823-Kopf/Enforcer, 888b/677 Parked, Adder, 959, 681, H95/H95c/H91b-Sitze, Intake-Stall) 218 gruen auf Fix und Basis.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 30, 2026
…ase nicht mehr in D's erste Sekunden -- y3r Klasse E/A2, sgl-project#794 GROUP-NARROWED 4096->64

Metall y3r (c1c012d, ...dauer09292330, D TP1 = 3080, Wake 18):
23:45:25 '#1028c BOUND driver_free bound=81.8 instant=81.8' (D schlaeft,
P haelt die Karte), 23:45:29/30/32 'bound=81.8 instant=2443.8/2187.8/
2099.8' nach dem Resume, erst 23:45:34 'bound=2087.8'. Das 5-s-Minimum
des sgl-project#656-Gates hielt die Lesungen der fremden Phase fest: spendable =
81.8 + takeable - delta 256 = -97..-188 MiB gegen 198 MiB fuer 4096
Tokens -> '[sgl-project#656 CORRIDOR-ADMISSION] NARROWED ... to 64' auf TP1 (jede
Wake-Kante), Gruppen-MIN 'sgl-project#794 GROUP-NARROWED ... to 64'. Echte
D-Extends der ersten ~5 s liefen als 64er-Paesse: ep36 220 Tokens =
64 + 156 (2490 + 1922 ms), ep38/ep50 65er-Reste 64+1, bei ~2100 MiB
freier Karte und 9 / 67 MiB gemessenem Transient (VRAM-PEAK chunk
rows=64 / rows=158).

Fix (SGLANG_WEG2_CORRIDOR_BOUND_WAKE_RESET, Default an): _bounded_min
verwirft seine Stichproben, wenn scheduler._weg2_last_wake_t (gesetzt, wo
die Admission-Seams nach dem Resume oeffnen) sich geaendert hat. Jede
danach gelieferte Zahl bleibt ein MIN ueber Messungen DIESER Phase, ein
Einbruch nach dem Wake bindet weiter. Keine Konstante, keine Reserve,
kein Kollektiv. Ohne Wake-Attribut (Nicht-weg2) oder Schalter aus:
bytegleich. Marker: '#1028c BOUND WAKE-RESET n=.. dropped ...'.

Test test_corridor_bound_wake_reset_0930 (5): 5 rot auf b2b6b51,
5 gruen mit Fix. Nachbarn corridor_admission (631/794/856/800/1233):
124 gruen, 1 rot auch auf der Basis (takeable_cache_856 without_cuda).
efschu pushed a commit to efschu/htsglang that referenced this pull request Oct 21, 2026
…ts first sighting (no false R6-COMMIT-STALE, no lost hold); only a redirectable leg's marker holds the verdict (SOLL R6 R7 R11)

Review 2 (done/nf-rc30-r6stale-review-1021.md, Nachtrag 2: FREIGABE JA after B1); its tests e70a8d8 cherry-picked.
SOLL v2 R6 (the rest that goes to P), R7 (no flip under X; danger direction "flip missing" here), R11 (front decides alone).

B1 (mittel): _r6_commit_pending keyed the first sighting on (rid, epoch) and never forgot it -- a later commit of the same rid
>5 s on (next chunk boundary with chunks narrowed after a wake, 'sgl-project#794 GROUP-NARROWED ... to 64'; a sgl-project#679 park-in-place) was
stale at once: no hold, counted 0, false PDFLIP R6-COMMIT-STALE. Now _r6_commit_clear drops the sighting as soon as a
non-COMMITTED free is read for the rid; every marker gets its own clock.
B2 (low): the COMMITTED check moved behind _r6_redirectable -- a leg that stays on D (stream committed / no D-prefill leg) is
no part of what P gets: it holds nothing and is not named pending.
B4 (direct abort RPC from _r6_redirect for verdicts without a D answer): NOT done, noted as follow-up in the report.

Tests (serial, flock /spinning/gpu-arb/pytest.lock, systemd-run --scope -p MemoryMax=2G -p DevicePolicy=closed,
CUDA_VISIBLE_DEVICES=""):
- review2 file 5 passed (test_b1 green, strict-xfail marker removed; new test_b2), review 9, r6stale 13 passed
- r6_rest_exakt 25, scheduler_soll_1017 18, review_probes 7, ez_s2b_auflagen 24, ez_s2b 20, set_scheduler 66, s63_reprobe 25,
  nf_1b 8, s56 11, s49 16, decode_collect_prefill_busy 10, collect_p_not_kept 10, decision_record 30, arrival_seat_rule 14,
  flipstall 13, manual_flip_park 3, ez_s2a_b1 4, profile_catalog_1003 9, profile_catalog_union 8+1 skipped,
  managers/test_loop_instruments_1158c 8 -- passed
- mutants: B1 without the clear -> 1 failed; B2 check before _r6_redirectable -> 1 failed
efschu pushed a commit to efschu/htsglang that referenced this pull request Oct 21, 2026
… length minus tree-held; the stopped prefill continues on D with its arrival class (SOLL R1 R6 R6k R7 R11)

Review A1 (boot-blocking, /spinning/gpu-arb/deskq/done/nf-rc31-r6rest-review-1021.md): upstream's chunked abort releases with
is_insert=False at the top of the next scheduling step, before the overlap loop processes the in-flight chunk's result -- that
chunk was thrown away and the halt said 2010 while P/D compute 4310 (live 6-401: D would prefill 8096 > X).
Fix at the root (review way a), group D, TP: Scheduler._pdflip_halt_retain applies the abort of the running chunked prefill in
the recv step like the park (d_park_runtime.park_rids at a chunk border, #969D "the retraction must RETAIN"): the in-flight
batch lands (_land_inflight, its result processed = the chunk border), the request is released RETAINING its span
(_release_outside_chunk = release_req(retain=True), is_insert=True, forced host write-through so P reads it when a flip
follows), chunked_req cleared, the tokenizer gets the abort, and the beacon's halt record = request length minus what the tree
holds (RETAINED_ATTR of the retaining insert). Every TP rank applies the same abort in the same recv step on the same chunk
border (sgl-project#794): the same number on all ranks (R11); the front reads it only once every rank halted (A3). Upstream's discarding
path stays for PP / an abort with a reason / the switch off -- its halt now counts length minus the tree-held prefix, never the
launch-based free. Switch FLLIPER_PDFLIP_D_HALT_RETAIN, default on. The strict xfail is a passing test now.

A4 (planner decision after SOLL R1 "Flip oder nicht fällt über S gegen X, nie über einen Einzelrequest (außer der Einstufung
bei Ankunft)"): the class is NOT derived again from the halted rest -- the arrival classification stays (R6k "bei Ankunft u <
halbX"). R6 stopped it ("auch mitten im D-Prefill"), the verdict on its exact rest said no flip (R7 "Kein Flip unter X"), so it
goes straight back into D's admission (QUEUED-SHORT: seat R5, X-SUM price) as the continuation of its earlier D verdict, as in
A2, never into a set.

Tests (serial, flock pytest.lock, systemd-run MemoryMax=2G DevicePolicy=closed, CUDA_VISIBLE_DEVICES=, htsglang-gpu venv):
33 files 567 passed, 15 subtests. New: A1 structure (land < retain < halt, no is_insert=False in the retain path, discard path
counts the tree-held prefix), A1 behaviour on three ranks (live 6-401: lands chunk 2 before the retaining release, halted_free =
157590 - 155521 = 2069 on every rank, None until all three halted), A1 not applicable -> upstream's pending abort, A2/A4 both a
kurz-sized and a halb-sized rest go to D at once with the arrival class.
efschu pushed a commit to efschu/htsglang that referenced this pull request Oct 22, 2026
…ice back to rc33 (A4 stands), TP0 vote starts at the recorded wide-extend cost (SOLL R11)

Planner decision 22.10. on the review's Auflagen (all 28 rc33 corridor breaches were WIDE extends; the
corridor-line short price cost ~300-600 more partial returns per 71 min on TP0 without preventing one):

* d_transient_lend.short_extend_need_mib is fbb680d's code byte for byte: 300 MiB HALT line, rc33 rate.
  extend_trim.effective_rate is rc33 again (start / Q-694b x 1.15) -- it is the short price's rate via
  chunk_need_mib. The wide-extend cost enters the sgl-project#794 width vote only: new extend_trim.vote_rate =
  max(effective_rate, lend_rate). Vote line = corridor line, after-extend trim and the sleep settle stay.
* TP0 start of the vote's wide-extend cost: new profile record D_EXTEND_LEND_RATE_MIB = [0.7547, null, null]
  in profile_records_data/nextflash.json (LEND-COST per row, rc33 06:23:24, 2629 rows, 1984 MiB; boot
  dkrnfint4h6ablxcw3spmlrhlvwflbar1dauer10220606). The launcher writes FLLIPER_PDFLIP_EXTEND_LEND_RATE_START_MIB
  (launcher.d_extend_lend_rate_start_env, --env-d wins); extend_trim.lend_rate = max(recorded start, the boot's
  own readings). rc33 06:14:15 replay: the first wide extend votes 1792 instead of 2304 and ends ~936 MiB instead
  of ~593 under the 767 line. Deliberately NOT the rc12g record D_EXTEND_GROWTH_PER_ROW_MIB: raising it would
  move the short price (A4) and, through the record-floor of fill_null_rates, the 3080 ranks' start (+14
  forwards in the rc33 replay); the 3080 ranks stay null here.
* Neighbour modules that test the short price are fbb680d's versions unchanged (keep_price_max,
  lend_cost_tp0_review, nf_ports_extend_rate, transient_lend_1001, s78, s93, s106, topup) and pass; the
  author's 300-line fixtures stay only where the vote/HALT arithmetic is tested (stueckelung_rc12g,
  lend_cost_tp0_1021 without its lend_rate price change).

Tests: review module +16 (short price == rc33 formula over rows x lend_rate x recorded start, class reading,
measured-rate rank; recorded start: first wide extend, ratchet floor, 3080 none, unarmed none, launcher from
the nextflash record / second pass / --env-d wins / other length / 27B none); author module (6) back to rc33
expectations; test_unify_s3_model_profile knows the new own record.
Gate serial via pytest_gedeckelt.sh (PYTEST_PYTHONPATH=python:test/registered/unit/weg2:test/registered/unit/pdflip):
author's 24 modules + review module + f3_review_gegentests + unify_s3 + planer_referenz_n3/apc/apd/ape +
nf_n3_unchanged + hw_generic_launcher + hw_p1ab + d_only_trim + extend_growth_rc12f + hw_ap2:
14 failed / 741 passed / 11 skipped. The 14 are pre-existing, identical on cd5b187: the 8 known
(activation_ring_rc12e x2, test_1203 x2, collective_family_610 x2, phase_domain_verdict x2) plus
planer_referenz_n3 x4, planer_apc x1, hw_p1ab x1 (golden/release-profile drift of the base).
efschu pushed a commit to efschu/htsglang that referenced this pull request Oct 22, 2026
…asured LEND-COST row class prices its width in the sgl-project#794 vote (SOLL R11)

The linear vote floor((post - line) / rate) prices every width with the worst per-row cost of a wide extend
(TP0 rc33 0.7547 at 2629 rows), but the card cost is not linear in the rows: rc33 TP0 extends of 1000-2000
rows cost 0.54-0.63 MiB/row (1956 rows at 89856 cached: 1192 MiB; 1944 at 98560: 1186; 2024: 1248).
extend_trim.class_rows_cap widens the linear cap to the largest page-aligned width w <= the configured chunk
whose OWN row class this rank measured (lend_cost_mib: class maximum, rows <= the class's widest reading,
never extrapolated) and whose measured cost leaves the corridor line: line + lend_cost_mib(w) <= post. It
never narrows, prices nothing unmeasured, needs LEND-COST armed, and stays this rank's vote in the group MIN
(R11). rc33 replay (70 wide TP0 extends): linear splits 59, class vote 45, breaches let through 0 of 28.
STUECKELUNG names class= / class_cost_mib= when the class set the width. Same depth caveat as lend_rate.

Gate serial via pytest_gedeckelt.sh: author's 24 modules + review module + f3_review_gegentests + unify_s3 +
d_only_trim + extend_growth_rc12f: 8 failed / 560 passed -- the 8 known pre-existing reds only.

Tests (review module +17): 06:17:04 state votes 1984 (linear 1728), widest reach, configured cap, never
narrower than linear, no readings = linear, unarmed = none, danger grid (a class-widened width leaves the
line at its measured class cost, a linear one at the worst rate), page floor leaving the class.
Mutants (vs review + author + lend_cost_tp0 + keep_price_max + s78 modules): extrapolate past widest 13 red,
ignore the line 7, without lend_cost_armed 1, may narrow 1; short price reads vote_rate 23, short price on
the corridor line 40, vote ignores recorded start 9, recorded start for every rank 1, vote without lend_rate 55.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slow import

2 participants