You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Code-generation judge rejects valid solutions using sys.stdin.buffer.readline() or sys.stdout.buffer #160
withCapturing():
sys.stdout.buffer.write(b"hello\n")
# AttributeError: '_io.StringIO' object has no attribute 'buffer'
Impact observed with real benchmark results
I checked the current official main branch (commit 28fef95ea8c9f7a547c8329f2cd3d32b92c1fa24). Using its unmodified run_test, I rejudged the same extracted solutions and test cases from a full 175-problem LiveCodeBench v6 run.
Four solutions that passed with a binary-I/O-capable judge failed with the official judge:
Problem
Result with official judge
Cause
abc391_f
Wrong answer
Repeated stdin.buffer.readline() calls receive the first line repeatedly.
abc393_e
Runtime error
stdout.buffer is unavailable.
abc398_f
Runtime error
stdout.buffer is unavailable.
arc191_a
Runtime error
stdout.buffer is unavailable.
As a control, changing only the stdin mock to a cursor-backed byte stream made abc391_f pass. Changing only stdout capture to support .buffer made the other three solutions pass. The generated solutions and test cases were otherwise unchanged.
For example, abc391_f received this input:
2 5
1 2
3 4
5 6
The expected output is 31, but the official judge obtained 24 because the solution repeatedly read the first line.
Expected behavior
Consecutive sys.stdin.buffer.readline() calls should consume consecutive lines, and bytes written to sys.stdout.buffer should be captured and compared as program output. Text and binary input methods should share a consistent input position.
Activity
docs(eval): pin the LiveCodeBench judge to fix binary-stdio grading (#…