Skip to content

feat(code_gen): accept any capitalisation of Yes/No in stdout comparison - #3051

Merged
fgalko-oss merged 1 commit into
mainfrom
fgalko/lcb-case-insensitive-yes-no
Sep 3, 2026
Merged

fgalko-oss merged 1 commit into
mainfrom
fgalko/lcb-case-insensitive-yes-no

Conversation

@fgalko-oss

Copy link
Copy Markdown
Contributor

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

  • I have read the contributing guidelines.
  • The change is focused; unrelated "drive-by" edits are tracked as separate issues/PRs.
  • Tests added or updated and pass locally, or N/A for docs-only / non-code changes (so CI unit/server checks pass when applicable).
  • Pre-commit checks pass locally (pre-commit run --all-files) (so CI lint/format/copyright pass).
  • All commits have DCO sign-off (git commit -s) (so the DCO check passes).

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]>

@agronskiy agronskiy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YES FTW (YeS fTw)!

@fgalko-oss
fgalko-oss merged commit 0001070 into main Sep 3, 2026
33 checks passed
@fgalko-oss
fgalko-oss deleted the fgalko/lcb-case-insensitive-yes-no branch September 3, 2026 07:38
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]>
@athitten athitten mentioned this pull request Oct 28, 2026
7 tasks done

This branch was previously deployed

1 inactive deployment
public — 73148bcd Deployed Sep 3, 2026 by copy-pr-bot[bot] via release / finalize / notify #2494
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants