Skip to content

fix(sweep): default env pass to process-per-sample (max-tasks-per-child=1) to end EGL contact-arena overflow#33

Merged
KE7 merged 2 commits into
mainfrom
ws/sweep-egl-process-per-sample
Jun 16, 2026
Merged

fix(sweep): default env pass to process-per-sample (max-tasks-per-child=1) to end EGL contact-arena overflow#33
KE7 merged 2 commits into
mainfrom
ws/sweep-egl-process-per-sample

Conversation

@KE7

@KE7 KE7 commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Problem

The validation sweep's ENV pass (G5/G6 create a LIBERO env + EGL render context + step MuJoCo) recurrently hit the mjWARN_CONTACTFULL / ncon=5000 contact-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-child conditional on pass type:

  • ENV pass (scenic_only=False) → default 1 = process-per-sample. With chunk_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-only pass (G0–G3, pure-Python, no env/EGL) → keeps the higher DEFAULT_MAX_TASKS_PER_CHILD = 64 for speed (no GL/sim state to accumulate).

Detection of omitted-vs-explicit: argparse default is now None; resolve_max_tasks_per_child(explicit, scenic_only=...) resolves it. An explicit --max-tasks-per-child always 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: new ENV_MAX_TASKS_PER_CHILD=1 + resolve_max_tasks_per_child(); argparse default=None + updated help text citing the root cause; main() resolves before run_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 reports max_tasks_per_child: 64, 6/6 rows G0–G3 pass.

Local CI (all green)

  • ruff check + ruff format --check + black --check on src/ tests/ ✅
  • Tier-1 6-file pytest + sweep tests: 189 passed
  • Validation smoke G0–G3: 6/6 pass ✅

🤖 Generated with Claude Code

KE7 and others added 2 commits June 16, 2026 12:36
…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>
@KE7
KE7 merged commit d07c099 into main Jun 16, 2026
3 checks passed
@KE7
KE7 deleted the ws/sweep-egl-process-per-sample branch June 16, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant