Commit Graph
11 Commits
Author SHA1 Message Date
Joseph Magly 4b65e85269 fix(identity-security): authenticate sandbox results, bound writable storage, require opt-in
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.
2026-11-27 14:06:55 -05:00
Joseph Magly bd89e8020a perf(tests): freeze collected baseline once 2026-10-29 01:02:56 -04:00
Joseph MaglyandClaude Opus 5.5 4abe50e559 test: reset the thread-start lock in forked children
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>
2026-10-14 19:18:34 -04:00
Joseph MaglyandClaude Opus 5.5 9ca4ed0fd3 test: make the thread-start serialisation re-entrant and non-blocking on timeout
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>
2026-10-14 19:14:50 -04:00
Joseph MaglyandClaude Opus 5.5 ff2db6ab4e test: serialise thread starts across callers and fail loudly when a thread never runs
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>
2026-10-14 19:10:56 -04:00
Joseph MaglyandClaude Opus 5.5 4316dac5f3 test: serialise thread trace installation on Python < 3.12
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>
2026-10-14 18:19:21 -04:00
Joseph MaglyandClaude Opus 5.5 c7f45460eb test: cut slow CPU integration tests below the per-test budget (#304)
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>
2026-10-14 16:53:10 -04:00
Joseph Magly 753c53d07f Enforce Gate 3 test quality budgets 2026-08-15 04:33:15 -04:00
Joseph Magly 951700a285 test: add quality-depth gates and mature CPU coverage 2026-08-14 14:08:23 -04:00
Joseph Magly 66c47249df ci: add strict test evidence gates 2026-08-14 11:44:12 -04:00
pliny 0f6114fe87 Add files via upload 2026-03-04 12:38:18 -08:00