Repository navigation
serve_client, serve gates: ids_of refuses a response whose token ids are not all u32 ids - #1090
Conversation
…are not all u32 ids ids_of left out every entry that was no integer in u32's range and read a value that was no array as no ids, so an answer holding the expected ids plus a null reached a gate's reference comparison as the expected vector and passed. It now returns the ids or an error naming the entry (or the value that is no array), and every caller passes the error on: - the gates' `?` on each read; the clauses that read a non-200 answer as no ids read a 200 answer strictly; the streamed requests refuse an event whose tokens field holds no ids; - LookupCompletion::read and the step reference read their ids through it instead of their own deserializers; - the soak's drift probe and its chat-turn count refuse a malformed answer instead of reading it as no ids.
There was a problem hiding this comment.
Verdict: CLEAN: Token ID validation has one owner, and malformed IDs can no longer pass comparisons as shortened vectors.
Non-blocking
⚠ Show the regression failing first: crates/gpu-gates/src/serve_client.rs:1588. The PR shows only passing output. Restore the old filtering inside the new Result signature and attach the failing test output. This confirms the regression catches the original defect before future changes rely on it.
Checked
Duplicates: 1 new item checked, none duplicated. The JSON reader replaces two deserializers; the text ID parsers have a different contract. No dryer pairs were available.
Complexity: crapper flagged DS41 run, slots_together, tiered, converse, drafted; GLM slots_skipping, slots_sampled, drafted, draft_only, slots_one_pass; Qwen38 paged, churn_unhosted, plain; Qwen3 schema_jump_is_the_step_arms, placed_answers_a_prompt_past_the_gemm_walk. Growth is error propagation and explicit HTTP-status arms in existing functions.
Silent failure: 11 conversion, default and optional-field sites followed. Invalid IDs return errors or fail checks. Non-200 defaults remain guarded by status or nonempty-result checks.
Tests: static mutation review. At serve_client.rs:255, restoring invalid-entry filtering makes ids_of_refuses_what_is_no_id fail at expect_err. At serve_client.rs:946, changing the step reference to request two tokens makes stepped_completion_never_drafts_on_a_drafting_load fail. Empty arrays and u32 boundaries were checked.
Gates: no thresholds, pins, clauses or cases removed or relaxed. No inference hot path or unsafe block changed.
Escape catalog: no C1–C4 patterns matched.
Notes
Dryer did not run, according to diagnostics.md. Its stated reason conflicts with files.txt, which lists changed Rust files under crates/; manual duplicate searches were used. Builds and card gates were not rerun here. The PR includes unit-test and GPU gate output from NVIDIA GB10.
Card check: gpu-evidence. This pull request changes crates/gpu-gates/src/bin/gate_ds41_serve.rs, crates/gpu-gates/src/bin/gate_gemma_embedding2_serve.rs, crates/gpu-gates/src/bin/gate_glm5next_serve.rs … and carries a gate run on the author's card, which counts as verified.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
Filed outside this PR: #1091
|
The review is done and the contribution check passed, so I'm merging this. |
서버 게이트가 토큰 id가 아닌 값이 섞인 응답을 조용히 넘기지 않고 이름 붙은 오류로 거부하도록 고쳤습니다.
What and why
Fixes #1075.
serve_client::ids_ofdropped every entry that was not au32id and read a value that was no array as "no ids". A server answer such as[expected..., null]therefore reached a reference comparison as the expected vector and passed.ids_ofnow returnsResult<Vec<u32>, GateError>and refuses both cases by name:token ids: <v> is no arrayandtoken ids: entry <i> (<x>) is no u32 id in <v>.Every caller passes the error on with
?.LookupCompletion::readand the step reference read their ids throughids_ofinstead of their own deserializers. Clauses that read a failed request as "no ids" to print a FAIL check keep that for a non-200 answer and read a 200 answer strictly. A streamed event with atokensfield must hold ids.Release notes: Fixed: server gates refuse a response whose token ids are not all valid ids instead of comparing a shortened list.
Code shape
The review reads these first. A box left unticked needs one line of why.
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), or "none":LookupCompletion::readandstepped_completionincrates/gpu-gates/src/serve_client.rseach had their ownserde_json::from_value::<Vec<u32>>id reader; both now callids_of.What I ran
Base
0dbe02c685491bfb3bd5297ccc1541a0e1112454, PR headd6c68c43623810541c9060356fef34442a45ba46.Every gate binary that reads
ids_ofcompiles, with the unit tests:The unit tests, including the new
ids_of_refuses_what_is_no_id(anullentry in[7, null, 8]and a non-array value are refused):The Qwen3.8 serve gate, which drives
bloomery-serve-qwen38and holds the drafted clauses the issue names, on the fixture tier (draft modelmtp-Qwen3.8-Flash-Next-shared-Q8_0.gguf):The three
PASSlines are the plain, drafted and lookup arms; 136 checks passed and none failed.AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.