interplane.Get Omega
Read in your language

spark-rsi-mv

Native Rust recursive self-improvement engine with paired bootstrap evaluation and cryptographic ledger

Brought by drakestapleton

GitHub aien-dev/spark-rsi-mv#88 (code only)

closed derived 6bada1574029f827 #88

Imported from GitHub aien-dev/spark-rsi-mv#88 (code only)

GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed).

Base b248aca977fca88cce4e22f648c2e1c1b6941945 · Head 8aa2ede4fbf9b28db79653fb7d0dbec74433e9cf

Apply it

git checkout -b patch-6bada1574029f827 b248aca977fca88cce4e22f648c2e1c1b6941945
curl -fsSL https://interplane.io/drakestapleton/spark-rsi-mv/patches/6bada1574029f827.patch | git am

Raw patch (mbox) · Diff

Provenance

This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record:

github-import 1
aien-dev/spark-rsi-mv
88
8aa2ede4fbf9b28db79653fb7d0dbec74433e9cf
{"kind":"github-import","owner":"aien-dev","repo":"spark-rsi-mv","number":88,"url":"https://github.com/aien-dev/spark-rsi-mv/pull/88","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:40:25Z","metadata":"unavailable","state_derived":true}

Changes

diff --git a/README.md b/README.md
index 98456b7..efb3441 100644
--- a/README.md
+++ b/README.md
@@ -44,6 +44,10 @@ This builds three programs: `spark-rsi` (the main command line), `spark-rsi-supe
 
 The build jail runs `bwrap` (bubblewrap), which must be installed on the machine that runs the tests. Every jail that runs cargo finds the Rust toolchain the way cargo and rustup do: `CARGO_HOME` and `RUSTUP_HOME` when set (else `$HOME/.cargo` and `$HOME/.rustup`), plus the `PATH` directory holding `cargo`. It binds those directories read-only inside the jail and sets the same variables there, so a host whose toolchain lives outside the home directory (the Spark judge keeps it in `/var/lib/aien-run/cargo` and `/var/lib/aien-run/rustup`) still builds candidates. A directory that is or holds the judge's home is never exposed (`src/isolation/cargo_sandbox.rs`). The balance kernel is native Rust (`src/balance.rs`); it needs no extra toolchain.
 
+Every sandbox that compiles or runs candidate code starts inside a transient systemd user scope (`systemd-run --user --scope`), so the tests also need a reachable systemd user manager for the user running them (a user bus under `$XDG_RUNTIME_DIR`). Where there is none, for example in a container whose pid 1 is not systemd, the tests of those paths print `NOT_RUN <test>: no reachable systemd user manager ...` on stderr and assert nothing (`src/not_run.rs`). libtest still counts such a test as `ok`; the `NOT_RUN` line means it proved nothing. Set `RSI_REQUIRE_USER_SCOPE=1` to make a missing user manager a test failure instead. The Spark `RSI-TEST` gate sets it.
+
+The two CUDA kernel-autotune tests (`propose::kernel_autotune::tests`) compile and run kernels on the GPU. They are opt-in: they run only with `SPARK_RSI_GPU_TESTS=1`, set inside an authorized GPU window, and otherwise print `NOT_RUN` whatever hardware is present. Once opted in, a missing `nvcc` or an NVIDIA device the test cannot open is a failure.
+
 ### Protocol digest cutover (aien-protocols#59)
 
 Since 2026-10-26 this repository requires the strict framed digest contract of [aien-protocols-mv#59](https://github.com/aien-dev/aien-protocols-mv/pull/59): `EvaluationPlan` digests use the `AIEN_EVALUATION_PLAN_V2` transcript and signed `EvaluationReceipt`s are `protocol_version` 3 with the `AIEN_EVALUATION_RECEIPT_V3` transcript. The protocol signs and verifies no other receipt version and has no fallback to the old unframed digests, so a receipt or plan digest produced before the cutover does not verify and must be produced again by a new evaluation.
diff --git a/src/isolation/cargo_sandbox.rs b/src/isolation/cargo_sandbox.rs
index 1a099e6..a8646b4 100644
--- a/src/isolation/cargo_sandbox.rs
+++ b/src/isolation/cargo_sandbox.rs
@@ -101,12 +101,8 @@ impl Toolchain {
     }
 }
 
-/// The common fail-closed host launcher for untrusted code. The user scope charges
-/// the whole process tree, including tmpfs/memfd, rather than sampled process RSS.
-pub(crate) fn bounded_bwrap(
-    limits: &super::container::SandboxLimits,
-    timeout: Option<u64>,
-) -> Command {
+/// `systemd-run --user --scope` with the launcher environment every bounded launch uses.
+fn user_scope() -> Command {
     let mut cmd = Command::new("/usr/bin/systemd-run");
     cmd.env_clear();
     // This is launcher-only: bubblewrap clears it before starting candidate code.
@@ -116,6 +112,29 @@ pub(crate) fn bounded_bwrap(
             .unwrap_or_else(|| format!("/run/user/{}", unsafe { libc::getuid() }).into()),
     );
     cmd.args(["--user", "--scope", "--quiet", "--collect"]);
+    cmd
+}
+
+/// Whether this host can start the transient user scope that every bounded launch needs, that is,
+/// whether a systemd user manager for this uid is reachable. It starts `/usr/bin/true` through
+/// the same launcher. Tests use it to report NOT_RUN (`crate::not_run`); the launchers never
+/// consult it and still fail closed when the scope cannot start.
+pub(crate) fn user_scope_available() -> bool {
+    user_scope()
+        .arg("/usr/bin/true")
+        .stdout(std::process::Stdio::null())
+        .stderr(std::process::Stdio::null())
+        .status()
+        .is_ok_and(|s| s.success())
+}
+
+/// The common fail-closed host launcher for untrusted code. The user scope charges
+/// the whole process tree, including tmpfs/memfd, rather than sampled process RSS.
+pub(crate) fn bounded_bwrap(
+    limits: &super::container::SandboxLimits,
+    timeout: Option<u64>,
+) -> Command {
+    let mut cmd = user_scope();
     cmd.arg(format!("--property=MemoryMax={}M", limits.max_memory_mb));
     cmd.arg("--property=MemorySwapMax=0");
     cmd.arg(format!("--property=TasksMax={}", limits.max_pids));
diff --git a/src/lib.rs b/src/lib.rs
index 560d36c..a63bba0 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -16,6 +16,8 @@ pub mod ledger;
 pub mod measure;
 pub mod meta;
 pub mod models;
+#[doc(hidden)]
+pub mod not_run;
 pub mod observe;
 pub mod promotion_gate;
 pub mod propose;
diff --git a/src/not_run.rs b/src/not_run.rs
new file mode 100644
index 0000000..f869098
--- /dev/null
+++ b/src/not_run.rs
@@ -0,0 +1,73 @@
+//! Test support: NOT_RUN for tests whose path needs something this host may not offer.
+//!
+//! libtest has no runtime skip, so a NOT_RUN test still counts as `ok` in the summary. The
+//! `NOT_RUN <test>: ...` line on stderr is the record that the test asserted nothing, never a
+//! pass. The line is written with `std::io::stderr()` rather than `eprintln!`, which libtest
+//! captures and hides for a test that returns, so a plain `cargo test` shows it.
+
+use std::io::Write;
+use std::sync::LazyLock;
+
+static USER_SCOPE: LazyLock<bool> =
+    LazyLock::new(crate::isolation::cargo_sandbox::user_scope_available);
+
+fn not_run(test: &str, reason: &str) -> bool {
+    let _ = writeln!(
+        std::io::stderr(),
+        "NOT_RUN {test}: {reason}; nothing was asserted"
+    );
+    false
+}
+
+/// For a test whose path starts a transient systemd user scope (`systemd-run --user --scope`,
+/// `isolation::cargo_sandbox`). Without a reachable user manager (no user bus, for example in a
+/// container whose pid 1 is not systemd) every such launch fails closed, so the test would fail
+/// for a reason that says nothing about the code, or a refusal test would pass without the
+/// sandbox ever running. True when the scope starts; otherwise reports NOT_RUN and returns
+/// false, and the caller returns before doing anything. With `RSI_REQUIRE_USER_SCOPE` set a
+/// missing user manager is a failure instead; the Spark test gate (`tests/gates/run.sh test`)
+/// sets it.
+pub fn user_scope_or_not_run(test: &str) -> bool {
+    if *USER_SCOPE {
+        return true;
+    }
+    assert!(
+        std::env::var_os("RSI_REQUIRE_USER_SCOPE").is_none(),
+        "RSI_REQUIRE_USER_SCOPE is set but `systemd-run --user --scope` cannot start here"
+    );
+    not_run(
+        test,
+        "no reachable systemd user manager (`systemd-run --user --scope` failed), so the \
+         sandboxed path cannot start",
+    )
+}
+
+/// For a test that compiles and runs CUDA on the GPU. GPU tests are opt-in: they run only with
+/// `SPARK_RSI_GPU_TESTS=1`, set by an operator inside an authorized GPU window, and otherwise
+/// report NOT_RUN, whatever hardware is present. Once opted in, a missing `nvcc` or an NVIDIA
+/// device this process cannot open is a failure, not a skip.
+pub fn gpu_or_not_run(test: &str) -> bool {
+    if std::env::var("SPARK_RSI_GPU_TESTS").as_deref() != Ok("1") {
+        return not_run(
+            test,
+            "GPU tests are opt-in (set SPARK_RSI_GPU_TESTS=1 inside an authorized GPU window)",
+        );
+    }
+    let nvcc = std::process::Command::new("nvcc")
+        .arg("--version")
+        .output()
+        .is_ok_and(|o| o.status.success())
+        || std::path::Path::new("/usr/local/cuda/bin/nvcc").exists();
+    assert!(nvcc, "SPARK_RSI_GPU_TESTS=1 but nvcc is not available");
+    // The device nodes can exist yet be closed to this process (a sandbox with a closed device
+    // policy, or a user outside the video group). Only a device we can open counts as a GPU.
+    for dev in ["/dev/nvidiactl", "/dev/nvidia0"] {
+        let open = std::fs::OpenOptions::new().read(true).write(true).open(dev);
+        assert!(
+            open.is_ok(),
+            "SPARK_RSI_GPU_TESTS=1 but {dev} cannot be opened: {:?}",
+            open.err()
+        );
+    }
+    true
+}
diff --git a/src/propose/kernel_autotune.rs b/src/propose/kernel_autotune.rs
index 0c3a3dc..123f323 100644
--- a/src/propose/kernel_autotune.rs
+++ b/src/propose/kernel_autotune.rs
@@ -1157,23 +1157,9 @@ prefetch_global_l2(next_k);
 
     #[tokio::test]
     async fn test_kernel_autotune_experiment_end_to_end() {
-        let nvcc_available = std::process::Command::new("nvcc")
-            .arg("--version")
-            .output()
-            .map(|o| o.status.success())
-            .unwrap_or(false)
-            || std::path::Path::new("/usr/local/cuda/bin/nvcc").exists();
-        // The device nodes can exist yet be closed to this process (a sandbox with a closed device
-        // policy, or a user outside the video group). Only a device we can open counts as a GPU.
-        let gpu_available = ["/dev/nvidiactl", "/dev/nvidia0"].iter().all(|p| {
-            fs::OpenOptions::new()
-                .read(true)
-                .write(true)
-                .open(p)
-                .is_ok()
-        });
-        if !nvcc_available || !gpu_available {
-            eprintln!("Skipping CUDA autotune test: nvcc or an openable NVIDIA GPU device (/dev/nvidiactl, /dev/nvidia0) is not available");
+        if !crate::not_run::gpu_or_not_run("test_kernel_autotune_experiment_end_to_end")
+            || !crate::not_run::user_scope_or_not_run("test_kernel_autotune_experiment_end_to_end")
+        {
             return;
         }
         let _ = std::process::Command::new("sudo")
@@ -1225,6 +1211,13 @@ prefetch_global_l2(next_k);
 
     #[tokio::test]
     async fn test_kernel_autotune_against_physical_sovereign_core_cuda_source() {
+        if !crate::not_run::gpu_or_not_run(
+            "test_kernel_autotune_against_physical_sovereign_core_cuda_source",
+        ) || !crate::not_run::user_scope_or_not_run(
+            "test_kernel_autotune_against_physical_sovereign_core_cuda_source",
+        ) {
+            return;
+        }
         let core_dir = std::env::var("AIEN_SOVEREIGN_CORE_DIR").unwrap_or_else(|_| {
             format!(
                 "{}/workspace/aien-sovereign-core",
diff --git a/tests/gates/run.sh b/tests/gates/run.sh
index d80d4e5..45f9adf 100755
--- a/tests/gates/run.sh
+++ b/tests/gates/run.sh
@@ -45,7 +45,9 @@ case "$step" in
     obs prepopulate_rc 0
     # Keep the in-tree binary location expected by the judge unit tests.
     # prepopulate_rc is the existing gate observation for this fixture build.
-    env -u CARGO_TARGET_DIR CARGO_BUILD_JOBS=2 cargo test --offline --locked -j2 --verbose -- --test-threads=1
+    # RSI_REQUIRE_USER_SCOPE=1: the gate fails rather than reporting the sandbox tests NOT_RUN
+    # when no systemd user manager is reachable (src/not_run.rs).
+    env -u CARGO_TARGET_DIR CARGO_BUILD_JOBS=2 RSI_REQUIRE_USER_SCOPE=1 cargo test --offline --locked -j2 --verbose -- --test-threads=1
     ;;
   zero-disk-secrets)
     # Not a hosted step in this repository; the same invariant the sibling repos enforce.
diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs
index df44a65..c003c74 100644
--- a/tests/integration_tests.rs
+++ b/tests/integration_tests.rs
@@ -101,6 +101,9 @@ fn test_proposal_staging_in_sandbox() {
 
 #[test]
 fn test_codebase_observation_current_repo() {
+    if !spark_rsi::not_run::user_scope_or_not_run("test_codebase_observation_current_repo") {
+        return;
+    }
     let repo_path = Path::new(".");
     let telemetry = observe_codebase(repo_path).expect("telemetry should succeed");
     assert!(!telemetry.git_branch.is_empty());
diff --git a/tests/test_canary_execution.rs b/tests/test_canary_execution.rs
index beff31f..aa572a7 100644
--- a/tests/test_canary_execution.rs
+++ b/tests/test_canary_execution.rs
@@ -137,6 +137,11 @@ fn the_fixture_ships_a_valid_adapter_manifest() {
 
 #[tokio::test]
 async fn correct_run_yields_ten_qualifying_observations_and_passes_the_quota() {
+    if !spark_rsi::not_run::user_scope_or_not_run(
+        "correct_run_yields_ten_qualifying_observations_and_passes_the_quota",
+    ) {
+        return;
+    }
     let h = harness();
     let mut generation = h.generation();
     let outcome = h
@@ -171,6 +176,11 @@ async fn correct_run_yields_ten_qualifying_observations_and_passes_the_quota() {
 
 #[tokio::test]
 async fn wrong_answer_is_recorded_reverts_early_and_fails_admission() {
+    if !spark_rsi::not_run::user_scope_or_not_run(
+        "wrong_answer_is_recorded_reverts_early_and_fails_admission",
+    ) {
+        return;
+    }
     let h = harness();
     let mut generation = h.generation();
     let outcome = h
@@ -198,6 +208,9 @@ async fn wrong_answer_is_recorded_reverts_early_and_fails_admission() {
 
 #[tokio::test]
 async fn fabricated_success_cannot_qualify() {
+    if !spark_rsi::not_run::user_scope_or_not_run("fabricated_success_cannot_qualify") {
+        return;
+    }
     let h = harness();
     let mut generation = h.generation();
     let outcome = h
@@ -218,6 +231,11 @@ async fn fabricated_success_cannot_qualify() {
 
 #[tokio::test]
 async fn duplicate_results_yield_one_observation_per_request_and_rejections() {
+    if !spark_rsi::not_run::user_scope_or_not_run(
+        "duplicate_results_yield_one_observation_per_request_and_rejections",
+    ) {
+        return;
+    }
     let h = harness();
     let mut generation = h.generation();
     let outcome = h
@@ -249,6 +267,11 @@ async fn duplicate_results_yield_one_observation_per_request_and_rejections() {
 
 #[tokio::test]
 async fn replay_on_a_new_connection_creates_no_observations_even_across_a_restart() {
+    if !spark_rsi::not_run::user_scope_or_not_run(
+        "replay_on_a_new_connection_creates_no_observations_even_across_a_restart",
+    ) {
+        return;
+    }
     let h = harness();
     let mut generation = h.generation();
 
@@ -293,6 +316,9 @@ async fn replay_on_a_new_connection_creates_no_observations_even_across_a_restar
 
 #[tokio::test]
 async fn timeout_is_recorded_as_a_timeout_and_reverts() {
+    if !spark_rsi::not_run::user_scope_or_not_run("timeout_is_recorded_as_a_timeout_and_reverts") {
+        return;
+    }
     let h = harness();
     let mut generation = h.generation();
     let outcome = h
@@ -316,6 +342,11 @@ async fn timeout_is_recorded_as_a_timeout_and_reverts() {
 
 #[tokio::test]
 async fn an_answer_to_the_wrong_request_is_a_rejection_then_a_timeout() {
+    if !spark_rsi::not_run::user_scope_or_not_run(
+        "an_answer_to_the_wrong_request_is_a_rejection_then_a_timeout",
+    ) {
+        return;
+    }
     let h = harness();
     let mut generation = h.generation();
     let outcome = h
@@ -333,6 +364,11 @@ async fn an_answer_to_the_wrong_request_is_a_rejection_then_a_timeout() {
 
 #[tokio::test]
 async fn premature_promotion_attempts_never_reach_durable_or_switch_active_sock() {
+    if !spark_rsi::not_run::user_scope_or_not_run(
+        "premature_promotion_attempts_never_reach_durable_or_switch_active_sock",
+    ) {
+        return;
+    }
     let h = harness();
     let mut generation = h.generation();
     let outcome = h
@@ -355,6 +391,11 @@ async fn premature_promotion_attempts_never_reach_durable_or_switch_active_sock(
 
 #[tokio::test]
 async fn a_wrong_secret_is_rejected_and_closed_without_rollback() {
+    if !spark_rsi::not_run::user_scope_or_not_run(
+        "a_wrong_secret_is_rejected_and_closed_without_rollback",
+    ) {
+        return;
+    }
     let h = harness();
     let mut generation = h.generation();
     let outcome = h
@@ -382,6 +423,11 @@ async fn a_wrong_secret_is_rejected_and_closed_without_rollback() {
 
 #[tokio::test]
 async fn old_wrong_generation_and_silent_workers_are_never_ready() {
+    if !spark_rsi::not_run::user_scope_or_not_run(
+        "old_wrong_generation_and_silent_workers_are_never_ready",
+    ) {
+        return;
+    }
     for (mode, env) in [
         ("old_protocol", vec![]),
         (
@@ -421,6 +467,11 @@ async fn old_wrong_generation_and_silent_workers_are_never_ready() {
 
 #[tokio::test]
 async fn the_log_survives_a_kill_and_reopen_with_no_double_counting() {
+    if !spark_rsi::not_run::user_scope_or_not_run(
+        "the_log_survives_a_kill_and_reopen_with_no_double_counting",
+    ) {
+        return;
+    }
     let h = harness();
     let mut generation = h.generation();
     let halted = h
diff --git a/tests/test_no_synthetic_trust_inputs.rs b/tests/test_no_synthetic_trust_inputs.rs
index 1decd84..81b774b 100644
--- a/tests/test_no_synthetic_trust_inputs.rs
+++ b/tests/test_no_synthetic_trust_inputs.rs
@@ -401,7 +401,11 @@ fn commitment(payloads: &[String]) -> Option<serde_json::Value> {
 
 #[tokio::test]
 async fn daemon_cycle_with_a_correct_fixture_reaches_the_later_gates() {
-    if !build_jail_available() {
+    if !build_jail_available()
+        || !spark_rsi::not_run::user_scope_or_not_run(
+            "daemon_cycle_with_a_correct_fixture_reaches_the_later_gates",
+        )
+    {
         return;
     }
     let _guard = FIXTURE_ENV_LOCK.lock().await;
@@ -468,7 +472,11 @@ async fn daemon_cycle_with_a_correct_fixture_reaches_the_later_gates() {
 
 #[tokio::test]
 async fn daemon_cycle_with_a_wrong_answering_fixture_is_refused_and_rolled_back() {
-    if !build_jail_available() {
+    if !build_jail_available()
+        || !spark_rsi::not_run::user_scope_or_not_run(
+            "daemon_cycle_with_a_wrong_answering_fixture_is_refused_and_rolled_back",
+        )
+    {
         return;
     }
     let _guard = FIXTURE_ENV_LOCK.lock().await;
diff --git a/tests/test_receipt_v2.rs b/tests/test_receipt_v2.rs
index 19c1e39..1bd826d 100644
--- a/tests/test_receipt_v2.rs
+++ b/tests/test_receipt_v2.rs
@@ -849,6 +849,10 @@ fn policy_paths_must_be_clean() {
 /// judge's signing key) cannot be read at build time, so `include_str!` of it fails the build.
 #[test]
 fn judge_build_cannot_read_files_outside_the_tree() {
+    if !spark_rsi::not_run::user_scope_or_not_run("judge_build_cannot_read_files_outside_the_tree")
+    {
+        return;
+    }
     let probe = std::process::Command::new("bwrap")
         .args([
             "--unshare-user",
@@ -914,6 +918,11 @@ fn judge_build_cannot_read_files_outside_the_tree() {
 /// the sandbox and a harmless tree passes inside it.
 #[test]
 fn judge_correctness_check_cannot_read_files_outside_the_tree() {
+    if !spark_rsi::not_run::user_scope_or_not_run(
+        "judge_correctness_check_cannot_read_files_outside_the_tree",
+    ) {
+        return;
+    }
     let probe = std::process::Command::new("bwrap")
         .args([
             "--unshare-user",
diff --git a/tests/test_security_isolation.rs b/tests/test_security_isolation.rs
index ad255a8..322df76 100644
--- a/tests/test_security_isolation.rs
+++ b/tests/test_security_isolation.rs
@@ -28,6 +28,9 @@ fn crate_at(root: &Path, source: &str, build: Option<&str>) {
 
 #[test]
 fn invariant_tests_cannot_write_host_files() {
+    if !spark_rsi::not_run::user_scope_or_not_run("invariant_tests_cannot_write_host_files") {
+        return;
+    }
     let tmp = tempfile::tempdir().unwrap();
     let marker = tmp.path().join("host-only-marker");
     let tree = tmp.path().join("candidate");
@@ -53,6 +56,11 @@ fn invariant_tests_cannot_write_host_files() {
 
 #[test]
 fn observation_build_scripts_cannot_write_host_files() {
+    if !spark_rsi::not_run::user_scope_or_not_run(
+        "observation_build_scripts_cannot_write_host_files",
+    ) {
+        return;
+    }
     let tmp = tempfile::tempdir().unwrap();
     let marker = tmp.path().join("observer-host-marker");
     let tree = tmp.path().join("candidate");
@@ -78,6 +86,9 @@ fn observation_build_scripts_cannot_write_host_files() {
 
 #[test]
 fn failing_candidate_tests_are_not_accepted() {
+    if !spark_rsi::not_run::user_scope_or_not_run("failing_candidate_tests_are_not_accepted") {
+        return;
+    }
     let tmp = tempfile::tempdir().unwrap();
     crate_at(
         tmp.path(),
@@ -95,6 +106,10 @@ fn failing_candidate_tests_are_not_accepted() {
 
 #[test]
 fn build_jail_does_not_inherit_service_environment() {
+    if !spark_rsi::not_run::user_scope_or_not_run("build_jail_does_not_inherit_service_environment")
+    {
+        return;
+    }
     let tmp = tempfile::tempdir().unwrap();
     let source = tmp.path().join("source");
     let output = tmp.path().join("output");
@@ -116,6 +131,9 @@ fn build_jail_does_not_inherit_service_environment() {
 
 #[test]
 fn canary_cannot_read_or_write_supervisor_files() {
+    if !spark_rsi::not_run::user_scope_or_not_run("canary_cannot_read_or_write_supervisor_files") {
+        return;
+    }
     let tmp = tempfile::tempdir().unwrap();
     let secret = tmp.path().join("operator-secret");
     let marker = tmp.path().join("canary-host-marker");
@@ -163,6 +181,9 @@ fn descendants(pid: u32) -> Vec<u32> {
 
 #[test]
 fn stopping_canary_reaps_forked_descendants() {
+    if !spark_rsi::not_run::user_scope_or_not_run("stopping_canary_reaps_forked_descendants") {
+        return;
+    }
     let tmp = tempfile::tempdir().unwrap();
     let script = tmp.path().join("worker");
     fs::write(&script, "#!/bin/sh\nsleep 60 &\nwait\n").unwrap();
@@ -229,6 +250,10 @@ fn stopping_canary_reaps_forked_descendants() {
 
 #[test]
 fn canary_tmpfs_is_charged_to_a_hard_memory_limit() {
+    if !spark_rsi::not_run::user_scope_or_not_run("canary_tmpfs_is_charged_to_a_hard_memory_limit")
+    {
+        return;
+    }
     let tmp = tempfile::tempdir().unwrap();
     let script = tmp.path().join("worker");
     fs::write(&script, "#!/bin/sh\nprintf ok > /scratch/small || exit 40\nexec dd if=/dev/zero of=/scratch/fill bs=1M count=64 status=none\n").unwrap();
@@ -259,6 +284,11 @@ fn canary_tmpfs_is_charged_to_a_hard_memory_limit() {
 
 #[test]
 fn build_jail_tmpfs_is_charged_to_a_hard_memory_limit() {
+    if !spark_rsi::not_run::user_scope_or_not_run(
+        "build_jail_tmpfs_is_charged_to_a_hard_memory_limit",
+    ) {
+        return;
+    }
     let tmp = tempfile::tempdir().unwrap();
     let source = tmp.path().join("source");
     let output = tmp.path().join("output");