Repository navigation
Conversation
anidotdev
force-pushed
the
fix-qwen3-coder-integer-precision
branch
from
October 16, 2026 13:58
467af57 to
df81d21
Compare
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.
Description
The integer-schema branch in
mlx_lm/tool_parsers/qwen3_coder.pyparsesparam_valueto afloatand then to anint, which causes loss of precision for integers that can't be represented as a binary64 float.For example, the integer literal
9007199254740993would get parsed as9007199254740992. The parser returns anintbut the value is incorrect, the data is corrupted silently.This could cause problems with tool parameters that are used to identify records or resources if the model emits a plain integer literal that is too big to be represented as a binary64 float.
This is a different issue from #1627 which dealt with accepting float-formatted integral values like
"140.0"; this is about losing precision when parsing a plain integer literal.Minimal Reproduction
Actual result before the fix:
Expected result:
Environment
ba8a08fd2ed72bbc53de84f89933f91fe4743e4aTests
Before the local change:
9007199254740992instead of9007199254740993.After the local change:
tests/test_tool_parsing.pypassed all 20 tests.