Repository navigation
feat(code_gen): accept any capitalisation of Yes/No in stdout comparison - #3051
Merged
Merged
Conversation
Codeforces-style statements print a Yes/No verdict and accept any capitalisation, so a solution answering YES against a reference of Yes is correct on the platform but was scored Wrong Answer here. Scoped deliberately to those two words: the comparison stays case-sensitive for every other answer, so problems whose answer happens to be a name or a word (Snuke, Alice, First) are unaffected. A line with more than one token is not treated as a verdict either. Split out from #2956 rather than folded in, because unlike the four defects there this changes accept/reject semantics rather than fixing a grader fault, and so wanted a protocol decision first. No effect on LiveCodeBench v6: across a 1362-rollout DeepSeek-V4-Flash run, none of the 66 wrong-answer failures differ from their reference by capitalisation alone, so the measured score is unchanged. The behaviour matters for Codeforces-sourced problems. Signed-off-by: fgalko <[email protected]>
jkyi-nvidia
pushed a commit
that referenced
this pull request
Sep 11, 2026
…son (#3051) ## What does this PR do? Accepts any capitalisation of a `Yes`/`No` verdict in the LiveCodeBench stdout comparison, and only for those two words. Codeforces-style statements print a Yes/No verdict and explicitly accept any capitalisation, so a solution answering `YES` against a reference of `Yes` is correct on the platform but was scored Wrong Answer here. ## Scope Deliberately narrow. Tolerance for capitalisation applies only when the predicted line is exactly `yes` or `no` (in any case) and both sides agree case-insensitively. Every other answer stays case-sensitive, so problems whose answer is a name or a word are unaffected, and a line with more than one token is not treated as a verdict at all. Verified end-to-end through the grader: | submitted | expected | verdict | |---|---|---| | `YES` | `Yes` | accepted | | `no` | `No` | accepted | | `NO` | `Yes` | rejected | | `SNUKE` | `Snuke` | rejected (stays case-sensitive) | | `FIRST` | `First` | rejected (stays case-sensitive) | | `alice` | `Alice` | rejected (stays case-sensitive) | | `YES 1` | `Yes 1` | rejected (multi-token, not a verdict) | ## Why this is separate from #2956 The four changes in #2956 fixed grader faults: correct solutions being scored wrong because of a defect (exact float equality, `StringIO` having no `.buffer`, the int→str digit cap, missing list tolerance). This one is different in kind — it changes accept/reject semantics to match a platform convention, so it deserves its own review rather than riding along. ## Effect on LiveCodeBench scores **None measured on v6.** Across a 1362-rollout DeepSeek-V4-Flash LCB v6 run, none of the 66 wrong-answer failures differ from their reference by capitalisation alone, so the score is unchanged (the run's projected accuracy stays at 94.93%). The behaviour matters for Codeforces-sourced problems rather than the AtCoder/LeetCode mix in v6. ## Test plan - New `resources_servers/code_gen/tests/test_case_insensitive_verdict.py` (14 tests): all capitalisation variants of Yes and No, `yes` not matching `no`, verdicts not matching unrelated answers, other words staying case-sensitive, and multi-token lines rejected. - Full code_gen suite green: 52 passed. - End-to-end through `run_test` on the 7 cases in the table above, all behaving as intended in both directions. - Ruff lint, import order and format clean on both changed files (pinned v0.9.9, matching `.pre-commit-config.yaml`). ## Checklist - [x] I have read the [contributing guidelines](https://docs.nvidia.com/nemo/gym/latest/contribute/development-setup). - [x] The change is focused; unrelated "drive-by" edits are tracked as separate issues/PRs. - [x] Tests added or updated and pass locally, or N/A for docs-only / non-code changes (so CI unit/server checks pass when applicable). - [x] Pre-commit checks pass locally (`pre-commit run --all-files`) (so CI lint/format/copyright pass). - [x] All commits have DCO sign-off (`git commit -s`) (so the DCO check passes). Signed-off-by: fgalko <[email protected]> Signed-off-by: Junkeun Yi <[email protected]>
7 tasks done
This branch was previously 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.
What does this PR do?
Accepts any capitalisation of a
Yes/Noverdict in the LiveCodeBench stdout comparison, and only for those two words.Codeforces-style statements print a Yes/No verdict and explicitly accept any capitalisation, so a solution answering
YESagainst a reference ofYesis correct on the platform but was scored Wrong Answer here.Scope
Deliberately narrow. Tolerance for capitalisation applies only when the predicted line is exactly
yesorno(in any case) and both sides agree case-insensitively. Every other answer stays case-sensitive, so problems whose answer is a name or a word are unaffected, and a line with more than one token is not treated as a verdict at all.Verified end-to-end through the grader:
YESYesnoNoNOYesSNUKESnukeFIRSTFirstaliceAliceYES 1Yes 1Why this is separate from #2956
The four changes in #2956 fixed grader faults: correct solutions being scored wrong because of a defect (exact float equality,
StringIOhaving no.buffer, the int→str digit cap, missing list tolerance). This one is different in kind — it changes accept/reject semantics to match a platform convention, so it deserves its own review rather than riding along.Effect on LiveCodeBench scores
None measured on v6. Across a 1362-rollout DeepSeek-V4-Flash LCB v6 run, none of the 66 wrong-answer failures differ from their reference by capitalisation alone, so the score is unchanged (the run's projected accuracy stays at 94.93%). The behaviour matters for Codeforces-sourced problems rather than the AtCoder/LeetCode mix in v6.
Test plan
resources_servers/code_gen/tests/test_case_insensitive_verdict.py(14 tests): all capitalisation variants of Yes and No,yesnot matchingno, verdicts not matching unrelated answers, other words staying case-sensitive, and multi-token lines rejected.run_teston the 7 cases in the table above, all behaving as intended in both directions..pre-commit-config.yaml).Checklist
pre-commit run --all-files) (so CI lint/format/copyright pass).git commit -s) (so the DCO check passes).