Repository navigation
Limit memory of LiveCodeBench test processes - #239
Conversation
Each forked test process now caps its address space at the size it inherits plus ROUTERARENA_LCB_MEMORY_HEADROOM_BYTES (default 2 GiB, 0 disables). Generated code that allocates without bound raises MemoryError and fails the test, instead of exhausting the evaluation runner and ending the job with exit code 143. Co-authored-by: Copilot <[email protected]>
|
Verification on GitHub's standard runner: I ran this repository's own
The verification PR is wmlba/routerarena-verification#1. Once this is merged, I'll update #237 from |
|
Thanks, @wmlba. Merged. We checked that the limit is set in the forked test process, not in the evaluator. With all three LiveCodeBench fixes applied, a runaway allocation now fails in under a second while normal solutions pass as before. It applies to every router in the next full re-grade. |
Every prediction file behind a leaderboard row was re-graded on GitHub's runners (workflow run 40971464215, main at 5a342c5) with the LiveCodeBench fixes (RouteWorks#230, RouteWorks#234, RouteWorks#239), the METEOR cap (RouteWorks#216) and the current price table. The re-graded files keep their original JSON formatting. README Arena, accuracy, cost and optimality columns are updated and the table re-ranked; robustness does not depend on grading and is unchanged. Divyam moves to RouteWorks#1 (77.22) and BizRouter to RouteWorks#2 (77.08). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fixes #238.
What
run_tests_for_one_examplenow caps the forked test process's address space before running generated code. The cap is the size inherited from the evaluator plusLCB_MEMORY_HEADROOM_BYTES:ROUTERARENA_LCB_MEMORY_HEADROOM_BYTES, where0disables it.It is applied with
resource.setrlimit(RLIMIT_AS, ...)beforereliability_guard()hides theresourcemodule. Generated code that allocates past the cap raisesMemoryError, which the existing per-testexcept Exceptionrecords as a failed test. On non-Linux systems, where/procis unavailable, the function does nothing.Why
Without a memory limit, one completion that allocates without bound grows until the wall-clock timeout. On the 16 GB
ubuntu-latestrunner, memory-pressure handling terminates the whole evaluation job first (exit code 143), so no results are posted. See the issue for details.Validation
mainKT-ModelRouterLiveCodeBench rows (385)For
cruq-routerandnadir-cascade-v2(385 LiveCodeBench rows each), 3 and 2 rows differed between runs with and without the fix:ruff check,ruff format --checkandmypy(Python 3.9 and 3.11, repository config) pass.