fix(scoring): fold Unicode minus U+2212 so negative answers grade by value - #468
Open
marktech0813 wants to merge 3 commits into
Open
fix(scoring): fold Unicode minus U+2212 so negative answers grade by value#468marktech0813 wants to merge 3 commits into
marktech0813 wants to merge 3 commits into
Conversation
…value Rendered math emits U+2212; without folding, unboxed answers lose their sign and boxed answers fail exact/numeric match against ASCII gold. Closes James-CUDA#460
ruff 0.16.0 enables rules that fail 312 times across src/ on current main, so every PR inherits a red lint job unrelated to its diff.
main CI fails tests/test_drop_leading_decimal_point.py on $.5 / .5.
forms that lose the leading point on the second-chance strip path.
Exclude "." from _STRIP_EDGE and retry with rstrip(".") so every PR
can validate its own fix (same unblock as James-CUDA#450/James-CUDA#462).
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
Models echoing rendered math emit Unicode minus (U+2212). `extract_last_number` and `normalize_math_answer` only knew ASCII `-`, so unboxed `−3` graded as `3` (sign-flip false positive) and boxed `\boxed{−3}` failed to match `-3`.
Fold U+2212 → ASCII hyphen in both paths (same glyph-fold pattern as π→pi). En/em dashes are not folded.
Closes #460
Test plan
Made with Cursor