feat: model SGLang's scheduler receive interval in replay #1104
All Vouch review confidence checks passed
Residual risk 0.36 = Change Risk (0.64) × (1 − Review Confidence (0.44)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.64 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 10%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
No Reviewer Assigned
no_reviewer_assigned
0.120
Real PR Conversation Timeline
1 comments
"Review active on #1104"
general
weight: 0.35
simone-chen
Summary
SGLang's
--scheduler-recv-interval Nmakes the scheduler read new requests from its socket only when a counter of per-iteration weights reaches N. A request that arrives while decode batches run therefore waits 0 to N-1 decode iterations before scheduling can see it. AISim's SGLang replay read every arrival at the next pass. InferenceX recipes for H200 and B200 run SGLang v0.5.23 with--scheduler-recv-interval 10(B300 and GB300 use 1), so replay missed about 50-110 ms of TTFT per request at concurrency 8 and above on those systems.This PR models the receive skipper in the SGLang scheduler emulation, from the v0.5.23 source:
workers.<role>.scheduler.scheduler_recv_interval(PythonSchedulerPredictionConfig.scheduler_recv_interval, nativesglang.scheduler_recv_interval). The default is 1, which is SGLang's default (arg_groups/fields/schedule.py:204-207). Values below 1 are rejected.environ.py:675-678). The iteration whose counter reaches the interval reads the socket and resets the counter (scheduler_components/recv_skipper.py). So a prefill is always followed by a receive.unreceivedqueue. They count for readiness and draining, but scheduling, metrics and the FPM queue snapshot cannot see them, as in SGLang.dp_attn.py:688-693).Engine accounting:
Not modelled
SGLANG_SCHEDULER_RECV_SKIPPER_WEIGHT_*.Attribution
THIRD_PARTY_NOTICES.mdentry:crates/core/src/engine/scheduler/sglang/recv_skipper.rs. Its source is sgl-project/sglang v0.5.23, commit297e54fd105e974cdf401e5b4d20253a22c16f90, filespython/sglang/srt/managers/scheduler_components/recv_skipper.pyandpython/sglang/srt/environ.py, Apache-2.0. Both notice copies are byte-identical, andscripts/ci/check_packaged_legal_files.pypasses.sglang/core.rs,engine/config.rs,sglang/tests.rs,crates/core/tests/engine.rs, anddocs/replay/engine/workers.md.Evidence
The mechanism was found by comparing InferenceX AgentX truth runs for Qwen3.8-Flash-Next with replay:
End-to-end, on a scoring branch that carries this change on the Qwen3.8 model stack:
Docs
docs/replay/engine/workers.mdgets a field-table row and a section, "SGLang receive interval".Tests
- the skipper weights;
- delays at interval 2 and 10;
- receive after a prefill;
- idle and drained resets;
- a host-loop case where requests are blocked on KV;
- prefill/decode-interval deferral;
- attention DP;
- cancellation while unread;
- draining;
- interval 1 against hand-computed admission times.
- Rust lib 3677 passed; all 25 test binaries 4016 passed.
- Replay/engine Python 1922 passed.
-
cargo fmt --check, ruff, the doc-link check and the legal-files check are clean.