fix(eval): remove stale ./executable before compile.sh#52
Merged
Conversation
The workspace wipe in _compile_executable runs before the submission tar is extracted, so an ./executable smuggled into the submission archive survived into the compile step and got stashed as if the build had produced it. A stub/no-op compile.sh could then pass with a prebuilt binary. _remove_hashed_files only catches byte-for-byte copies of the gold binary, not arbitrary prebuilts. Add an explicit 'rm -f ./executable' step after extraction and before compile.sh so the build is always forced to regenerate the binary, matching RevEngBench's git-clean-then-compile behavior.
It asserted the literal command sequence against a fake env, so it mirrored the implementation rather than exercising real behavior.
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.
Problem
In
Evaluator._compile_executable, the workspace wipe (rm -rf /workspace/*) runs before the submission tar is extracted (copy_in_tar). As a result, an./executableshipped inside the submission archive lands in/workspaceafter the wipe and survives into the compile step. The post-compilemv ./executable ...then stashes it as ifcompile.shhad produced it.Failure mode: a submission that ships a prebuilt/stale
executableplus a stub/no-opcompile.sh(that doesn't overwrite it) would be scored against the smuggled binary._remove_hashed_filesonly catches byte-for-byte copies of the gold binary, not arbitrary prebuilts, so it doesn't close this gap.This was noticed while comparing against RevEngBench, whose git-checkout-based pipeline avoids the issue:
git clean -fdxremoves the gitignoredexecutablebefore every build.Fix
Add an explicit
rm -f ./executablestep after extraction (and_remove_hashed_files) and beforecompile.sh, so the build is always forced to regenerate the binary — mirroring RevEngBench's clean-then-compile behavior.Tests
TestCompileClearsStaleExecutableuses a recording fake container env to assert the command ordering:compile.sh🤖 Generated with Claude Code