Skip to content

fix(livecodebench): support sys.stdin.buffer - #570

Merged
Keithwwa merged 1 commit into
AISBench:masterfrom
zhongzhouTan-coder:fix/live-code-bench
Sep 22, 2026
Merged

Keithwwa merged 1 commit into
AISBench:masterfrom
zhongzhouTan-coder:fix/live-code-bench

Conversation

@zhongzhouTan-coder

@zhongzhouTan-coder zhongzhouTan-coder commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • back mocked sys.stdin with TextIOWrapper(BytesIO(...)) so generated solutions can use sys.stdin.buffer
  • remove independent read, readline, and readlines mocks so text and binary reads share one stream position
  • add regression tests for binary stdin and mixed binary/text consumption

Fixes #517

Test results

  • python -m pytest tests/UT/datasets/livecodebench/test_testing_util.py -q — 21 passed
  • python -m pytest tests/UT/datasets/livecodebench -q — 127 passed
  • git diff --check — clean

简单测试 sys.stdin.buffer.read()/readline/readlines 这类方法能够正确评估
image

b363921f0311dda3c65b8db528130408

使用 qwen3.8-27B-w8a8 模型,全量数据集需要4小时间,这儿测试了 1031 条,包含上述方法,正确率 85.12,总共 1055 条,正确约 898 = 1055 * 0.8512,错误 132 条,评估阶段无 buffer no attribute 相关报错。

Evalscope related issue and fix

link: modelscope/evalscope#1438

Copilot AI lite review requested due to automatic review settings September 21, 2026 06:41
@github-actions github-actions Bot added the no_review PR 未包含任何检视意见,合入前必须包含检视意见 label Sep 21, 2026
@github-actions

Copy link
Copy Markdown

🚫 PR 合入质量检查未通过,PR 已被禁止合入。

未通过项:no_review

  • 无检视意见:请至少邀请一位 reviewer 提交检视意见(Approve / Request changes / Comment 均可)。

请按上述提示整改后,重新推送(push)或评论本 PR 即可触发再次检查。

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

TextIOWrapper read-ahead can cause subsequent binary reads to lose buffered input.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

This PR updates LiveCodeBench stdin mocking to support sys.stdin.buffer and shared text/binary input.

Changes:

  • Replaces independent stdin mocks with a shared TextIOWrapper over BytesIO.
  • Adds binary and mixed-read regression tests.
  • A buffering issue remains when text reads precede binary reads.
File Summary
tests/​UT/​datasets/​livecodebench/​test_testing_util.py Adds binary stdin and mixed-read regression tests.
ais_bench/​benchmark/​datasets/​livecodebench/​testing_util.py Updates stdin mocking with shared text/binary backing.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@jschen069 jschen069 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@github-actions github-actions Bot removed the no_review PR 未包含任何检视意见,合入前必须包含检视意见 label Sep 22, 2026
@github-actions

Copy link
Copy Markdown

✅ PR 合入质量五项检查全部通过,允许合入。

@Keithwwa
Keithwwa merged commit 7b0926c into AISBench:master Sep 22, 2026
14 of 15 checks passed

This branch was previously deployed

1 inactive deployment
smoke-test-approval — da711e61 Deployed Sep 21, 2026 by zhongzhouTan-coder via run_smoke_test_cases #739
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.

[Bug] livecodebench数据集,如果模型输出sys.stdin.buffer程序直接判错

4 participants