{{ message }}
Repository navigation
Conversation
This comment has been minimized.
This comment has been minimized.
Under python -O, asserts are stripped, so the two malformed-rule guards in validate_buckets_rule silently passed and the invalid bucket config was accepted: $ python -O repro.py # unpatched tse non-float middle: ACCEPTED (no exception) custom non-numeric: ACCEPTED (no exception) Both branches now raise ValueError, matching the surrounding validation style in the same function and surviving -O: $ python -O repro.py # patched tse non-float middle: rejected with ValueError custom non-numeric: rejected with ValueError Adds a registered CPU unit test pinning that malformed tse/custom rules raise ValueError (not AssertionError, so the guard cannot be stripped by -O) and that valid rules still pass. Signed-off-by: jeongho shin <jh_leo.shin@samsung.com>
mlleo
force-pushed
the
fix/buckets-rule-assert-false
branch
from
October 26, 2026 09:19
c685591 to
4c97bcb
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
Author
This branch has not been deployed
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.

Motivation
Two of the numeric checks in
validate_buckets_ruleraise viaassert Falsein the parse-failure branch. Underpython -Oasserts get stripped, so a malformed rule like['tse', 'x', '2', '8']passes validation silently instead of dying at startup with a useful error.Repro (extract
validate_buckets_ruleand call it with the bad rule):Same run against the patched code:
Modifications
python/sglang/srt/arg_groups/validation_hook.py: replace the twoassert Falsein the parse-failure branches withraise ValueError(...). Messages unchanged. This also matches the rest of the function, which raisesValueErrorfor bad input everywhere else (grpc port, gc_threshold, kv canary, ...).Verification
Verified locally with the repro above: under
python -Oboth malformed shapes now raiseValueError, and valid rules (tse/default/custom) still pass. No new test file — the diff only changes how the two parse-failure branches report the error.No GPU needed; this is server-args validation only.
Checklist
CI States
Latest PR Test (Base): ❌ Run #40298619201
Latest PR Test (Extra): ❌ Run #40298619121
Latest PR Test (AMD ROCm 10): ❌ Run #40298619180