← Back to Pull requests

fix(xavier): preserve SGLang shared-prefix batches #6128

Closed
unknown closed this pull request without merging on Nov 16, 2026 15:12 UTC
View on GitHub
unknown unknown commented on Nov 15, 2026 15:55 UTC
Author

SGLang's Xavier HiCache adapter starts a new key chain for each backup callback. If the preceding 128 pages have left history, the next 12 pages can still reach storage even though a read from the start restores nothing.

Carry extra_info.prefix_keys into the shared-prefix write chain and suffix start across callbacks, as well as across the adapter's internal RPC batches. With the preceding prefix missing, the History writer drops the 12-page suffix; with it present, all 140 pages round-trip from the start. The Bytes actor also rejects a continuation before changing cache contents or recency when any preceding page is absent.

Size RPC batches using the configured byte budget and advertised store/queue capacity, retaining the 128-page ceiling and a 32 MiB transfer target with a one-page minimum. Consume the suffix's result flags, stop shared reads or writes at the first miss, rejection, or RPC failure, and pad unattempted results to the requested length.

For shared reads through the Bytes actor, fetch the bounded batches without changing recency, then refresh exactly the returned contiguous prefix once in tail-to-head order. With 16 MiB pages and room for three pages, reading A/B/C and inserting D now leaves A/B/D for both single and split reads. A split read that stops at a miss refreshes only the pages returned before it. Bytes actors that do not advertise deferred refresh retain the existing per-batch read behavior.

The History actor and proxy keep their existing read behavior and directory refresh rules. Native Torch reads and writes retain independent page access. TP, quantized and DeepSeek-V4.1 multi-pool storage is unchanged. The vLLM, MLX and TRT-LLM adapter code is unchanged; their continuations receive the same missing-prefix rejection when using Bytes storage. History directory ordering, real LMCache/Mooncake eviction, and staging behavior are tracked in #6135.

Regression coverage includes separate backup callbacks with a missing or present preceding prefix, split Bytes actor reads and eviction, a split read stopping at a miss, rejected heads, rejection after an accepted batch, native random access, byte budgets, and a 300-page round trip through a 100-page history queue. The History write tests use real Xavier History actors and proxy with an in-memory LMCache stand-in and deterministic queue draining. The Bytes write and read tests use a real Bytes actor. The missing-prefix Bytes write regression checks the rejected flags, unchanged cache contents, statistics and eviction order, and a resident-prefix control. These tests do not exercise real SGLang inference, native LMCache/Mooncake, or GPU P/D.

VALIDATION: On Ubuntu 24.04.5 LTS at ec62f035 (base 5ff1356d), xinference/model/llm/sglang/tests/test_xavier.py passes 65/65 on Python 3.12.3 with Transformers 5.23.0, on Python 3.12.3 with the Transformers 4.57.6 CI pin, and on Python 3.10.22. The consumer suite on Python 3.12 passes with 408 passed and 84 skipped. Pre-commit passes on the checked files. The fail-before run fails as expected at the suffix-residency assertion with production files reverted to 5ff1356d and the candidate tests retained.

AI disclosure: this was prepared with AI assistance (Claude Opus 5.5 and Claude Sonnet 5.5).

Diff: 409 lines (+306 / -103) across 5 files Reviewer: Jackmeson1 Review duration: 1396m
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 409 lines diff across 5 files
0.45
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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.360
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #6128"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 44.9% (MEDIUM) · Higher = larger blast radius
44.9%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 17.7% · Safe to merge
17.7%