Skip to content

fix(eval): remove stale ./executable before compile.sh#52

Merged
klieret merged 3 commits into
mainfrom
fix/clear-stale-executable
Jul 14, 2026
Merged

fix(eval): remove stale ./executable before compile.sh#52
klieret merged 3 commits into
mainfrom
fix/clear-stale-executable

Conversation

@klieret

@klieret klieret commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

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 ./executable shipped inside the submission archive lands in /workspace after the wipe and survives into the compile step. The post-compile mv ./executable ... then stashes it as if compile.sh had produced it.

Failure mode: a submission that ships a prebuilt/stale executable plus a stub/no-op compile.sh (that doesn't overwrite it) would be scored against the smuggled binary. _remove_hashed_files only 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 -fdx removes the gitignored executable before every build.

Fix

Add an explicit rm -f ./executable step after extraction (and _remove_hashed_files) and before compile.sh, so the build is always forced to regenerate the binary — mirroring RevEngBench's clean-then-compile behavior.

Tests

TestCompileClearsStaleExecutable uses a recording fake container env to assert the command ordering:

  • the clear runs after extraction and before compile.sh
  • the workspace wipe still precedes extraction

🤖 Generated with Claude Code

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.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 14, 2026
klieret added 2 commits July 14, 2026 11:43
It asserted the literal command sequence against a fake env, so it
mirrored the implementation rather than exercising real behavior.
@klieret klieret merged commit 6604d86 into main Jul 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant