Repository navigation
fix(livecodebench): support sys.stdin.buffer - #570
Merged
Merged
Conversation
zhongzhouTan-coder
temporarily deployed
to
smoke-test-approval
September 21, 2026 06:41 — with
GitHub Actions
Inactive
|
🚫 PR 合入质量检查未通过,PR 已被禁止合入。 未通过项:
请按上述提示整改后,重新推送(push)或评论本 PR 即可触发再次检查。 |
Contributor
There was a problem hiding this comment.
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
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
TextIOWrapperoverBytesIO. - 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.
|
✅ PR 合入质量五项检查全部通过,允许合入。 |
This was referenced Sep 29, 2026
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.

Summary
sys.stdinwithTextIOWrapper(BytesIO(...))so generated solutions can usesys.stdin.bufferread,readline, andreadlinesmocks so text and binary reads share one stream positionFixes #517
Test results
python -m pytest tests/UT/datasets/livecodebench/test_testing_util.py -q— 21 passedpython -m pytest tests/UT/datasets/livecodebench -q— 127 passedgit diff --check— clean简单测试

sys.stdin.buffer.read()/readline/readlines这类方法能够正确评估使用 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