Grade benchmarks with runner configs from the pristine exercise tree - #5688
Open
AUTHENSOR wants to merge 1 commit into
Open
Grade benchmarks with runner configs from the pristine exercise tree#5688AUTHENSOR wants to merge 1 commit into
AUTHENSOR wants to merge 1 commit into
Conversation
run_unit_tests restored only the test files before grading, while the test command runs in the model-writable working tree and the harness auto-approves file creation. A four-line model-created conftest.py that resets session.exitstatus therefore makes pytest exit 0 while every test fails, and the exercise is recorded as solved. The same primitive reaches the other languages through their runner config files (package.json, CMakeLists.txt, build.gradle, Cargo.toml). Restore the runner config files from the original exercise copy when it has them, remove any model-created ones when it does not, and as a safety net distrust a 0 exit code when the command's own summary reports failed tests.
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
run_unit_testsrestores only the test files before grading, while the test command runs in the model-writable working tree and the benchmark harness auto-approves file creation (InputOutput(pretty=False, yes=True)). A four-line model-createdconftest.pythat resetssession.exitstatustherefore makes pytest exit 0 while every test fails, and the exercise is recorded as solved:The chat history still contains the FAILED test lines while the exercise is scored solved, and a gamed run is indistinguishable from an honest one in the results yaml and on the leaderboard, which accepts community-submitted results. The same primitive reaches the other languages through their runner config files (
package.jsonfor JavaScript,CMakeLists.txtfor C++,build.gradlefor Java,Cargo.tomlfor Rust), none of which are restored.Fixes #5681.
Changes
Testing
New tests in
tests/test_benchmark_run_unit_tests.py:Verified behaviorally in both directions with the exact scenario above: on the pre-fix code the exercise with a failing suite is recorded as solved via the conftest; with the change the conftest is removed and the exercise scores failed.