Pre-Test Report — PR #573 "helios: tolerate omitted closing tags on complete tagged tool calls at EOS"
Verdict: REFER TO HARDWARE TESTING — but small, and as post-merge validation, not a merge gate
Test one host only: cn5, one GLM core, ~35 requests, ~45 minutes. Do not run a throughput A/B.
Door condition: the PR is already merged. Merge commit 2bdc8472 is on main ("helios: tolerate omitted closing tags on complete tagged tool calls at EOS (#573)"), merged 2026-11-28 21:17 by the author, lukealonso (COLLABORATOR and a charter-named priority contributor). Priority #1 of this review ("never test code that will need to be changed") therefore no longer decides the question: there is no revert-before-merge risk left, and nothing in my review is a blocking defect. What remains is that the change deliberately reverses a documented user-facing invariant (docs/api.md), its motivating premise has no captured evidence for any dialect, and the author ran no live serving run. A short served check is the cheapest way to close exactly that gap.
1. What the change actually is
9 production files, but the real behaviour change is ~150–190 net lines of CPU-side model-output parsing. No CUDA, no kernels, no scheduling, cache, admission or encoder policy. The diff is dominated by ~1,150 lines of tests plus, since review, 176 lines of Kani proofs.
Before: TaggedTools::finish(Termination::Eos) returned Err("incomplete <dialect> tool call") for every unclosed call.
After: at natural EOS a non-strict call is accepted if its argument body is structurally complete and self-delimited.
| Dialect | Recovery rule | Where |
|---|---|---|
| GLM argument tags | ≥1 closed <arg_key>/<arg_value> pair, valid name (no <, >, whitespace), non-empty body, non-strict |
argument_tags.rs:25-60, 109 |
| Qwen/MiMo function tags | ≥1 closed <parameter=…>; also at </tool_call>; empty rest |
chatml.rs:127-129 |
| Gemma 4 | brace-balanced {…}, no trailing text, non-strict |
gemma_call.rs:109-148 |
| MiniMax XML | ≥1 closed element, no leftover; also at </tool_call> |
minimax_xml.rs:168-186 |
Guarantees that visibly survive: undecided openers still reject (eos_decision rejects on !confirmed), unfinished JSON strings still reject, strict: true still rejects in all four dialects, and all non-EOS causes (OutputLimit, UserStop, Cancelled, ExecutionError) still omit (tagged.rs:247-263). Two genuine pre-existing bugs are fixed as a side effect (outer_tool_pending after an already-consumed </tool_call>, and call indexing for calls emitted during finish).
2. Why no defect blocks testing
I read the code at main, not only the diff, and re-checked every should-fix finding. Nothing substantive survives.
Resolved since the lenses ran — the reviews are stale by two commits:
- The
GemmaCall::parse_eosparse(…).remove(0)panic risk is gone. Mergedgemma_call.rs:147-149is a directparse_body(body, tools, true); the refactor removed the indexing. No empty-vec panic path. - Correctness open question "MiniMax/Gemma non-EOS leniency untested" is now tested (
minimax_xml.rsandchatml.rstests, plus the protocol matrix). - Value-prop required change 1 ("cite and supersede #514") was done at merge: #514 was closed by lukealonso with "Superseded by #573".
Invalid or resolved claims I am deliberately not carrying forward:
- "No per-model boolean flag" holds — one required trait method
parse_eos(tagged.rs:45) gated onstrict, a request field, not model identity. This is the correct shape and strictly better than #514'sconst LENIENT_EOS_CLOSE. - "Add a trait default for
parse_eos" should not be done — a default would silently make every dialect lenient and defeat the anti-fabrication contract. The simplicity lens is right here and the architecture lens's nit is wrong. - "Delete the
self.callsbump as unobservable" is wrong —tagged.rstests now assert post-finishcalls == 3and indices[1, 2]. Keep it.
What survives is real but cleanliness, not correctness — none of it is a reason to withhold hardware:
ToolDialect::parseis production-dead for three dialects (only the trait-defaultparse_candidatestill calls it); it is also the sole reason fourparse_body(…, eos: bool)wrappers exist.- The "find function by name, read
strict" idiom is duplicated four times with no shared helper (gemma_call.rs:123-129,minimax_xml.rs:162-166, and two differently-spelled precedents indsml.rs(not opened)/recipient.rs(not opened)). MiniMaxXml::parse_candidateandparse_eosare byte-identical, making the trait's documentedNonesignal unreachable for that dialect.docs/api.mdstates the recovery contract twice (:447-451,:514-525) with different exclusion lists — only the second mentions output limits and stop sequences. Its:524-525sentence also omitsCancelled/ExecutionErrorwhile reading as exhaustive.- Garbled user-visible error string:
"incomplete strict Gemma call tool call"(gemma_call.rs:128). - Test bloat: the subtractive lens calls ~700–760 of the 1,423 added lines removable. Since the PR is merged this is maintenance cost, not rework.
Two findings I judge not actionable: the "lenient at EOS" title understates that function-tag and MiniMax also recover at the outer closer — intended, documented at api.md:519,522, and tested; and "Gemma/MiniMax prose examples now execute" is inherent to those dialects having no opener confirmation (starts_call defaults to Some(true)), only reachable for non-strict tools, and consistent with merged #67.
3. What testing would actually add
Verification already in place — hardware must not redo it: 11/11 Kani harnesses (I read kani_proofs.rs; the four new output-parser proofs are oracle-based and self-consistent), cargo-mutants 168 mutants / 157 caught with both misses documented as mathematically equivalent, 206 passing unit/protocol/logprob/grammar tests, and a 5-dialect × 3-protocol × 6-scenario encoder test.
The one real gap is exactly the layer hardware can reach: the author discloses that checkpoint-gated tests (FLARE_*_TEST_SNAPSHOT for reasoning_delimiters, glm_frontend, parser_start, 4 ignored grammar:: tests, FLARE_TEST_TEMPLATE_DIR) and all live GPU serving were unrun. That is the tokenizer/grammar end-to-end path.
And the premise itself is unevidenced. The PR asserts four model families omit their closers, with no captured generation, checkpoint or reproduction for any of them. The evidence splits:
- For Qwen/function tags: merged #67 measured it — Qwen3.8 Flash ended its turn where
</tool_call>would follow in 7 of 20 logprob requests,<|im_end|>≈ 0.97 vs</tool_call>≈ 0.02. - For GLM: the only field report on this exact path, #133, recorded the
incomplete GLM tool callerror as deliberate and traced its failures to corrupted prepared graphs (fixed by #129, not by leniency); after re-export rejections went 1/84 → 0/84 with 84/84 HTTP 200. The one hard data point for GLM points the other way.
So the served run answers two questions at once: does the code work end-to-end, and does the failure mode it fixes actually occur?
4. Feasibility limits you must know before allocating the job
- No Gemma 4 and no MiniMax M3.1 checkpoint on either host. Two of the four changed dialects cannot be end-to-end tested with available hardware. Report this as a coverage gap; do not substitute.
- The harness cannot force a model to omit its closing tag. This is the honest ceiling of any end-to-end test here. Use the #67 shape (ask the model about its own chat-template/tool tags), which is the measured condition under which omission occurred. A 0-sample result is a finding, not a reason to inflate N.
- cn5 is the right host (amd64, 4 × 96 GiB, 48 CPUs). cn7's arm64 adds nothing — the parser is architecture-independent. On cn5, Dinov2 and vit are vision-only and have no tool parsing: irrelevant.
- Prepared-core risk. Serving needs a prepared core (
flare run <core>), not a raw HF checkpoint; the "0 GiB" size hints in the model list may just be cached HF references. If no GLM core exists, this job silently becomes a multi-hour ignition preparation job. Check for a prepared core (flare inspect, core cache) before scheduling. This is the single biggest threat to hardware-time efficiency. - Dialect is chosen by the prepared core's contract (
ToolParserKind,model/contract.rs:67) and recorded at preparation time by an external repo (local-inference-lab/hyperflare-recipes, perdocs/model-preparation.md:310-326). I cannot verify from this repository which kind each host checkpoint uses — confirm withflare inspectfirst.
5. Proposed test plan — cn5, GLM core, ~35 requests, ≤45 min
Serve the GLM core (flare run, flare-cli/src/cli.rs:45). Precondition: flare inspect reports ToolParserKind::GlmArgumentTags. If it reports DSML/XTML/TML/ATEM, the changed code is not on the request path and the job should be cancelled and re-planned.
| # | Check | Requests | Assertion | Why it is worth hardware |
|---|---|---|---|---|
| 0 | flare inspect core contract |
0 | dialect is GLM argument tags | Else the job tests nothing |
| 1 | #67-shape prompt, buffered + SSE | 10 | Zero HTTP 500s; no incomplete GLM tool call or other parser error frame |
The actual regression risk: strictness lost on a legitimate path |
| 2 | Ordinary tool calls, tool_choice:"auto" |
10 | finish_reason:"tool_calls"; arguments parse as declared JSON types; streamed function.arguments deltas concatenate exactly to the buffered value |
Confirms real tokens survive framing and events pair correctly |
| 3 | strict:true GLM tool |
3 | Still fails / is refused; never silently recovered | The guarantee the PR claims to preserve |
| 4 | max_tokens truncation mid-call |
3 | finish_reason:"length" and the unclosed call is omitted (no tool_calls) |
Truncation must still omit; the asymmetry the PR must not break |
| 5 | Optional, cn7 only: Qwen function tags | ~9 | Same as 1–2 | Second changed dialect, only if #1–4 are clean |
Excluded on purpose (would burn the job for nothing): throughput/latency A/B — the code is off the decode hot path and runs once per completed envelope, so any delta is noise; KV/prefix cache; multi-GPU/TP; MTP/speculation; CUDA-graph capture; Dinov2/vit; Gemma 4 and MiniMax (no checkpoint).
A/B baseline: worth it only for check 1, and only if a pre-merge binary or core can be reused cheaply. Otherwise skip — the parser is a closed system already covered by Kani, mutation testing and 206 unit tests. The served run's job is to prove the code is reachable and correct with real tokens, not to re-derive coverage.
Interpretation: a parser error in check 1, a silently recovered strict tool in check 3, or a recovered call in check 4 are genuine regressions of a merged change and warrant a follow-up PR immediately. Checks 1–4 taking 0 samples of the omission is not a failure — it means the motivating premise did not reproduce on this hardware, which is itself the most valuable thing this job can tell you, given #133.
6. Summary for the decision
Refer, minimally, one host. Not because the code is in doubt — I found no blocking or should-fix correctness defect, and the implementation is the architecturally correct one (shared trait method, no per-model flags, anti-fabrication, strict-tool and truncation guarantees intact, two real bugs fixed). Refer because a deliberately-reversed user-facing contract with zero captured model evidence and zero live serving runs is precisely the gap a 45-minute served check closes, and because the alternative — trusting ~1,150 synthetic tests that were all reconstructed from chat templates — is what the charter's "bring real evidence" rule was written to prevent. Expected value: moderate-to-high for confidence in the premise, high for confirmed non-regression on the GLM path; low information on throughput, which is why no A/B is proposed.