Without --as-pid-1, Bubblewrap's init was PID 1 inside the sandbox and held
the host result pipe, so a generated app could write a forged result to
/proc/1/fd/1 and kill the runner. The runner is now PID 1 and non-dumpable,
and the host sends it a fresh HMAC key over a pipe the app never sees; the
host accepts only one sealed, schema-valid line from a runner that exited
cleanly. The key pipe is also the runner's lifeline at the deadline, the
runner reaps orphans, and -P keeps the writable working directory off
sys.path.
/tmp and /dev/shm were host-default writable tmpfs. /proc, /dev and /tmp
are now read-only and the size-capped /work is the only writable mount;
the per-user-namespace process limit caps all tasks together.
The real-sandbox tests ran in release and default selections. Modules that
set OPT_IN_ENV are now deselected unless the variable is 1, and the
identity-security sandbox tests require OBLITERATUS_IDENTITY_SECURITY_E2E=1.
The app log tail is read from the held descriptor, and duplicate or
missing samples make a generations file incomplete.
Review finding: a thread target that forks while its starter holds the
serialisation lock leaves the child with a lock owned by a thread that does
not exist there, so any Thread.start() in the child hangs. Re-create the
lock after fork in the child.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review findings: a start() from a signal handler or finalizer during an
outer start() deadlocked on the non-reentrant lock, and a child blocked on a
lock its starter holds made start() raise after launching a live thread.
Use an RLock, and on timeout return with plain start() semantics; raise only
when the thread exited without running its target.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review finding: each start() waited on its own event, so two parents
starting threads concurrently could still overlap their trace installation,
and a thread that died before run() made start() wait 30 s and return
silently. Hold one process-wide lock across start and the wait, raise when
the thread exits or times out before reaching its target, and bind
time.monotonic and threading.Event at import so tests that patch them
cannot distort the wait.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Release-lane Tests py3.10/3.11 failed in two-rank thread worlds with
"Cannot install a trace function while another trace function is being
installed". CPython before 3.12 guards sys.settrace with a process-wide
reentrancy flag and runs audit hooks while it is set; filelock installs a
Python audit hook, so the GIL can switch inside that window and a second
thread starting under coverage's threading.settrace hook fails in
threading._bootstrap_inner. Python 3.12 coverage uses sys.monitoring and is
unaffected.
On Python < 3.12, make Thread.start return only once the new thread reaches
run(), i.e. after its trace function is installed. Locally on 3.11 with
coverage the distributed CPU tests went from 3 failures in 4 runs to 3/3
green.
Also let the always-run trend step tolerate missing Gloo shard files after
an earlier failure.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tiny-model pipeline tests were dominated by fixed per-step costs, not
arithmetic: the pipeline's gc.collect() after each verify prompt rescans
every long-lived object the session imported (~0.2 s per call), and
intra-op thread fan-out makes each 16-dim forward slower on loaded runners.
- conftest: add an opt-in tiny_model_runtime fixture (one intra-op thread,
gc.freeze() of pre-test objects, both restored afterwards). Objects the
test creates remain collectable, so pipeline behaviour is unchanged.
Applied to test_offline_integration and the concept_* integration modules.
- test_disk_offloaded_fused_moe_surgery_matches_live_surgery: bound verify
free-form completions to 4 tokens; every diagnostic still runs through
the disk-offload hooks and no assertion depends on generated text.
- test_disk_offloaded_subprocess_rss_bound: measure native and legacy export
in one subprocess on the same offloaded model, resetting VmHWM (after GC
and malloc_trim) before each mode; native is measured first. Same three
assertions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>