From 125d55897c85a05fe1d26d9f0e7acd78fd86e577 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Fri, 16 Oct 2026 22:05:50 -0500 Subject: [PATCH 1/3] gates: clean-clone copies and logs live in a private mkdtemp folder, not fixed /tmp paths (#526) Hypothesis that held: M18 gate 16 (chained by M19 gate 17) copied the repo to /tmp/omega_clean_m18 and wrote /tmp/clean_clone_m18.log. Both names are shared by every user of the machine, and /tmp is sticky, so whoever ran second lost: the Spark judge (user aien-run) hit "cannot create /tmp/clean_clone_m18.log: Permission denied" on a log Drake's account left on 2026-10-06 (judge run cf5495d0, M19 FAIL REGRESSION 158/159), and an operator run from Drake's account hit "rm: cannot remove /tmp/omega_clean_m18/...: Permission denied" on the 636 MB copy the judge left on 2026-10-16. Not a sandbox rule: the sandbox writes to /tmp fine (M19's mkdtemp clones from the same runs are there). M18 now does what M19 already did: mkdtemp("$TMPDIR|/tmp/omega_clean_m18_XXXXXX"), copy into /checkout, log to /clean_clone_m18.log, and print that path on failure so the receipt names it. Both M18 and M19 remove the built checkout after the nested run (hundreds of MB each; five M19 copies from one day were in /tmp, disk at 83%) and keep the log. Red: judge receipt blob for M19 in cf5495d0 and the rm refusal reproduced from Drake's account on 2026-10-17. Green: the Spark judge's M18/M19 gates on this head; they also need the channel-create fix (aien-dev/physics-mv#64), so this ships with the physics.lock bump. Co-Authored-By: Claude Fable 5.1 Co-authored-by: Drake Stapleton --- src/omega_blackwell_gates.c | 42 ++++++++++++++++++++++++++++++------- src/omega_world_gates.c | 22 ++++++++++++++++--- 2 files changed, 54 insertions(+), 10 deletions(-) diff --git a/src/omega_blackwell_gates.c b/src/omega_blackwell_gates.c index 5c7634b41..8e6da5f00 100644 --- a/src/omega_blackwell_gates.c +++ b/src/omega_blackwell_gates.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "omega_physics_dir.h" static int m17_gate_count = 0; @@ -975,31 +976,58 @@ fail: return false; } +/* Remove the built copy a clean-clone gate made under its private folder; the + * log beside it stays for the reader. Hundreds of MB per run otherwise pile up + * in /tmp (omega#526). */ +static void m18_clean_clone_remove_checkout(const char *clone) { + char cmd[PATH_MAX + 32]; + int n = snprintf(cmd, sizeof(cmd), "rm -rf -- '%s/checkout'", clone); + if (n < 0 || (size_t)n >= sizeof(cmd)) return; + int rc = system(cmd); + (void)rc; +} + static bool test_m18_gate16_clean_clone(void) { if (getenv("OMEGA_IN_CLEAN_CLONE") != NULL) { return true; } /* Copy the repo this omegatool runs from (the code under test), not a * hardcoded checkout, and pass the PHYSICS_DIR this process resolves at run time - * (omega_physics_dir.h) as an absolute path so the copy in /tmp does not fall back to - * the Makefile default ../physics (= /tmp/physics). Mirrors M19. */ + * (omega_physics_dir.h) as an absolute path so the copy does not fall back to + * the Makefile default ../physics. Mirrors M19. + * + * The copy and its log live in a private mkdtemp folder (omega#526). A fixed + * /tmp path is shared by every user of the machine, and the sticky /tmp lets + * neither the judge user nor the operator remove or overwrite what the other + * left behind ("rm: Permission denied", "cannot create ...log: Permission denied"), + * so the gate failed for whoever ran second. */ char physics_dir_resolved[PATH_MAX], physics_err[OMEGA_PHYSICS_ERR_SIZE]; if (!omega_physics_dir_resolve_pinned(physics_dir_resolved, sizeof(physics_dir_resolved), 0, physics_err, sizeof(physics_err))) { fprintf(stderr, "%s\n", physics_err); return false; } + const char *tmp = getenv("TMPDIR"); + if (!tmp || !*tmp) tmp = "/tmp"; + char clone[PATH_MAX]; + int cl = snprintf(clone, sizeof(clone), "%s/omega_clean_m18_XXXXXX", tmp); + if (cl < 0 || (size_t)cl >= sizeof(clone)) return false; + if (!mkdtemp(clone)) { + fprintf(stderr, "M18 clean clone: mkdtemp %s: %s\n", clone, strerror(errno)); + return false; + } char command[4608]; int len = snprintf(command, sizeof(command), "root=$(git rev-parse --show-toplevel) && " - "rm -rf /tmp/omega_clean_m18 && " - "cp -r \"$root\" /tmp/omega_clean_m18 && " - "cd /tmp/omega_clean_m18 && " + "cp -r \"$root\" '%s/checkout' && " + "cd '%s/checkout' && " "make clean >/dev/null 2>&1 && " "make -j PHYSICS_DIR='%s' >/dev/null 2>&1 && " - "OMEGA_IN_CLEAN_CLONE=1 ./build/omegatool --run-m18-gates >/tmp/clean_clone_m18.log 2>&1", - physics_dir_resolved); + "OMEGA_IN_CLEAN_CLONE=1 ./build/omegatool --run-m18-gates >'%s/clean_clone_m18.log' 2>&1", + clone, clone, physics_dir_resolved, clone); if (len < 0 || (size_t)len >= sizeof(command)) return false; int rc = system(command); + if (rc != 0) fprintf(stderr, "M18 clean clone failed (rc %d); log: %s/clean_clone_m18.log\n", rc, clone); + m18_clean_clone_remove_checkout(clone); return (rc == 0); } diff --git a/src/omega_world_gates.c b/src/omega_world_gates.c index e0f6d310c..0a4ecbe62 100644 --- a/src/omega_world_gates.c +++ b/src/omega_world_gates.c @@ -1759,6 +1759,16 @@ static bool test_m19_gate15_zero_libcuda(void) { return true; } +/* Remove the built copy under the private clone folder; qualification.log stays + * beside it (omega#526: five such copies per day filled /tmp). */ +static void m19_clean_clone_remove_checkout(const char *checkout) { + char cmd[600]; + int n = snprintf(cmd, sizeof(cmd), "rm -rf -- '%s'", checkout); + if (n < 0 || (size_t)n >= sizeof(cmd)) return; + int rc = system(cmd); + (void)rc; +} + /* Gate 16: OMEGA_ACCEL_RESIDENT_CLEAN_CLONE_PASS */ static bool test_m19_gate16_clean_clone(void) { char src_sha[41] = {0}; @@ -1803,12 +1813,18 @@ static bool test_m19_gate16_clean_clone(void) { "OMEGA_IN_CLEAN_CLONE=1 ./build/omegatool --run-m19-gates >%s/qualification.log 2>&1", checkout, checkout, src_sha, physics_dir_resolved, clone); if (len < 0 || (size_t)len >= sizeof(command)) return false; - if (system(command) != 0) return false; + int rc = system(command); + if (rc != 0) { + fprintf(stderr, "M19 clean clone failed (rc %d); log: %s/qualification.log\n", rc, clone); + m19_clean_clone_remove_checkout(checkout); + return false; + } /* The built checkout must be exactly the named candidate revision. */ char clone_sha[41] = {0}; - if (!m19_git_head(checkout, clone_sha)) return false; - if (strcmp(clone_sha, src_sha) != 0) return false; + bool same = m19_git_head(checkout, clone_sha) && strcmp(clone_sha, src_sha) == 0; + m19_clean_clone_remove_checkout(checkout); + if (!same) return false; memcpy(m19_candidate_commit, src_sha, sizeof(m19_candidate_commit)); return true; From 12b00a37714b766c572025afbc8187844e95569d Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Fri, 16 Oct 2026 22:06:08 -0500 Subject: [PATCH 2/3] crumb: recompile after src/omega_blackwell_gates.c and src/omega_world_gates.c (#526) Co-Authored-By: Claude Fable 5.1 Co-authored-by: Drake Stapleton --- .crumb | 14 +++++++------- src/.crumb | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.crumb b/.crumb index 81f377ee2..6a62fc81e 100644 --- a/.crumb +++ b/.crumb @@ -77,8 +77,8 @@ "purpose": "Directory spec. Purpose not yet described by a human." }, { - "digest": "dfa36de2ac8649f66f80587abea51a7f166285ee0b92e0e09774c98689055250", - "last_commit": "333091a6", + "digest": "e2f18fa3911a9c29bbb65a663715bcca30769d1bddef2c33b28a3869582d6538", + "last_commit": "125d5589", "name": "src", "purpose": "Directory src. Purpose not yet described by a human." }, @@ -95,15 +95,15 @@ "purpose": "Directory tools. Purpose not yet described by a human." } ], - "children_root": "sha256:e1a8c008214ad5dbc33a3e184d7e882dc56d1d50f9bd14c58f8773992961557e", - "compiled_at": "2026-10-16T19:04:20Z", + "children_root": "sha256:b352b84161828b8f04b2d6606a7f56e23948bbe31e21f5763b2f1cc728ce2918", + "compiled_at": "2026-10-17T03:06:04Z", "compiler": "crumb-compile/1", - "digest": "sha256:32086cfe6b319e0c0229bec39553d1b32f7460aa660ad888d5eb5990522e705a", + "digest": "sha256:9c1507dffc885e5921430ebbf2afbc816c5a6ac33af73753af2e136caaac5439", "evidence_files": 11127, "evidence_root": "sha256:4528085ec1661c442b64fb5dc8def65067ea2620ff88e42bcf52d58b7642ea6e", "files": 14109, - "generated_at_commit": "88e24bdd57b27817d030d0ad95f62c3f3eacf426", - "source_tree": "sha256:e01c9caa38757306582443fe69f52cb061c3d27250f8ad0b9f4b4f43b009dc14" + "generated_at_commit": "125d55897c85a05fe1d26d9f0e7acd78fd86e577", + "source_tree": "sha256:32f25ca8e5b79206e3510778e7922f14748c3490dd2a7a2ab0bdea77b160f991" }, "owner_lane": "", "provenance": { diff --git a/src/.crumb b/src/.crumb index 4fe5298a4..94e9f39eb 100644 --- a/src/.crumb +++ b/src/.crumb @@ -182,14 +182,14 @@ } ], "children_root": "sha256:15012a017b26a269feb256b64875ece2912f5f82c57804baafa3777c4fcb80b9", - "compiled_at": "2026-10-16T07:33:43Z", + "compiled_at": "2026-10-17T03:06:04Z", "compiler": "crumb-compile/1", - "digest": "sha256:dfa36de2ac8649f66f80587abea51a7f166285ee0b92e0e09774c98689055250", + "digest": "sha256:e2f18fa3911a9c29bbb65a663715bcca30769d1bddef2c33b28a3869582d6538", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 537, - "generated_at_commit": "1d481ab853a14d3c11eff926ce1e25993085f76a", - "source_tree": "sha256:200c9243151691313acb5f86d3e9cb3058f1a1b92ece2a255b3340b691dfb894" + "generated_at_commit": "125d55897c85a05fe1d26d9f0e7acd78fd86e577", + "source_tree": "sha256:6b6abccff82effd780389017a14312a55ef8aef02d43b36e77c8a86716361ab7" }, "owner_lane": "", "provenance": { From e466b138b57f6672afb26fc657fcdb28cc4c6293 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Fri, 16 Oct 2026 22:13:15 -0500 Subject: [PATCH 3/3] r11 own-hold test: a load refusal is not the flag refusal; wait for quiet, never pass a skip OMEGA-R11-OWN-HOLD failed on every Spark judge run since the pipeline started running ~20 host gates at once. The q1-abc case wants the R11 living run to start inside its own quiet hold, but rx_r11_aien.c other_load() also refuses the living run when the 1-minute load average is above 2 (SKIPPED-LOADED). The test counted any refusal as the flag refusal, so a loaded machine read as "refused, want ran" (red reproduced at load 4.5, same line as the judge). Now the test tells the two reasons apart by the binary's own text: - flag refusal ("holds ~/workspace/.spark-quiet") is the refusal under test; - a load refusal on the q1-abc case waits for load <= 2 (15 s polls, at most R11_QUIET_WAIT s, default 1800, inside the gate's 60 min timeout) and runs again. If the machine never quiets the case still fails ("loaded, want ran"): a skipped living run is never a pass. - a load refusal on a case that must be refused by the flag now fails (the flag was accepted as ours), which the old test could not see. Co-Authored-By: Claude Opus 5.5 (cherry picked from commit aae8d114d0dc769eeec11037781f1bd69baf0cf4) --- tests/runtime/r11_own_hold_test.sh | 34 ++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/tests/runtime/r11_own_hold_test.sh b/tests/runtime/r11_own_hold_test.sh index d16128cc1..13325f0b9 100755 --- a/tests/runtime/r11_own_hold_test.sh +++ b/tests/runtime/r11_own_hold_test.sh @@ -2,17 +2,43 @@ # R11 living run inside its own quiet hold (tests/runtime/rx_r11_aien.c # quiet_flag_is_mine). With a fake HOME whose ~/workspace/.spark-quiet carries # hold=q1-abc: no QUIETLOCK_HOLD, a prefix and an extension of the id must all -# refuse the living run (someone else's measurement); QUIETLOCK_HOLD=q1-abc -# must run it. usage: r11_own_hold_test.sh +# refuse the living run because of the flag (someone else's measurement); +# QUIETLOCK_HOLD=q1-abc must run it. +# +# The binary also refuses the living run when the machine is loaded (1-minute +# load average above 2, or an R15 program alive): "SKIPPED-LOADED: ". +# Only the flag reason counts as the refusal this test is about. When the +# q1-abc case is refused for load, the test waits for the machine to quiet down +# and runs it again, for at most R11_QUIET_WAIT seconds (default 1800). If the +# machine never quiets, the case stays a failure: a skipped living run is never +# a pass. usage: r11_own_hold_test.sh B=${1:?rx_r11_aien_test binary}; H=$(mktemp -d); fail=0 +WAIT=${R11_QUIET_WAIT:-1800} trap 'rm -rf "$H"' EXIT mkdir -p "$H/workspace" echo "other quietlock X start=2026-10-05T00:00:00Z expected_end=2099-01-01T00:00:00Z pid=1 hold=q1-abc" > "$H/workspace/.spark-quiet" +FLAG_WHY='holds ~/workspace/.spark-quiet' + +load_ok() { awk '{ exit !($1 <= 2.0) }' /proc/loadavg; } + for hold in "" q1-ab q1-abcd q1-abc; do - out=$(HOME=$H QUIETLOCK_HOLD=$hold "$B" 2>&1) - if printf '%s\n' "$out" | grep -Fq "living run not exercised"; then got=refused; else got=ran; fi if [ "$hold" = q1-abc ]; then want=ran; else want=refused; fi + waited=0 + while :; do + out=$(HOME=$H QUIETLOCK_HOLD=$hold "$B" 2>&1) + if ! printf '%s\n' "$out" | grep -Fq "living run not exercised"; then got=ran + elif printf '%s\n' "$out" | grep -Fq "$FLAG_WHY"; then got=refused + else got=loaded; fi + [ "$got" = loaded ] && [ "$want" = ran ] && [ "$waited" -lt "$WAIT" ] || break + why=$(printf '%s\n' "$out" | sed -n 's/^\[-\] SKIPPED-LOADED: living run not started: //p' | head -n 1) + echo "[~] hold='$hold': living run refused for load ($why), waiting for a quiet machine (${waited}s of ${WAIT}s)" + while [ "$waited" -lt "$WAIT" ]; do + sleep 15; waited=$((waited + 15)) + load_ok && break + done + done printf '%s\n' "$out" | grep -Eq '^checks [0-9]+ failures 0$' || { got="$got+failures"; } if [ "$got" = "$want" ]; then echo "[+] hold='$hold': $got"; else echo "[-] hold='$hold': $got, want $want"; fail=$((fail + 1)); fi + [ "$got" = loaded ] && printf '%s\n' "$out" | grep -F "SKIPPED-LOADED" | head -n 1 done echo "failures $fail"; [ "$fail" = 0 ]