fix(frontend): preserve split UTF-8 characters - #12688
Merged
Merged
Conversation
xianlubird
temporarily deployed
to
external_collaborator
August 5, 2026 06:11 — with
GitHub Actions
Inactive
xianlubird
temporarily deployed
to
external_collaborator
August 5, 2026 06:11 — with
GitHub Actions
Inactive
xianlubird
force-pushed
the
bug/sglang-utf8-streaming
branch
from
August 5, 2026 06:20
0390618 to
8ca8b96
Compare
xianlubird
temporarily deployed
to
external_collaborator
August 5, 2026 06:20 — with
GitHub Actions
Inactive
Contributor
|
/ok to test 8ca8b96 |
xianlubird
marked this pull request as ready for review
August 5, 2026 06:20
Contributor
WalkthroughThe SGLang processor now buffers incomplete UTF-8 output during incremental decoding, suppresses intermediate replacement characters, and flushes valid trailing U+FFFD output when generation finishes. Unit tests cover split multibyte characters and final-only flushing. ChangesIncremental decoding
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
This comment has been minimized.
This comment has been minimized.
rmccorm4
reviewed
Aug 6, 2026
Signed-off-by: xianlubird <xianlubird@gmail.com>
xianlubird
force-pushed
the
bug/sglang-utf8-streaming
branch
from
August 6, 2026 02:03
8ca8b96 to
03ed922
Compare
xianlubird
temporarily deployed
to
external_collaborator
August 6, 2026 02:03 — with
GitHub Actions
Inactive
Contributor
|
/ok to test 03ed922 |
rmccorm4
enabled auto-merge (squash)
August 6, 2026 02:38
rmccorm4
approved these changes
Aug 6, 2026
hhzhang16
added a commit
that referenced
this pull request
Aug 6, 2026
dyn-3691-extract-shared-target-pid-cuda-customstorage-operation-layer * 'main' of https://github.com/ai-dynamo/dynamo: (65 commits) fix(frontend): emit SGLang stream role once (#12741) docs(fern): promote v1.3.1 to current release (#12752) fix(docs): remove duplicate unscoped community-rail CSS rules (#12615) feat(operator): migrate CRD storage to v1beta1 (#11904) fix: synchronize self-benchmark capacity across DP ranks (#12021) chore(deps): bump dynamo-tokenizers to 1.8.0 (#12707) fix(frontend): preserve split UTF-8 characters (#12688) docs: align Kubernetes build selector with CLI (#12729) fix(frontend): preserve completion backend error status (#12706) fix(operator): replace snapshot pods after GMS restart (#11286) refactor(media): rename installer module, drop --packages per review fix(media): harden installer against three pre-redesign review findings fix(media): verify installs in a fresh interpreter; teach --pip-args= form test(serve): install test-time decoders at the validated bounds feat(media): explicit installer for additional media decoders docs(spica): correct kv_load_ratio support guidance (#12714) feat(operator): add experimental grove.forceScalingGroup for single-node components (#11772) fix(vllm): declare entry-stage engine_input_source in GLM-Image NIXL config (#12709) chore: bump trtllm to v1.3.0rc23 (#12532) perf: remove trtllm postprocessing workers from the args as post processing workers are not effective in dynamo (#12592) ... Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The SGLang frontend previously restarted incremental decoding from a fixed token lookback. With byte-fallback tokenizers, that lookback could begin inside a multi-token UTF-8 character, causing replacement characters (
U+FFFD) to be emitted as output.This change:
U+FFFDU+FFFDdecode()API without requiringDecodeStreamValidation
pytest components/src/dynamo/frontend/tests/test_sglang_processor_unit.py— 197 passed🙂🙂U+FFFDgit diff --checkSummary by CodeRabbit
Bug Fixes
Tests