Skip to content

fix /generate without sampling_params - #734

Merged
Ying1123 merged 1 commit into
sgl-project:mainfrom
toslunar:fix-sampling-params-none
Jul 26, 2024
Merged

Ying1123 merged 1 commit into
sgl-project:mainfrom
toslunar:fix-sampling-params-none

Conversation

@toslunar

Copy link
Copy Markdown
Contributor

Motivation

curl -X POST -H "Content-Type: application/json" http://localhost:8000/generate --data-raw '{"text": "hello,"}'

causes Internal Server Error. The server log says

    if self.sampling_params.get("n", 1) != 1:
       ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

The expected behavior would be equivalent with

curl -X POST -H "Content-Type: application/json" http://localhost:8000/generate --data-raw '{"text": "hello,", "sampling_params": {}}'

Modification

Fix __post_init__ of

    sampling_params: Union[List[Dict], Dict] = None

to properly handle the None case.

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 da50444 into sgl-project:main Jul 26, 2024
timethink pushed a commit to timethink/sglang that referenced this pull request Mar 9, 2025
cen121212 pushed a commit to cen121212/sglang that referenced this pull request Nov 10, 2025
* 检视意见修改以及bugfix

* 检视意见修改
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 17, 2026
…sport failure as timeout

MEASURED 2026-08-17 18:39:07, on a boot killed by an external process exit:

    HiCacheCollectiveTimeoutError: 'pp_sync/isend[2]->pp2' did not complete
    within 600s (waited 34.3s)

34.3 s against a 600 s bound -- the sentence contradicts itself. The real cause
was one frame underneath: `gloo ... Connection closed by peer [127.0.1.1]`, i.e.
the peer PROCESS HAD DIED.

`Work.wait(timeout=...)` raises RuntimeError for BOTH expiry and transport
failure, and the sgl-project#630 bounding wrapper reported every one as a timeout. An
operator reading "timeout" goes hunting for a slow rank and finds a healthy one,
while the corpse is on another node. That is the wrong-instrument-reading class
this session has been clearing, and this instance is mine -- introduced with the
bounded wait.

THE DISCRIMINATOR IS NUMERIC, not a string match on the backend's wording: if
the wait returned before its own deadline, the deadline is not what ended it.
Backend messages change between versions; arithmetic does not. Under 95 % of the
bound the failure is reported as `HiCacheCollectiveError` naming a dead or
disconnected peer and carrying the underlying error text; at or past the bound it
remains `HiCacheCollectiveTimeoutError` as before.

Ruff clean. The existing bounded-wait and rendezvous suites are unaffected: they
exercise expiry at or beyond the deadline, which still raises the timeout type.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 17, 2026
…e pipeline's dependency chain

THE DEADLOCK. `_count_ready_acks` MIN-reduced a ready count across the group,
and that reduction sat inside `check_hicache_events` ->
`_get_new_batch_prefill_raw` -- the PER-MICROBATCH path of a pipeline, whose
stages are at DIFFERENT offsets by construction. Measured 2026-08-17: PP0/PP1
inside the drain while PP2 was blocked in `_pp_recv_proxy_tensors`, waiting for
data PP1 would only send after leaving the collective PP1 could not leave
without PP2. A circular wait between adjacent stages -- the sgl-project#633 shape one level
up, with a collective in place of a handler.

The bug was PLACEMENT, not participation: every stage calls the function, just
never on the same tick.

WHAT THE REDUCTION PROVIDED, and where each part went:
* OP-SEQUENCE UNIFORMITY -- concerned the TP all_reduce, which ran only on
  pp_rank 0. With no reduction there is no op left to keep in sequence.
* THE EMPTY-QUEUE SENTINEL (sgl-project#581: one idle rank froze the drain on ALL ranks and
  `protected` ratcheted until the state pool died). Rank-local counting removes
  that failure mode BY CONSTRUCTION -- an idle rank cannot freeze a peer that no
  longer waits on it.
* THE THROTTLE. Pacing, not correctness, and the one thing genuinely lost.

CORRECTNESS IS OWNED BY THE MARKER, NOT BY ACK LOCKSTEP. The cross-rank hazard
was publishing a shared content key incomplete on some stage. sgl-project#706's
`PageCompleteness` bounds that per page: production is layer-sharded while
storage is token-sharded, so slots arrive from several PP stages and
`is_complete()` gates use. Ranks arbitrarily far apart therefore yield an
INCOMPLETE page -- a MISS, never wrong bytes. The docstring now says this so
nobody resurrects the collective for a service the marker owns.

THE THROTTLE IS FILED, NOT GUESSED. No backpressure bound is shipped: one chosen
without an operating point is another shipped-number-without-evidence (#505c).
Instead a rate-limited drain-depth line (per-rank ready/pending at drain) makes
the first real fast-rank host-pressure specimen attributable when it appears.

TESTS  test_rank_local_ack_drain_737.py, 8 passed, both arms:
  (i)  deadlock -- ranks answer independently and may differ; an idle stage
       cannot freeze a busy one; and a CAN-FAIL that stubs torch.distributed to
       raise on ANY access, so a future edit that reintroduces a group op here
       fails loudly. Mutation-proven: adding one torch.distributed reference
       turns it red.
  (ii) divergence -- through the REAL `PageCompleteness`: worst-order arrival
       (PP2, PP1, then PP0) stays a miss until every slot is marked; order and
       tick are irrelevant, only completeness; a fast rank racing ahead cannot
       complete a page alone; double-writing a slot is refused.

THREE PRE-EXISTING TESTS CORRECTED, both causes recorded rather than absorbed:
* two sgl-project#734 fallouts I had missed -- the timeout stubs raised INSTANTLY, which
  the new dead-peer discriminator rightly reads as transport failure rather than
  expiry. A real timeout raises AT its deadline, so the stubs now sleep the
  bound. That keeps both the discriminator and the tests' original intent.
* the sgl-project#581 throttle test asserted exactly the property this change withdraws. It
  is rewritten to the new contract -- a slow rank no longer holds the others,
  which is what sgl-project#581 actually needed -- with the withdrawal stated in the
  docstring, not silently deleted.

Also: the sgl-project#580 comment at scheduler.py:6253 now states its ACTUAL guarantee --
uniform entry WITHIN the function once a rank calls it, which says nothing about
all ranks calling it on the same tick. The ack collective leaned on it and
deadlocked; anything added there needing GROUP agreement needs a
pipeline-aligned point, not that one.

REGRESSION  mem_cache + managers: 19 failed / 3696 passed against a captured
baseline of 19 -- ZERO new failures. Ruff: unified_radix_cache clean,
scheduler.py 96 before and after (pre-existing).
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 17, 2026
…refused on structure

Desk-only classification. Verdict and fix SHAPE only -- no fix built; the boot
wrapper is F4-r4's and the operator's ack is required.

THE HYPOTHESIS DOES NOT HOLD, and it is refused structurally rather than for
want of evidence. The store port cannot collide across boots:
route_a_631_prod_boot.sh pins neither --nccl-port nor --dist-init-addr, so
server_args.py:18787-18788 applies -- nccl_port = get_free_port() draws a port
that is free at that moment, and a predecessor still holding its own store port
is not a candidate. A lost race is caught anyway at :18873 by
wait_port_available, which polls 30 s and names the holding process. There is
also a shape argument that does not depend on this codebase: "Connection closed
by peer" is a connection ESTABLISHED and then broken, whereas a stale
predecessor holding a port yields EADDRINUSE at bind or a refused connect. The
observed error is the wrong shape for the hypothesis.

So the answer to "does wait_host_release check the store port" is no -- and it
should not need to. Extending it there would encode a refuted hypothesis into
the boot wrapper, where the next reader would trust it.

AT LEAST TWO ROOTS, not one. The specimens split on evidence:
- 18:23:43 is not NEAR an OOM event, it IS one. syslog:1789 records
  "A process of this unit has been killed by the OOM killer" at
  18:23:43.842677. The same signature repeats at 18:39:05 against
  e66bde7's own measurement at 18:39:07 -- F4-r4 called that boot "killed
  by an external process exit", which is what an OOM kill of a peer looks like
  from inside a survivor. A third sits at 18:45:30.
- 19:31:45 rank2 is NOT memory. The host ledger reads avail=103 headroom=97 at
  19:32:24, 39 seconds later, and there is no OOM line anywhere in the 19:3x
  window.

SENDBYTES IS A TOMBSTONE. In 3 of 3 recorded instances it is the SECOND event:
HANDOFF_663:696-698 (peer dies, no traceback -- "exactly what a SIGKILL looks
like"; that run "died of host RAM"), HANDOFF_658:256 (rank 0's TCPStore died,
survivors then spun on sendBytes), and e66bde7's gloo frame naming a dead
peer process. Any verdict that makes the socket primary is fighting the prior.

THE REAL HOLE is elsewhere and is the recurring shape. wait_host_release.sh
computes S -- the count of surviving schedulers -- on every iteration, PRINTS
it in the clear-to-boot line, and never puts it in a condition. The gate is
available-RAM and nothing else, so a predecessor whose schedulers are alive but
whose allocations are already unmapped passes it. The single-instance guard
does not cover the gap either: boot script :250 pgreps sglang.launch_server,
the LAUNCHER, while the store and ranks live in the sglang::scheduler children
-- an orphaned scheduler set whose launcher has exited passes cleanly. That is
the counter-without-a-reachable-actuator family (sgl-project#679/sgl-project#681/sgl-project#684/sgl-project#715): the
value that answers the question is discarded one line before the decision.

FIX SHAPE (not built): gate on the counter that already exists -- require
S -eq 0 alongside A -ge NEED -- which closes the predecessor window for RAM,
GPU and the store socket at once, without a bespoke port probe. Two cautions
handed to the owner: grep -c "sglang::schedul" reads ps comm, truncated at 15
chars, so the match is one rename from silently counting zero and a
miscounting gate that reports "clear" is worse than none; and requiring zero
turns a soft wait hard, which is the right direction but must fail with PIDs
named rather than timing out anonymously.

HONEST GAPS, recorded in section 6 rather than papered over: dmesg is
permission-denied here and journalctl -k returns "No entries", so kernel OOM
detail is UNAVAILABLE from this session, not absent -- which process the
killer took at 18:23:43 is therefore not established, only that it fired. The
serving tree runs under setsid outside systemd, so the absence of an sglang
unit line is not evidence it survived. Specimen B's root and the third
specimen's log remain open; a timestamp tied to a specimen is not the same as
its log read, and I have not read the second.

Adds "schedul" to .codespellrc: it is the literal 15-char truncation ps comm
reports, not a typo.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 17, 2026
…y own fix was wrong

The log trawl landed and it revises the verdict, including correcting the fix
I recommended one commit earlier.

NONE OF THE THREE IS A BOOT-CYCLING FAILURE. All three are phase (d)
POST-READY SERVING crashes -- the servers had been live and serving for ~2 min,
~1 min (past a real 200 OK), and ~11 min respectively. A crash eleven minutes
into serving cannot be a rendezvous collision. The hypothesis now fails twice
over: on structure (fresh free port per boot) and on evidence (no specimen died
at rendezvous, none shows a colliding predecessor -- a targeted search for
EADDRINUSE/stale/orphan/teardown language across all three files returns zero
real matches).

THREE SPECIMENS, TWO ROOTS, all verified at file:line:
- S1 2026-08-17 18:23:43, CRASH_restore_706450.log:1433/:1516 -- gloo
  "Connection closed by peer" in Scheduler._update_uniform_pool_budget. THE
  TIMING IS THE FINDING: syslog:1789 logs the OOM killer at 18:23:43.842677 and
  rank2's first store failure is at 18:23:43.962302 -- 120 ms later. Store port
  38409, pid 706450.
- S2 2026-08-17 19:31:45 rank2, boot_bundle.log.20260817T193224Z:50862 -- rank0
  hit CUDA illegal memory access in barlink_bar1 poll_status_word
  (barlink_abort_gate.py:351), then the same fault on the phase-flip payload
  path phase_flip_runtime.py:6926 -> kv_reshard.py:359 _checksum ->
  weights_arena.py:127 uint8_checksum. Emphatically NOT memory: avail=103
  headroom=97 thirty-nine seconds later. The requested 19:31:45 line is near the
  END of a ~65 s cascade, not its start.
- S3 2026-08-05 20:59:42 rank2, /spinning/CRASH_20260805_boot9_2059.log:826-827
  -- Bar1CollectiveAborted, "a spin kernel took its abort path", at all_reduce.
  Different model (Qwen3.6 W8A8) and different parallelism (tp_size=3,
  pp_size=1). Earliest occurrence of the signature in the evidence tree.

S2 and S3 share a family twelve days apart across different models AND
different parallelism, which makes barlink-BAR1 a recurring root rather than
two accidents. That is the priority, not the boot path.

CORRECTION TO MY OWN FIX SHAPE. One commit ago I recommended gating
wait_host_release on the surviving-scheduler count. The hole is real, but now
that every specimen is known to be a post-ready crash that change fixes NONE of
them. Shipping it under the sgl-project#734 banner would let the ticket close with all
three roots live -- exactly the failure this note exists to prevent. Split into
5a (the actual roots, barlink-BAR1 first) and 5b (the latent boot-race hole, a
separate ticket, not sgl-project#734). The two cautions on the one-liner stand.

Open and named rather than papered over: whether the barlink-BAR1 pair is one
defect or two; which process the OOM killer actually took at 18:23:43 (dmesg
denied, journalctl -k empty -- unavailable here, NOT absent; the serving tree is
setsid so no unit line is not evidence of survival); whether S1's gloo
disconnect has a cause beyond the OOM; and that "rapid boot cycling" describes
none of the three, so if such a specimen exists it is not among these.
efschu added a commit to efschu/htsglang that referenced this pull request Aug 17, 2026
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 17, 2026
…ip named

Pass 2's state was unverified after the process-exit waves, so this pass began
by CHECKING every worklist item against the tip rather than by merging. Five of
eight were already on the train, verified with merge-base --is-ancestor rather
than assumed:

  feat/407-registry-reconcile (ahead=0) + docs/407 + VERDICT_407 present
  the two DESIGN_407 corrections filed under sgl-project#732 -- both committed
  fix/485-gdn-family-report (ahead=0)
  feat/363-remainder (ahead=0)  <- the worklist flagged this MISSING. STALE.
  fix/602-fill-side (ahead=0)
  the sgl-project#710 adapter item -- the named site carries the repair, from sgl-project#540

Merged (all clean, zero conflicts):
  origin/train/0817-desk  -- sgl-project#737 ack drain, sgl-project#734 dead-peer discriminator,
                             sgl-project#721 help text, and sgl-project#738 direct-io which F4-r4
                             pushed during the pass, resolving that item
  feat/516-miss-slot-budget
  feat/553-remainder
  fix/739-prefill-progress-signal

Plus sgl-project#748 shipped ON the train before the freeze: my sgl-project#744 armed-only gate
strangled the flip's own funder (35 refused tp_to_pp, IDLE-LOCK at 407,622
tokens pending), and the review boot must not carry the unrefined gate.

TEST EVIDENCE, per-suite and compared by FAILED/ERROR line rather than total:
  baseline before any merge        57 failed, 4 errors, 5510 passed
  after the three main merges      57 failed, 4 errors, 5575 passed
  new failures ZERO, disappeared ZERO
Pinned suites after sgl-project#748: 142 passed + 87 subtests.

ONE FINDING RECORDED RATHER THAN RE-RUN AWAY. Three later full-scope runs
showed ~50 extra failures in the distributed/ collective-floor family, and the
obvious suspect was the last merge. sgl-project#739 is EXONERATED by a same-commit
contradiction: commit 3c49cbc, the tree BEFORE sgl-project#739, was run twice on the
identical scope -- once ZERO new, once FIFTY. Same commit, same command,
opposite results. Corroborated: the suites pass in isolation, pairing each new
suite with a victim stays green, and distributed/ alone gives 27 rather than
27+50. So the combined run is order-dependent at ~50 tests on this lineage:
a test-infrastructure defect worth its own ticket, not a property of this
train. A suite that gives fifty different answers on one commit cannot gate
anything, and the tempting move -- re-running until it looked green -- would
have buried that.

NOT on the train: Slot-2's sgl-project#747, which arrived after the freeze. Nothing else
was withheld; every worklist item is merged or verified present.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 23, 2026
Wave 3, stage 3 of the batched-window tree. WINDOW-QUEUE tickets W4 (PP ring
wedges immediately after an abandoned flip) and W5 (sgl-project#821 did not instrument
the receive path that actually wedged), both preflight_pass=Y.

Four commits, base 500be7e -- which is EXACTLY this tree's stage-1 branch,
so this stage sits directly on top of W1/W2 with no divergence to reconcile:

  2efb933  [sgl-project#824 W4a] Bound the PP chain receive without tearing the
              stream it guards
  dd92de4  [sgl-project#824 W5] Name the arm that tripped the watchdog, and
              instrument the path that wedged
  430e468  [sgl-project#824 W4b] A zero-iteration armed window must not move the slot
  ceb79d6  [sgl-project#824 W4a] Arm the chain-recv recovery on STATE, and cut the
              ring with the existing drain

GATED AGAINST ceb79d6, NOT 430e468. The branch head moved while this
stage's first battery was already running, so that run was measuring a
superseded commit and was DISCARDED rather than reported -- a gate that
certifies a commit the tree does not carry is worse than no gate. The
in-flight battery was stopped by explicit PID (no pkill), py-spy dumped first
per standing rule and found healthy mid-test rather than wedged, and its
partial log kept aside as w3c_stale430.log. A foreign battery belonging to
another session was running on the box at the same time and was NOT touched.
The final W4a commit arms the recovery on STATE (`bump_attempted`, entered >=
taken as the evidence predicate) and cuts the ring through the existing sgl-project#757
drain, with the wall-clock default left at 0.

W4b is the ROOT of the pair, and it lands in the same mechanism as this
branch's own known-red neighbours: an armed window that ran ZERO slot
iterations must not advance mb_id. The boot_827 specimen recorded exactly that
-- "rank 0 ran 0 slot iteration(s) (armed at mb_id=0, disarmed at mb_id=1)" --
one line before the ring stopped dead and stayed silent for 31 s until the
health check noticed. That is the sgl-project#631 defect class with the spread reduced to
a single rank: arm on one slot, leave on another, then re-enter the pipeline
wherever you happened to stop.

TOUCH SURFACES, computed rather than assumed. This stage shares
scheduler_pp_mixin.py with both earlier wave-3 stages and with wave 2, and it
extends sgl-project#821's own suite (test_pp_wedge_watchdog_is_honest_821.py) rather than
duplicating it -- W5 is the continuation of sgl-project#821, by the same argument sgl-project#821
made, so touching that file is intended and not a collision. It also adds to
mem_cache/hicache_collective.py, the file carrying sgl-project#734's
`waited < timeout_s * 0.95` discriminator that strand 17c's 622 falsification
identified as the fragile part.

That last point is what makes this gate non-vacuous rather than merely green:
`test_pp_sync_rendezvous_630.py` -- the suite that went red under the 622 merge
for precisely this threshold, and the reason 622 is still off the line -- sits
INSIDE the battery. If this stage disturbed that discriminator, the gate would
say so in the same way it said so for 622.

NOTE ON A PATH, because it looks like a contradiction and is not: this stage
modifies python/sglang/srt/utils/watchdog.py, while commit 9f1af20 fixed a
catalog citation that resolved against python/sglang/srt/watchdog.py. Those are
different files; the catalog's intended target was turnkey/watchdog.py:88 (the
generation probe retired by user order), which is where it now points.

GATE. Battery test/registered/unit/{managers,planner,server_args,mem_cache},
hermetic under CUDA_VISIBLE_DEVICES="", one battery at a time.

    baseline (tip 4f2072a)   7 failed, 8585 passed, 1852 skipped, 887 s
    stage 1 (W1+W2)             7 failed, 8638 passed, 1852 skipped, 868 s
    stage 2 (W3)                7 failed, 8653 passed, 1852 skipped, 922 s
    this stage                  7 failed, 8673 passed, 1852 skipped, 915 s
    NEW failure ids             NONE (comm against the baseline list is empty)
    fixed vs baseline           0

THE +20 IS ACCOUNTED FOR EXACTLY, not assumed. Four new suites adding only 20
passes is low enough to be worth checking, because a suite that silently skips
looks identical to a suite that passes cheaply. Two facts settle it: the
skipped count is 1852 in every run of this train -- baseline, stage 1, stage 2
and this one -- so nothing new is being skipped; and running the four suites
standalone reports exactly 20 passed, matching the battery's delta to the
case. They run, and they are collected.

COVERAGE, and this stage is the reason to state it explicitly. The W4/W5
strand reported that its OWN worktree cannot collect the managers suite --
92 modules import `datasets`, which is not installed there. That limitation is
NOT present in this gate, verified in the positive direction rather than
inferred from a missing error line: datasets 5.0.0 is importable in this venv,
the battery logs carry zero collection errors and zero ModuleNotFoundError,
and an explicit --collect-only over test/registered/unit/managers reports 3436
tests collected. So this stage's no-regression claim rests on a fully
collected managers suite, which the strand's own local run could not provide.

Its four new suites land inside the battery directories and are therefore
actually collected: test_pp_ring_abort_recovery.py,
test_pp_wedge_watchdog_names_the_arm_824.py,
test_pp_zero_iteration_window_slot_824.py and
test_pp_chain_abort_check_824.py, all under managers.

ON PROVENANCE, if this stage ever shows a new failure id: the branch is
PRE-sgl-project#815 (its base 500be7e sits on 21ff075), so the last_batch-631
failures visible in the strand's own worktree are expected to DISAPPEAR on
this line, which carries fix/815. A new id here would therefore have to be
checked against that provenance before being attributed to the strand's
change. In this run none appeared, so the question stays hypothetical.

No boot. This tree is the input to ONE batched window.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 23, 2026
Wave 3, stage 5 -- the LAST stage of the batched-window tree. WINDOW-QUEUE
ticket W7 (strand 21a, preflight_pass=Y: 7 passed with 4 red-first, 3/3
mutants killed, and the 17 pre-existing sgl-project#630 tests unchanged).

One commit, base 2efb933:

  3f16e8e  [sgl-project#829] The HiCache deadline must not close a pair healthy peers
              are using

THE DEFECT. `bounded_wait` enforced its deadline by passing a timeout INTO the
gloo work itself -- `work.wait(timeout=)`, introduced by sgl-project#630 -- and on a
shared gloo pair that does not merely abandon one wait, it POISONS the pair
for every peer still using it. The production string
"Application timeout caused pair closure" was reproduced red-first in a real
two-process gloo run and reads PAIR_SURVIVED on the fix. The deadline now
lives in `ParkedWait.join`, off the work: the wait is abandoned by the CALLER
while the underlying `Work` stays parked, so nothing is torn out from under a
healthy peer.

NO CROSS-SURFACE, computed rather than hoped. The only file this shares with
the rest of wave 3 is mem_cache/hicache_collective.py, and the +119 that stage
3 put there comes from commit 2efb933 -- which is precisely W7's own base.
So W7 already contains that change and there is nothing to reconcile; its
other two files are new and under mem_cache, disjoint from W5/W4b's files.

sgl-project#734's DISCRIMINATOR IS PRESERVED, and this was checked rather than assumed
because it is the exact thing strand 17c's 622 falsification turned on: the
`waited < timeout_s * 0.95` branch that distinguishes a dead peer from a slow
one is still in `bounded_wait` after this change. W7 moves WHERE the deadline
is enforced; it does not move the threshold.

That also makes this gate non-vacuous in the way that matters here.
`test_pp_sync_rendezvous_630.py` -- the suite that went red under the 622 merge
for precisely this threshold, and the reason 622 is still off the line -- sits
INSIDE the battery and is green on this stage.

KNOWN FOLLOW-UP, NOT CARRIED HERE. Strand 21c has since measured that the
0.95 comparison is REDUNDANT under this very ParkedWait design -- a real
expiry takes the not-completed path 4 out of 4 times, and any RuntimeError
reaching that `except` already means transport death -- while the comparison
leaves a BLIND BAND over the last 5% of the bound, where a peer death is
labelled a timeout (30 s at the 600 s default). An amendment is being built
(delete the comparison, make the except an unconditional transport error, and
guard at construction that the process-group timeout exceeds the bound).

That amendment is NOT in this tree. It did not exist when this stage's battery
started, and per standing instruction the window tree does not wait for it --
it lands in the next round as its own stage. This paragraph exists so the next
reader does not re-derive the finding or mistake the preserved comparison
above for a settled decision: it is preserved here because THIS commit does not
touch it, not because it is known to be right.

A related thread for whoever owns the 622 posten, explicitly UNMEASURED and
not a claim of this merge: 17c established that 622 reddens sgl-project#630 by SHIFTING
gloo timing until the 0.95 branch flips, and left open why the timing shifts.
This change removes `work.wait(timeout=)`, one mechanism by which a wait on a
shared pair can perturb its peers. Whether that is upstream of what 622
perturbs is unmeasured here and is not asserted.

GATE. Battery test/registered/unit/{managers,planner,server_args,mem_cache},
hermetic under CUDA_VISIBLE_DEVICES="", one battery at a time, against a ZERO
baseline since stage 3b.

    baseline (tip 4f2072a)   7 failed, 8585 passed, 1852 skipped, 887 s
    stage 1 (W1+W2)             7 failed, 8638 passed, 1852 skipped, 868 s
    stage 2 (W3)                7 failed, 8653 passed, 1852 skipped, 922 s
    stage 3 (W4a/W5/W4b)        7 failed, 8673 passed, 1852 skipped, 915 s
    stage 3b (sgl-project#791 stub)        0 failed, 8684 passed, 1852 skipped, 900 s
    stage 4 (W6)                0 failed, 8703 passed, 1852 skipped, 931 s
    this stage                  0 failed, 8710 passed, 1852 skipped, 912 s
    NEW failure ids             NONE

The +7 is this stage's own suite, matching its ticket exactly. The skipped
count is 1852 in all seven runs of this train, so nothing went green by being
skipped.

The sgl-project#630 check above was verified rather than inferred from the overall zero:
test_pp_sync_rendezvous_630.py sits under test/registered/unit/mem_cache, i.e.
inside the battery, and run standalone on this stage it is 3 passed --
including test_a_dead_peer_still_raises_a_named_bounded_error, the exact case
that reddened under the 622 merge.

Its new suite, test_bounded_wait_pair_survives_829.py, lands under
test/registered/unit/mem_cache and is therefore inside the battery and
actually collected.

WINDOW SCOPE, so the window reader does not expect what cannot appear: W7's
effect is only OBSERVABLE with PP>1 and a storage-backed HiCache. On a boot
without both, a green W7 criterion would be vacuous rather than passing.

No boot. This completes the tree; W9 is a separate stage after the push.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 28, 2026
…he silent hop

Boot 2 of window-flip-0828 wedged silently for 10+ minutes: PP0 and PP1
blocked in gloo waitSend under _pp_commit_comm_work's naked
p2p_work.work.wait() (PP1 via _pp_commit_pending_req_work), PP2 in
_do_recv -- a closed three-arc cycle on a group whose own timeout is two
hours. The sgl-project#753 comment in this file already described the exact shape
(boot v7pp9); the ordering was fixed then, the wait stayed naked.

The bound routes through the sgl-project#630/sgl-project#829 canon
(hicache_collective.bounded_wait -> ParkedWait): the unbounded wait()
parks on a thread and the deadline is on the JOIN. Deliberate deviation
from the order's 'pass the deadline into work.wait(timeout)': sgl-project#829
retracted that design in this tree -- an expired timed Work.wait closes
the gloo pair, and hicache_collective.py names _pp_commit_comm_work as a
measured victim (34 of 262 boot logs). Budget 120 s
(SGLANG_PP_RING_COMMIT_BUDGET_S; <= 0 = documented escape hatch,
byte-for-byte pre-sgl-project#973), reasoned against the canon's constants: 12.6x
the longest healthy cutover, 4x the sgl-project#789 budget, 5x under the HiCache
bound, 60x under the group timeout. On expiry: RingCommitTimeout with a
sgl-project#650-style peer statement naming the silent hop; transport failure is
NOT converted (sgl-project#734 stays distinguishable). Helpers are module-level,
not methods -- the method form broke ~12 one-method-at-a-time stand-in
holders (measured: 796 5->2, 801 14->3), recorded in a code comment.

Wait-site audit: :5253 bounded-now; :3270 bounded by delegation (proven
by test); _do_recv/:7592 and :5545 bounded-already via the sgl-project#789 gate;
parallel_state.py recv_object stays unbounded and is NAMED as its own
posten (needs the resumable PpChainReceiver treatment, not a terminal
bound mid-protocol).

Tests: test_ring_commit_bounded_973.py, 5 arms on real 3-process gloo --
pre-sgl-project#973 naked commit HANGS (distinguished from raised via fsynced
progress marker), bounded commit raises within budget with the peer
statement, healthy paired traffic unchanged, escape-hatch mutant hangs
again (can-fail), :3270 reachability arm. Gates: BEFORE == AFTER
byte-identical on 796(5)/801(14)/797(31)/630(5+14)/829(7) plus an
18-module sibling sweep; extraction count probe OK on every run.
ruff/codespell: 0 new findings.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 28, 2026
…e mutants because the module is new

sgl-project#980 shipped 1202 lines across seven files with no tests, including a new
482-line module (distributed/pp_object_recv.py). A red-first against the
previous commit is the weak proof already reported twice in this window --
every arm would die on ImportError, equally red against a module whose
functions are all 'pass'. So each invariant is paired with a mutant that
breaks that invariant and nothing else, and the arm must go red for it.

What is asserted is NOT 'does it time out'. The module's own law is that once
the size header is received the payload is on the wire and must be taken off
it, because a receiver that gives up mid-frame and later re-posts reads a
payload AS a size and every later message on that stream is garbage. An
abandoning bound is therefore worse than no bound: the unbounded wait hangs
one rank, the abandoning one silently corrupts the stream. Every arm counts
irecv posts -- exactly one size and one payload per object, however many
steps expire and however many times the caller is handed a stall and returns.

Covered: resumption across expired steps in both halves; a stall that raises
AND leaves the frame resumable, with the same receive then completing; a
transport error propagating as itself rather than as ObjectRecvStalled (sgl-project#734,
so a dead peer stays distinguishable from a slow one); abort_after_s <= 0
restoring the exact pre-sgl-project#980 unbounded wait so the default path gains only a
log line.

MY OWN FIRST STRUCTURAL ARM WAS A FALSE POSITIVE, recorded in place rather
than quietly rewritten. It asserted 'wait(timeout' not in the module source
and went red on the module's DOCSTRING, which explains at length why it does
not do that -- so the better the hazard was documented, the more surely the
arm failed. Replaced by an AST walk for a real .wait(...) call carrying a
timeout keyword, plus a can-fail proving that detector sees a genuine one.
The prohibition matters because no runtime arm can observe it: a timed
Work.wait closes the gloo pair (sgl-project#829) and would pass hermetically while
killing a real boot on both sides.

Test: 11 defs / 11 passed at 4ea93b8 (count probe), 1.84s, hermetic --
dist.irecv and ParkedWait stubbed in the module namespace, no gloo, no CUDA.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants