Skip to content

helios: support thinking_token_budget for ContentHeaders and trim incomplete UTF-8 tails on cut - #615

Merged
yatesdr merged 1 commit into
NVIDIA:mainfrom
newjordan:feat/helios-tml-thinking-budget
Nov 29, 2026
Merged

yatesdr merged 1 commit into
NVIDIA:mainfrom
newjordan:feat/helios-tml-thinking-budget

Conversation

@newjordan

@newjordan newjordan commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Why

Models using TMLv0 content-header reasoning (ReasoningParserKind::ContentHeaders, such as Inkling-2-Mini and Inkling-2-Small) begin generation at a frame boundary (OutputStart::RecipientFrame) and enclose reasoning inside <|content_thinking|> ... <|end_message|>. Currently thinking_budget_close() in helios/src/server/request.rs accepts only OutputStart::Reasoning and OutputStart::Content, so both per-request thinking_token_budget and [server] thinking_token_budget fail with an unsupported-format error on TMLv0 cores even though TmlOutput::reasoning_open() already tracks open thinking frames and <|end_message|> is a single control token.

Two frame-boundary issues also affect hard reasoning cuts:

  • Closing a TMLv0 <|content_thinking|> frame with <|end_message|> alone returns the model to State::Frame, where it can immediately open a second <|content_thinking|> frame after the one-shot ReasoningCut has been consumed.
  • On byte-level BPE tokenizers, a hard token cap can land in the middle of a multi-byte UTF-8 character, leaving 1–3 dangling UTF-8 bytes immediately before the forced close token in the re-prefilled continuation prompt (Worker::park()).

What changed

  • Output control-token resolution (helios/src/output/tml.rs, helios/src/output/pipeline.rs):
    • Before: OutputConfig exposed no follow-on frame-opener helper for reasoning cuts.
    • After: Adds tml::text_frame_opener() and OutputConfig::reasoning_close_tail(), which resolves [<|message_model|>, <|content_text|>] directly from the already-validated single-token output.control_tokens when ReasoningParserKind::ContentHeaders is active and output.content.tools.is_empty().
  • Request preparation and startup validation (helios/src/server/request.rs, helios/src/server/config.rs):
    • Before: thinking_budget_close() returned Ok(None) for OutputStart::RecipientFrame and OutputStart::RecipientHeader, rejecting both per-request and [server] thinking_token_budget on ContentHeaders cores; ReasoningCut carried a single close: u32; and Bootstrap::load() called frontend.prepare_token_bytes() only when model.max_top_logprobs != 0.
    • After: thinking_budget_close() accepts OutputStart::RecipientFrame and OutputStart::RecipientHeader when ReasoningParserKind::ContentHeaders is configured with a single-token close delimiter (RecipientHeaders behavior is unchanged). prepare_validated_inference() constructs ReasoningCut::close: Vec<u32> once, appending output.reasoning_close_tail() only when grammar.is_none() and 1 + tail.len() < after as usize (leaving at least one output token after the frame header so partial headers are never injected). Bootstrap::load() prepares VocabularyBytes unconditionally so token-byte lookup never initializes lazily on the worker thread. Omitting thinking_token_budget (including with reasoning_effort="none" or enable_thinking=false) continues to leave requests uncapped, and no visible transition text is inserted.
  • Forced-cut execution and exact UTF-8 boundary hygiene (helios/src/server/runtime.rs):
    • Before: Worker::publish() injected a single cut.close token, and Worker::park() appended forced close tokens directly onto live.tokens().
    • After: ReasoningCut::close holds the prepared Vec<u32> sequence. When reasoning is open at the cap and any grammar allows the single-token close, Worker::publish() emits each token in cut.close through Active::close_reasoning(), records every injected token in decoded history and progress metrics, and subtracts injected.len() from cut.after (preserving output_event_capacity() and total generated_tokens). In Worker::park(), when appended is non-empty, trim_incomplete_utf8_tail() inspects exact token bytes via Frontend::token_bytes() and std::str::from_utf8(), dropping trailing generated tokens at indices >= live.prompt_tokens only when Utf8Error::error_len().is_none(). Valid characters—including legitimately generated literal U+FFFD tokens—are preserved, small passes (generated_len <= 3, e.g., after preemption) trim cleanly before tokens.extend_from_slice(appended) restores tokens.len() > incoming.prompt.tokens.len(), and preemption (appended empty) and unforced continuations are untouched.
  • Documentation and tests (docs/api.md, helios/src/server/config.rs, helios/src/server/protocol/decode.rs, helios/src/server/request/tml_tests.rs, helios/src/server/runtime/phase_tests.rs):
    • Updated docs/api.md to document ContentHeaders support, UTF-8 incomplete-tail trimming across all reasoning formats on forced cuts, and silent TMLv0 text-frame opener tokens when no tools or grammar are active.
    • Added tests covering [server] thinking_token_budget bootstrap validation, synthetic and real Inkling-2 tokenizer request preparation (tml_tests.rs), Worker sequence injection and OutputPipeline decoding, and exact UTF-8 trimming (1-byte/2-byte incomplete tails, generated_len == 1 and 2, literal U+FFFD preservation, complete multi-byte preservation, and unforced continuation preservation).

Claimed benefit

  • Enables per-request thinking_token_budget (Chat Completions, Responses, Messages), Anthropic thinking.budget_tokens hard caps, and [server] thinking_token_budget defaults on ContentHeaders / TMLv0 cores instead of returning HTTP 400.
  • Keeps TMLv0 plain-text continuations directly inside Body::Text via silent control tokens (<|message_model|><|content_text|>) without inserting visible transition text, while leaving tool calls and structured output grammars unobstructed.
  • Eliminates dangling incomplete UTF-8 byte tokens before forced close tokens across all reasoning formats in Worker::park() without dropping literal U+FFFD tokens or affecting preemption and unforced continuations.

Supporting evidence and limitations

  • CPU release test suites on main@2147cd4 (with FLARE_TEST_TEMPLATE_DIR prepared via tests/frontend/prepare_templates.py):
    • cargo test --locked --release --manifest-path helios/Cargo.toml --features runtime-core,server -- --skip engram::: 1,685 passed, 0 failed, 46 ignored (lib, including response_lifecycle_tests::native_responses_match_lifecycle_model, unread_response_keeps_its_budget_through_a_reasoning_continuation, and all new TMLv0/UTF-8 tests) plus 62 passed, 0 failed across integration test binaries.
    • cargo test --locked --release --manifest-path flare/Cargo.toml: 242 passed, 0 failed, 4 ignored.
    • cargo check --locked --release --manifest-path flare-cli/Cargo.toml --tests: compiled cleanly.
  • Real Inkling-2 tokenizer tests (FLARE_INKLING2_TEST_SNAPSHOT with thinkingmachines/Inkling-2-Mini tokenizer.json):
    • cargo test --locked --release --manifest-path helios/Cargo.toml --features runtime-core,server server::request::tml_tests:: -- --ignored: 6 passed, 0 failed (prompts_match_tml_renderers_token_for_token, message_endpoints_are_prefixes_of_longer_conversations, outputs_match_reference_parses, images_preserve_reference_order_feature_spans_and_message_endpoints, structured_output_grammars_constrain_frames, and new thinking_budget_prepares_content_headers_cut).
  • Live GPU serving verification (NVIDIA GB10, SM121, prepared Inkling-2-Mini core served via this branch's release flare run binary):
    • Plain Chat Completions (thinking_token_budget=32 / 64, max_tokens=256, seed=7):
      • Merge sort prompt (budget=32): HTTP 200, flare_reasoning_budget_cuts_total 0 -> 1, reasoning_tokens=32, continued immediately in content ("# Step-by-Step Explanation of Merge Sort's O(n log n) Complexity...").
      • Arithmetic prompt (17 * 23, budget=64): HTTP 200, cuts 1 -> 2, reasoning_tokens=64, finish_reason="stop", content="17 * 23 = 17 * (20 + 3) = 340 + 51 = **391**.".
      • Multi-byte Unicode prompt (— “quote” ⬢ café 世界 …, budget=32): HTTP 200, cuts 2 -> 3, reasoning_tokens=32, finish_reason="stop", clean UTF-8 content with zero U+FFFD.
    • Active tools Chat Completions (tools=[get_weather], thinking_token_budget=32): HTTP 200, cuts 3 -> 4, reasoning_tokens=32, finish_reason="tool_calls", content=null, tool_calls=[{"name":"get_weather","arguments":"{\"city\":\"Tokyo\"}"}] (confirming <|end_message|> alone preserves tool invocation frames).
    • Structured JSON grammar (response_format={"type":"json_object"}, thinking_token_budget=32): HTTP 200, cuts 4 -> 5, reasoning_tokens=32, finish_reason="stop", content='{"answer":391}'.
    • Anthropic Messages (/v1/messages, thinking={"type":"enabled","budget_tokens":48}): HTTP 200, cuts 5 -> 6, stop_reason="end_turn", emitted both thinking and text blocks cleanly.
    • Uncapped reasoning_effort="none" (no budget): HTTP 200, cuts 6 -> 6 (no cut triggered), finish_reason="stop", content="ready".
    • [server] thinking_token_budget = 64: started cleanly, /v1/models advertised flare.thinking_token_budget: 64, and a Chat request omitting a per-request budget hit cuts=1, reasoning_tokens=64, finish_reason="stop", with complete text output.
  • Limitations and unrun checks:
    • engram:: io_uring tests were skipped in the main run because two tests hit ENOMEM (io_uring_register_buffers) under the host's unprivileged 8 MiB RLIMIT_MEMLOCK (the Linux CI workflow raises memlock to 64 MiB; engram is untouched).
    • The TLA+ TLC runner (verification/helios-lifecycle/check.py) was not executed locally because java / tla2tools.jar is not installed on this host (no scheduler, admission, cache-ownership, or rank-coordination code changed, and the Rust response_lifecycle_tests::native_responses_match_lifecycle_model and unread_response_keeps_its_budget_through_a_reasoning_continuation checks ran and passed).
    • Live serving validation covered single-GPU SM121 text-only Inkling-2-Mini; Inkling-2-Small, vision inputs, and TP > 1 were not live-tested.

Discord: frosty40

@flare-autobot

Copy link
Copy Markdown
Collaborator

A case file has been opened for 615.
Case File Intake Report

Future reviews will auto-run 90 minutes after code updates are pushed.

  • Re-review sooner: Call @flare-autobot after push.
  • Opt-out: Include #autobot:ignore in the PR or any comment.

@flare-autobot flare-autobot added area:api Serving API, protocol encoding, tool parsing, and client-visible behavior. enhancement New feature or request triage:review Proposed change needs code review; this does not imply merge readiness. labels Nov 29, 2026
@flare-autobot

Copy link
Copy Markdown
Collaborator

Autobot Review

Full Review · Value Proposition · Case File

Recommendation: Changes Requested

Closes a real feature gap and the core accounting is sound, but three verified issues need changes: the U+FFFD trim heuristic, duplicated TML transition tokens, and missing real-checkpoint verification.

  • Blockers: 0 · Should fix: 3 · Subtract/Simplify: 1 · Nits: 3
Walkthrough
  • helios/src/server/request.rs (381-401, 543-578): Widens thinking_budget_close() to accept OutputStart::RecipientFrame and OutputStart::RecipientHeader for single-token ContentHeaders close delimiters, and adds tml_text_transition_tokens() to attach [<|message_model|>, <|content_text|>] as ReasoningCut::close_tail when PromptEncoder::TmlV0 + ContentHeaders is active, no tools or grammar are active, and 1 + tail.len() < after.
  • helios/src/server/runtime.rs (50-61, 1956-2017, 2129-2156): Extends ReasoningCut with close_tail, injects [close, ...close_tail] sequentially through Active::close_reasoning() in Worker::publish() (recording each injected token in decoded history and metrics.progress, and subtracting injected.len() from cut.after), and adds a trailing-'\u{FFFD}' trim loop (up to 3 generated tokens within an 8-token window) in Worker::park() when appended is non-empty.
  • docs/api.md (813-842): Documents ContentHeaders budget support, silent <|message_model|><|content_text|> injection when tools and grammar are absent, UTF-8 tail trimming on forced cuts, and updated HTTP 400 wording.
  • helios/src/server/config.rs (663-710), helios/src/server/protocol/decode.rs (2032-2222), helios/src/server/runtime/phase_tests.rs (415-420, 680-879): Adds unit and worker-loop tests covering bootstrap validation, request preparation across plain/tight-capacity/tools/tool_choice="none"/grammar/Messages/uncapped cases, close_tail injection and OutputPipeline decoding, and byte-level incomplete UTF-8 trimming versus plain continuation.
Merge Risk: Medium · up to 2652c06
  • helios/src/server/runtime.rs (Worker::publish and Worker::park) is a shared hot path used by every reasoning format and every parked/preempted continuation; the new UTF-8 trim runs on all forced reasoning cuts across all formats (not only ContentHeaders).
  • Worker::park() executes up to 4 synchronous frontend.decode calls on the worker thread per forced cut, with no real-checkpoint or live serving validation yet confirming the injected <|message_model|><|content_text|> continuation behavior on Inkling 2 models.
  • No wire/ABI, captured-graph, scheduler state-machine, or lock/contention changes are introduced; preemption (park_if_preempted passing &[]) and uncapped requests are unaffected.
Pre-merge checks: ✅ 2 passed · ⚠️ 2 warnings

Have your agent review the Full Review for complete verified findings, file:line citations, and suggested changes.

To opt out, include #autobot:ignore in your post or comment.

…omplete UTF-8 tails on cut

Models using TMLv0 content-header reasoning (ReasoningParserKind::ContentHeaders,
such as Inkling-2) begin generation in OutputStart::RecipientFrame and delimit
reasoning frames with <|content_thinking|> ... <|end_message|>. Currently
thinking_budget_close rejects OutputStart::RecipientFrame and
OutputStart::RecipientHeader, so both per-request thinking_token_budget and
[server] thinking_token_budget return an unsupported-format error on TMLv0 cores
even though TmlOutput::reasoning_open already tracks open thinking frames. In
addition, closing a TMLv0 frame with <|end_message|> alone returns to frame
boundary state where the model can open a second uncapped thinking frame, and
hard token cutoffs in Worker::park can slice a multi-byte UTF-8 sequence before
appending forced close tokens, leaving dangling lead bytes in the re-prefilled
continuation prompt.

Before: thinking_budget_close accepted only OutputStart::Reasoning and
OutputStart::Content; ReasoningCut carried a single close token;
Bootstrap::load prepared Frontend::token_bytes only when max_top_logprobs != 0;
and Worker::park appended forced close tokens directly after live.tokens()
without checking for incomplete trailing UTF-8 byte sequences.

After:
- helios/src/output/tml.rs and helios/src/output/pipeline.rs: add
  tml::text_frame_opener and OutputConfig::reasoning_close_tail to resolve
  [<|message_model|>, <|content_text|>] directly from the already-validated
  single-token output.control_tokens when ReasoningParserKind::ContentHeaders is
  active and no tools are active.
- helios/src/server/request.rs: extend thinking_budget_close to accept
  OutputStart::RecipientFrame and OutputStart::RecipientHeader for
  ReasoningParserKind::ContentHeaders with a single-token close delimiter, and
  construct ReasoningCut::close as a single non-empty Vec<u32> once at
  preparation time (appending output.reasoning_close_tail() when grammar is
  absent and close.len() + tail.len() < after as usize, leaving at least one
  visible output token after the frame header). Omitting thinking_token_budget
  (including reasoning_effort="none" or enable_thinking=false) leaves requests
  uncapped.
- helios/src/server/config.rs: call frontend.prepare_token_bytes()
  unconditionally at bootstrap so VocabularyBytes is never built lazily on the
  worker thread during a forced cut.
- helios/src/server/runtime.rs: change ReasoningCut::close to Vec<u32>, emit
  the prepared sequence through Active::close_reasoning in Worker::publish
  (recording each injected token in decoded history and metrics and subtracting
  injected.len() from cut.after), and add trim_incomplete_utf8_tail in
  Worker::park when appended is non-empty. The helper inspects exact token bytes
  via Frontend::token_bytes and std::str::from_utf8, dropping trailing generated
  tokens at indices >= live.prompt_tokens only when Utf8Error::error_len() is
  None (preserving literal U+FFFD tokens and complete multi-byte characters, and
  handling passes with generated_len <= 3 cleanly before extending with
  appended). Preemption (appended empty) is unchanged.
- docs/api.md: document ContentHeaders support, UTF-8 incomplete-tail trimming
  on forced cuts across all reasoning formats, and silent TMLv0 text-frame
  control token injection when no tools or grammar are active.
- Tests in config.rs, protocol/decode.rs, request/tml_tests.rs, and
  runtime/phase_tests.rs cover [server] thinking_token_budget bootstrap
  validation, synthetic and real Inkling-2 tokenizer request preparation,
  Worker sequence injection and capacity accounting, and exact UTF-8 trimming
  (including literal U+FFFD preservation and generated_len == 1 and 2 passes).

Claimed benefit: enables per-request thinking_token_budget, Anthropic Messages
thinking.budget_tokens hard caps, and [server] thinking_token_budget defaults on
TMLv0 ContentHeaders cores without inserting visible transition text, keeps
plain-text continuations inside Body::Text without re-entering thinking while
preserving tool calls and grammars, and prevents truncated multi-byte UTF-8
suffixes from leaking across forced cuts for all reasoning formats.

Evidence and limitations: verified against main@2147cd4:
- CPU release suites (FLARE_TEST_TEMPLATE_DIR from prepare_templates.py):
  helios (--features runtime-core,server -- --skip engram::) 1,685 lib + 62
  integration passed (0 failed, 46 ignored, including
  response_lifecycle_tests::native_responses_match_lifecycle_model and
  unread_response_keeps_its_budget_through_a_reasoning_continuation);
  flare 242 passed (0 failed, 4 ignored); flare-cli --tests compiled cleanly.
- Real Inkling-2 tokenizer (FLARE_INKLING2_TEST_SNAPSHOT=/tmp/inkling2-tokenizer):
  server::request::tml_tests:: (-- --ignored) 6/6 passed (0 failed), including
  thinking_budget_prepares_content_headers_cut.
- Live GPU serving on NVIDIA GB10 (SM121, prepared Inkling-2-Mini core via
  flare run): verified HTTP 200 and flare_reasoning_budget_cuts_total increments
  on plain Chat Completions (budget=32 and 64, including multi-byte Unicode
  prompt — clean text continuation with reasoning_tokens=32/64 and zero U+FFFD),
  tools-active Chat Completions (budget=32 -> clean get_weather tool_call),
  json_object grammar (budget=32 -> valid JSON {"answer":391}), Anthropic
  Messages (budget_tokens=48 -> thinking + text blocks, stop_reason=end_turn),
  uncapped reasoning_effort="none" (0 cuts), and [server] thinking_token_budget
  = 64 (/v1/models advertisement and automatic cut).
Limitations: engram:: io_uring tests hit the host's unprivileged 8 MiB
RLIMIT_MEMLOCK (CI raises memlock to 64 MiB; engram is untouched); the TLA+ TLC
runner (verification/helios-lifecycle/check.py) was not run locally because
Java/tla2tools.jar is not installed (no scheduler, admission, cache-ownership,
or rank-coordination code changed, and the Rust response-lifecycle conformance
test passed); live serving tested single-GPU SM121 text-only Inkling-2-Mini.

Signed-off-by: Jordan Newman <newjordan@gmail.com>
Design-Signed-Off-By: Antigravity (Gemini); design-review=2e5b
@newjordan
newjordan force-pushed the feat/helios-tml-thinking-budget branch from 2652c06 to 7dde009 Compare November 29, 2026 19:53
@newjordan

Copy link
Copy Markdown
Contributor Author

Addressed all findings from the review:

  1. Exact UTF-8 boundary checking + bootstrap token-byte prep (helios/src/server/runtime.rs, helios/src/server/config.rs):

    • Replaced the frontend.decode / '\u{FFFD}' heuristic in Worker::park() with trim_incomplete_utf8_tail(), using Frontend::token_bytes() and std::str::from_utf8() to drop trailing generated tokens at indices >= live.prompt_tokens only when Utf8Error::error_len().is_none().
    • Removed the generated_len - 1 trim floor so small/post-preemption passes (generated_len <= 3) trim cleanly before tokens.extend_from_slice(appended).
    • Removed the model.max_top_logprobs != 0 gate around frontend.prepare_token_bytes()? in Bootstrap::load() so VocabularyBytes is initialized at startup rather than lazily on the worker thread.
    • Added regression tests in helios/src/server/runtime/phase_tests.rs for literal U+FFFD preservation ([0xEF, 0xBF, 0xBD]) and generated_len == 1 and 2 incomplete UTF-8 tails.
  2. Resolved TML frame opener from output.control_tokens (helios/src/output/tml.rs, helios/src/output/pipeline.rs, helios/src/server/request.rs):

    • Deleted tml_text_transition_tokens() from request.rs.
    • Added tml::text_frame_opener() and OutputConfig::reasoning_close_tail(), reusing tml::MODEL and tml::TEXT against the already-validated single-token output.control_tokens.
  3. Collapsed ReasoningCut into a single token sequence (helios/src/server/runtime.rs, helios/src/server/request.rs):

    • Replaced close: u32 + close_tail: Vec<u32> with close: Vec<u32> built once at preparation time and removed the duplicated include_tail re-check and Vec rebuild in Worker::publish().
  4. Real-tokenizer and live Inkling-2-Mini verification (helios/src/server/request/tml_tests.rs, NVIDIA GB10 SM121):

    • Added thinking_budget_prepares_content_headers_cut to tml_tests.rs and ran server::request::tml_tests:: -- --ignored against the real Inkling-2-Mini tokenizer.json (6/6 passed).
    • Built this branch's release flare binary on SM121 (NVIDIA GB10) and verified live flare run serving against a prepared Inkling-2-Mini core across plain Chat Completions (budget=32/64 + Unicode prompt, entering content directly with reasoning_tokens=32/64 and zero U+FFFD), active tools (budget=32 -> finish_reason="tool_calls" calling get_weather), json_object grammar ({"answer":391}), Anthropic Messages (budget_tokens=48), uncapped reasoning_effort="none" (0 cuts), and [server] thinking_token_budget = 64.
  5. Nits:

    • Updated the plural comment in runtime.rs (forced tokens), clarified in docs/api.md that UTF-8 tail trimming applies to all reasoning formats on forced cuts, and reused crate::output::tml::CONTROL_MARKERS in both config.rs and protocol/decode.rs tests.

@flare-autobot please re-review.

@flare-autobot flare-autobot added the performance Performance, latency, throughput, or memory-efficiency investigation or improvement. label Nov 29, 2026
@flare-autobot

Copy link
Copy Markdown
Collaborator

Autobot Review

Full Review · Value Proposition · Case File

Recommendation: Ready To Merge

All Round 1 findings are verified resolved at head 7dde009 with no blockers introduced; capacity arithmetic, grammar/tool gating, prompt metadata/vision invariants, and TmlOutput state transitions hold. Wait for CI to run green on 7dde009 before merging.

  • Blockers: 0 · Should fix: 0 · Subtract/Simplify: 0 · Nits: 4
Walkthrough
  • helios/src/output/tml.rs (46-57) & helios/src/output/pipeline.rs (26-41): Adds tml::text_frame_opener() reusing tml::MODEL/tml::TEXT against validated single-token output.control_tokens, and exposes OutputConfig::reasoning_close_tail() when ReasoningParserKind::ContentHeaders is active with no tools.
  • helios/src/server/request.rs (380-400, 539-560): Widens thinking_budget_close() to accept OutputStart::RecipientFrame/RecipientHeader for single-token ContentHeaders close delimiters (leaving RecipientHeaders unchanged); builds ReasoningCut::close: Vec<u32> once at preparation, appending output.reasoning_close_tail() only when grammar.is_none() and tokens.len() + tail.len() < after as usize.
  • helios/src/server/config.rs (279-281, 663-696): Calls frontend.prepare_token_bytes()? unconditionally in Bootstrap::load() and adds a ContentHeaders [server] thinking_token_budget bootstrap validation test.
  • helios/src/server/runtime.rs (50-69, 417-461, 1994-2048, 2156-2177): Collapses ReasoningCut::close to Vec<u32>, enforces single-token grammar advancement (cut.close.len() == 1 && grammar.allows(cut.close[0])), emits injected close tokens via Active::close_reasoning() plus decoded history/progress metrics while subtracting injected.len() from cut.after, and trims trailing incomplete UTF-8 byte tokens at indices >= live.prompt_tokens in Worker::park() before appending forced close tokens.
  • docs/api.md (813-835) & tests: Documents ContentHeaders support, silent <|message_model|><|content_text|> opener injection, and cross-format UTF-8 tail trimming; adds synthetic, worker-loop, UTF-8 edge-case, and real Inkling-2 tokenizer snapshot tests.
Merge Risk: Low · up to 7dde009
  • helios/src/server/runtime.rs (Worker::publish, Worker::park) is a shared single-threaded worker path; trim_incomplete_utf8_tail() runs only on forced reasoning cuts (!appended.is_empty()), inspects at most 8 trailing tokens via O(1) Frontend::token_bytes() lookups, and leaves preemption (&[]), unforced continuations, and uncapped requests untouched.
  • Bootstrap::load() (helios/src/server/config.rs:281) now calls frontend.prepare_token_bytes()? unconditionally; all current cores (max_top_logprobs == 20 != 0) already did this at startup, and eager init avoids a synchronous worker-thread stall on the first forced cut for legacy max_top_logprobs == 0 cores.
  • No wire/ABI, captured-graph, scheduler state-machine, or lock/contention changes; verified conflict-free with open PRs #457 and #582.
Pre-merge checks: ✅ 3 passed · ⚠️ 1 warnings
  • ✅ Security / malicious screen: No prompt-injection attempts, unsafe code, external I/O, or credential/trust-boundary changes.
  • ✅ Charter & value fit: Implements the documented thinking_token_budget API across Chat/Responses/Messages for ContentHeaders cores without per-model branches in the server layer; format markers live in helios/src/output/tml.rs.
  • ✅ Related / duplicate / conflict check: Additive over #167; zero behavioral or file conflict with open #457 (non-empty header EOS check cannot fire on <|message_model|><|content_text|>) or open #582 (readmitted prompt is strictly longer than live.prompt_tokens, P' >= P + 1).
  • ⚠️ Tests & verification evidence: Substantive CPU unit/worker tests, real Inkling-2-Mini tokenizer snapshot tests (6/6 --ignored), and live GB10/SM121 serving across 7 scenarios are reported passing, but no CI status checks are recorded on head 7dde009 yet (confirm CI passes before merge).

Have your agent review the Full Review for complete verified findings, file:line citations, and suggested changes.

To opt out, include #autobot:ignore in your post or comment.

@yatesdr
yatesdr merged commit e4d8eb6 into NVIDIA:main Nov 29, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:api Serving API, protocol encoding, tool parsing, and client-visible behavior. enhancement New feature or request performance Performance, latency, throughput, or memory-efficiency investigation or improvement. triage:review Proposed change needs code review; this does not imply merge readiness.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants