Skip to content

managed runner, deterministic benchmark, and causal evidence (PR3 draft of #377 split) - #822

Draft
BColsey wants to merge 4 commits into
JustVugg:devfrom
BColsey:successor/pr3-runner
Draft

managed runner, deterministic benchmark, and causal evidence (PR3 draft of #377 split)#822
BColsey wants to merge 4 commits into
JustVugg:devfrom
BColsey:successor/pr3-runner

Conversation

@BColsey

@BColsey BColsey commented Aug 4, 2026

Copy link
Copy Markdown

Draft successor — supersedes #377. Reconstructed from the frozen green donor 5f6f31a. Do not merge #377.

Scope

  • c/ramdisk_support/benchmark.py, c/ramdisk_support/runtime_monitor.py
  • Tests: test_ramdisk_benchmark.py, test_ramdisk_runtime_monitor.py, test_ramdisk_benchmark_module.py
  • (Reconstruction adds: supervision hunks of lifecycle.py/processes.py; live tmpfs cells of test_rammap_e2e.py — split from PR1/PR2)

Reconstruction work

  • Kernel-level safe process supervision (cgroup-v2 / pidfd per-descendant) — closes the setsid/env-shedding descendant escape the donor leaves at the cooperative UID+nonce attribution boundary.
  • Causal four-cell PIN/RAMMAP matrix (design L99-123): ≥7 randomized fresh processes/cell, DRAM + file/anonymous/shmem accounting, NUMA placement, paired confidence intervals. The donor's benchmark does not implement this — PR3 supplies a new experiment runner + evidence schema and must not claim evidence it does not produce.
  • runtime_monitor identity binding/revalidation. Managed start/stop JSON (deferred from PR2).

Dependency

Depends on PR2 (#821): benchmark.py imports .common/.accelerator; runtime_monitor imports ramdisk_support.processes (PR2). Started as DRAFT because the causal matrix and kernel-containment supervision are new reconstruction work.

Build verification (subagent worktree)

  • PR3 own modules import cleanly (from ramdisk_support import benchmark, runtime_monitor OK — PR2 .common/.accelerator/.processes deps present on this stacked branch). PR3 own tests GREEN: test_ramdisk_benchmark + test_ramdisk_runtime_monitor + test_ramdisk_benchmark_module = 47 passed / 0 failed. Full discovery hard-aborts only on PR2’s carried bundle self-check; no defect in benchmark/runtime_monitor.

Reconstruction update

PR3 scaffold landed (commit 1be8751): NEW ramdisk_support/supervision.py (cgroup-v2 membership absence check), causal four-cell matrix structure in benchmark.py (neutral, claims nothing yet), runtime_monitor identity binding helpers. Green: 70 passed / 0 failed. Still TODO (large/new): wire supervision into recovery, real causal-matrix runner + thresholds, managed start/stop JSON.

BColsey and others added 3 commits August 3, 2026 22:07
Co-Authored-By: Claude <noreply@anthropic.com>
…d CLI from donor 5f6f31a

Co-Authored-By: Claude <noreply@anthropic.com>
…sal evidence from donor 5f6f31a

Co-Authored-By: Claude <noreply@anthropic.com>
…cture, monitor identity

Lay the sound skeleton for PR3's three own modules without overreaching into
claim-producing logic:

* ramdisk_support/supervision.py (NEW): a self-contained (stdlib + os)
  cgroup-v2 membership-based absence check that closes the setsid/
  env-shedding descendant escape the donor leaves at the UID+nonce
  boundary. ``cgroup_descendants_absent`` declares absence only when
  ``/sys/fs/cgroup/<path>/cgroup.procs`` is empty, raises a clear
  RamdiskError off-Linux, and is the function the recovery layer calls
  IN ADDITION to the nonce scan. read_procs/platform_supported seams make
  the guard and enumeration independently testable.

* benchmark.py: STRUCTURE only for the causal four-cell PIN/RAMMAP matrix.
  ``causal_four_cell_spec`` enumerates the four fixed cells
  (anon-PIN interleaved/local, tmpfs-RAMMAP interleaved/local) with a
  per-cell neutral counter skeleton (>=7 fresh replicates, DRAM traffic,
  file/anonymous/shmem accounting, NUMA placement, throughput/latency,
  output hashes). ``run_causal_four_cell_matrix`` returns a neutral result
  (claim=None, thresholds_defined=False); it makes NO paired-CI claim and
  is wired only through a cell_runner seam.

* runtime_monitor.py: identity binding/revalidation scaffolding behind
  small helpers. _BoundResponse/_bind_response/_deployment_nonce/
  _revalidate_binding bind a cached health/profile response to the
  (deployment_id, created_at, nonce) triple and revalidate it against the
  live identity before reuse.

This is a scaffold/start, not complete: supervision is not yet wired into
the recovery layer's stop/escalation path, the four-cell matrix has no real
process launch or thresholds (so it intentionally claims nothing), and the
monitor helpers are not yet invoked inside sample(). PR3's own tests
(test_ramdisk_benchmark, test_ramdisk_runtime_monitor,
test_ramdisk_benchmark_module, test_ramdisk_supervision) pass: 70 tests.

Co-Authored-By: Claude <noreply@anthropic.com>
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