fix(sweep): default env pass to process-per-sample (max-tasks-per-child=1) to end EGL contact-arena overflow#33
Merged
Conversation
…ld=1) to end EGL contact-arena overflow The ENV pass (scenic_only=False) now defaults --max-tasks-per-child to 1 (process-per-sample): chunk_size=workers*1 tears down and respawns each worker after ONE condition, giving a fresh EGL/MuJoCo process per simulation sample. This permanently retires the recurring mjWARN_CONTACTFULL / ncon=5000 contact-arena overflow whose root cause is EGL render-context + contact-arena state ACCUMULATING across samples within a long-lived worker (validation_run2/rca + PR #18 d.4). The --scenic-only pass (G0-G3, pure-Python, no env/EGL) keeps the higher DEFAULT_MAX_TASKS_PER_CHILD for speed. Explicit --max-tasks-per-child still overrides both (argparse default None -> resolve_max_tasks_per_child). Batch-of-pools chunking/teardown logic is unchanged; only the default N. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Tier-1 (no-sim) tests for resolve_max_tasks_per_child + main() wiring: env pass default=1 (process-per-sample), scenic-only default=64 (speed), explicit value overrides both passes, and argparse omitted-vs-explicit detection routes through the conditional resolver. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
The validation sweep's ENV pass (G5/G6 create a LIBERO env + EGL render context + step MuJoCo) recurrently hit the
mjWARN_CONTACTFULL/ncon=5000contact-buffer overflow. Root cause (validation_run2/rca + PR #18 d.4): EGL render-context state and the MuJoCo contact arena (ncon) ACCUMULATE across simulation samples within a single long-lived worker process and eventually overflow.Fix (scoped, minimal — only the DEFAULT changes)
Make the effective default of
--max-tasks-per-childconditional on pass type:scenic_only=False) → default 1 = process-per-sample. Withchunk_size = workers * 1, every worker is torn down + respawned after exactly ONE condition, so each simulation sample gets a fresh EGL/MuJoCo process and state cannot accumulate.--scenic-onlypass (G0–G3, pure-Python, no env/EGL) → keeps the higherDEFAULT_MAX_TASKS_PER_CHILD = 64for speed (no GL/sim state to accumulate).Detection of omitted-vs-explicit: argparse
defaultis nowNone;resolve_max_tasks_per_child(explicit, scenic_only=...)resolves it. An explicit--max-tasks-per-childalways overrides both passes.The batch-of-pools chunking/teardown logic is unchanged — only the default N differs. No behavior change beyond the default; no masking.
Files
src/libero_infinity/validation/sweep.py: newENV_MAX_TASKS_PER_CHILD=1+resolve_max_tasks_per_child(); argparsedefault=None+ updated help text citing the root cause;main()resolves beforerun_sweep.tests/test_sweep_pool_recycle.py: Tier-1 (no-sim) tests — env default=1, scenic-only default=64, explicit override on both passes, and end-to-end argparse omitted-vs-explicit wiring.CI safety
The
Validation Smoke (G0–G3)job runs--scenic-only, so it resolves to 64 (unchanged) — process-per-sample does NOT affect the CI time budget. Verified locally: smoke summary reportsmax_tasks_per_child: 64, 6/6 rows G0–G3 pass.Local CI (all green)
ruff check+ruff format --check+black --checkon src/ tests/ ✅🤖 Generated with Claude Code