Repository navigation
serve readers: read SSE frames whole in every gate and check the soak's paired chat answer - #1114
Conversation
…e reader cannot read is refused by name, not skipped
… unknown is refused before its ids are compared
…he shared boundary
…'s paired chat answer
There was a problem hiding this comment.
Verdict: CLEAN: No blocking defect remains in the changed readers.
Non-blocking
⚠ Pin the paired chat consumer: crates/gpu-gates/src/bin/soak_ds41_serve.rs:757.
The new test calls chat_answer directly at line 1538 and never calls Mix::pair. Deleting chat_answer(st, body)? here restores the reported bug without failing those assertions.
Add a mock HTTP 200 response with malformed chat content through Mix::pair to protect this call before further soak changes.
Checked
Duplicates: 23 new definitions checked, excluding the stream rename; no duplicate owner found. No dryer pairs were available.
Complexity: CompletionStream::read (16) renames the existing reader and adds HTTP/body framing. sse_errors (1→9), Mix::pair (13→20), Mix::chat (12→17), cut_of (13→16) and DS41 run (90→95) add reply validation. DS41 tiered/drafted, GLM draft_only/drafted/slots_flow_together/slots_skipping/plain/width_cost and MiniMax greedy_probs grow by one or two checks.
Silent failure: 7 added production sites followed. Optional delta content is validated before omission; an absent deferral remains reported; malformed paired HTTP status increments transport failures; ignored Drop cleanup results do not become response data.
Tests: static mutation review covers all four new tests and the changed lookup test. Skipping malformed frames or grid entries, accepting missing stop types, dropping the EOF completion check, or accepting a lookup reasoning-loop stop fails an assertion. The paired consumer gap is above.
Gates: no existing band, threshold, clause or case was relaxed or removed. FAIL-first evidence is supplied for the reader fixes.
Escape catalog: C1–C4 do not match. No inference hot path changed.
Notes
Dryer did not run; diagnostics reports no eligible changed Rust files despite the crate changes.
Tests were not executed during this review. The PR supplies host reader test output, but no just gate-* card run.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_clef_serve.rs, crates/gpu-gates/src/bin/gate_ds41_serve.rs, crates/gpu-gates/src/bin/gate_glm5next_serve.rs … and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
The review is done and the contribution check passed, so I'm merging this. |
서빙 gate와 soak의 응답 reader가 읽지 못한 응답을 건너뛰지 않고 이름을 밝혀 거부하게 고칩니다.
What and why
The serve gates, the DeepSeek V4.1 soak and the decide seat gate read a served reply with defaults that hide a malformed one: a missing
stop_typebecame an empty string, an SSE frame without the exactdata:prefix was skipped, a 200 body that was not JSON counted as no answer, and a set D grid entry that was not an unsigned integer was dropped. A gate could succeed on less than the server sent.Fixes #1091. Fixes #1094. Each reader now refuses what it cannot read, by name, before the ids are compared or the answer is stored.
serve_client::stop_ofis the one reader of a completion'sstop_typeand accepts only the stops the server emits.serve_client::sse_eventsandsse_eventare the one reader of an SSE body, used by the soak and by the Qwen3, Qwen3.8 and DeepSeek V4.1 serve gates. The soak also reads the paired chat answer and every fresh completion through the same readers.gate_clef_servereads set D'simage_grid_thwandimage_spansas exactly the unsigned integers they hold. No server, model or kernel code changed, and no speed is claimed.Release notes: Fixed: the serve gates and the DeepSeek V4.1 soak refuse a reply, SSE frame or set D entry they cannot read instead of skipping it.
Code shape
copying it (
AGENTS.md"Common code first",docs/rust-quality.mdR14). Where I found an existing copy, Inamed it below.
(tensor shapes, the attention kind, the quant). A common owner gained no per-model branch, flag or trait method.
tools/check-comments.sh).PIN(YYYY-MM-DD):and its reason.
cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line): the soak's own SSE event splitter, its copy of the chat answer read andLookupCompletion's ownstop_typereader are gone; they usecrates/gpu-gates/src/serve_client.rs:253(sse_events),:270(sse_event) and:324(stop_of). The one remainingstrip_prefix("data: ")is atcrates/gpu-gates/src/serve_client.rs:258.What I ran
Base
d748b6e0d5d12a32bffbe4d25a096e280f4cd5be, PR head5c35d35baabc6fa1b9e405ab9e83b70f43cf8036.Before and after, the reader tests run against the upstream/main reader bodies and against this branch's readers (a scratch crate that holds both bodies, run on a Mac; the full
bloomery-gpu-gatescrate withdeepseek41needs a CUDA toolkit):For #1094, a completion whose ids equal the reference with
stop_typeremoved,null,1,true,{},"","EOS"or"stop", read by the oldas_str().unwrap_or("")andagreeagainststop_of:Unit tests of the changed readers, built and run with
cargo oxideon a DGX Spark:gate_qwen38_serve(--features deepseek41,gemma-embedding2,hf),gate_ds41_serve(--features deepseek41,vision,gemma-embedding2,hf) andgate_qwen3_serve(thegate_clef_servefeature list) build with the same command shape and their test harness passes (test result: ok. 0 passed; 0 failed, no unit tests in those binaries).Card and driver of that run:
Clippy ratchet on the PR head, on an RTX 5090 machine:
AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.