diff --git a/.crumb b/.crumb index f3e51fe46..68915305a 100644 --- a/.crumb +++ b/.crumb @@ -48,7 +48,7 @@ }, { "digest": "7ef7796693f23ad68d9a5bcaaee0f635018f4371139a040ba202d4ce7083ede8", - "last_commit": "dd39bf71f", + "last_commit": "dcccc0211", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." }, @@ -72,7 +72,7 @@ }, { "digest": "f765ad87fdddd9b47f690b07298c951a0f7e7675dc5de4ffe44e33a0c14b1986", - "last_commit": "a8a6a3d3c", + "last_commit": "d94a503f7", "name": "spec", "purpose": "Directory spec. Purpose not yet described by a human." }, @@ -83,27 +83,27 @@ "purpose": "Directory src. Purpose not yet described by a human." }, { - "digest": "5395ff8ff9afceebe8e453788f80a3064b831513cc4cb92fd55869115e06b874", - "last_commit": "a8a6a3d3c", + "digest": "33bd36cb6cd624560918d550d3a473c67cf94d36a67c766095218e8082c5c98c", + "last_commit": "9bca3d69e", "name": "tests", "purpose": "Directory tests. Purpose not yet described by a human." }, { "digest": "308db0e6cf45c0a48f01f5f5f228450f191389de68006915b9ecf9c65b9a2e29", - "last_commit": "a8a6a3d3c", + "last_commit": "a50c3bd41", "name": "tools", "purpose": "Directory tools. Purpose not yet described by a human." } ], - "children_root": "sha256:07bf1706dcffbad66c0353871ff67a6749055da03cee8d8ebdf9a4c91e36bddc", - "compiled_at": "2026-10-30T12:31:50Z", + "children_root": "sha256:9b6f854fe1646853884506a4c9737a8d1df7b1318c88fc32ee0decc6bc488c9b", + "compiled_at": "2026-10-30T16:35:22Z", "compiler": "crumb-compile/1", - "digest": "sha256:904fca8c0e0cf3e3a5e5adb73393e01c7018b920bb542d289904240f70e400d6", + "digest": "sha256:cc468bc06947bb34fccefc9b3b7e017d30c2204ad62d04e05e21a447588fd712", "evidence_files": 12622, "evidence_root": "sha256:b1a08e2ce56e6feada0d8a31f06fbd7adee57adc1c1ad8dec220293ee5d439f9", "files": 17849, - "generated_at_commit": "52a82f392fa513ebbc2d9d719a0f14c385289b06", - "source_tree": "sha256:75458da6553a0ee5ea2af95f46afb658e8a3f6e53cca6e3b4b9874035f78c2ed" + "generated_at_commit": "9bca3d69e042752846417167ee5874e87c562ca5", + "source_tree": "sha256:58821e9909ea53b263c3d1b528ff44f46e600350c2b56dfce39336011f5889e3" }, "owner_lane": "", "provenance": { diff --git a/tests/.crumb b/tests/.crumb index 5fbfcb29c..d310baad9 100644 --- a/tests/.crumb +++ b/tests/.crumb @@ -265,8 +265,8 @@ "purpose": "Reservoir tests (omega#440): Gate 1 simulator and readout checks against an independent binary64" }, { - "digest": "10d19641e4bb5b435ec6363d4ea7d3c1596af47d97b86f4de35d6ae57770241e", - "last_commit": "45f7d7691", + "digest": "ab70f78face15a5958ad3237c515d1f38de607aa019ae3af833b88c09f879f8b", + "last_commit": "f65969b7f", "name": "runtime", "purpose": "Directory tests/runtime. Purpose not yet described by a human." }, @@ -301,15 +301,15 @@ "purpose": "Directory tests/visor. Purpose not yet described by a human." } ], - "children_root": "sha256:0c57282ff8cf1d34e5685e2729755f2978917e66debb5423961033be9d25c902", - "compiled_at": "2026-10-30T12:31:50Z", + "children_root": "sha256:7151c2a66afcab9ccd09ce58dcd65b65eddf611f395aeceedf01ec592a80808d", + "compiled_at": "2026-10-30T16:35:22Z", "compiler": "crumb-compile/1", - "digest": "sha256:5395ff8ff9afceebe8e453788f80a3064b831513cc4cb92fd55869115e06b874", + "digest": "sha256:33bd36cb6cd624560918d550d3a473c67cf94d36a67c766095218e8082c5c98c", "evidence_files": 16, "evidence_root": "sha256:96d08097822ad95f4e562c19e0ba5df5a035774c48632f1832912c40a27bd27a", "files": 1386, - "generated_at_commit": "52a82f392fa513ebbc2d9d719a0f14c385289b06", - "source_tree": "sha256:a3b853bb9c0edfc5f1413ccaa2698cc6ea920f2e8795756121667cc9d37f6679" + "generated_at_commit": "9bca3d69e042752846417167ee5874e87c562ca5", + "source_tree": "sha256:29b7ee3a481b31534e93f92635d486392c262485c1795edd17ccf35a06971e6b" }, "owner_lane": "", "provenance": { diff --git a/tests/runtime/.crumb b/tests/runtime/.crumb index 9dce17c38..255aa9e02 100644 --- a/tests/runtime/.crumb +++ b/tests/runtime/.crumb @@ -7,14 +7,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-26T08:13:25Z", + "compiled_at": "2026-10-27T01:44:52Z", "compiler": "crumb-compile/1", - "digest": "sha256:10d19641e4bb5b435ec6363d4ea7d3c1596af47d97b86f4de35d6ae57770241e", + "digest": "sha256:ab70f78face15a5958ad3237c515d1f38de607aa019ae3af833b88c09f879f8b", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 70, - "generated_at_commit": "45f7d76919042ef821cca9ccc75c2bbf7183f712", - "source_tree": "sha256:6d63521e1c1f8eea1bf172d18bde2e6f4fc7c084e9506bc1cc088f8b9ff339d6" + "generated_at_commit": "f65969b7f208d377ddf100d8a594e69fccbd365b", + "source_tree": "sha256:48491bebd8f8b05296a68114c9eb49207c5940dcf621e3d6d30ee46cbdb6f5d9" }, "owner_lane": "", "provenance": { diff --git a/tests/runtime/rx_r13_first_failure_test.sh b/tests/runtime/rx_r13_first_failure_test.sh index 6dfc18212..8cd37e5cb 100644 --- a/tests/runtime/rx_r13_first_failure_test.sh +++ b/tests/runtime/rx_r13_first_failure_test.sh @@ -45,6 +45,11 @@ check "unreachable goal: receipt written" '[ -s "$receipt" ]' check "unreachable goal: gate is FAIL" '[ "$(jq -r ".gate | to_entries[0].value" "$receipt")" = FAIL ]' check "first_failure names the goal check" 'jq -r .first_failure "$receipt" | grep -q "AIEN.s belief does not show the goal met"' check "first_failure is the first stderr R13 failure line" '[ "$(jq -r .first_failure "$receipt")" = "$(grep -m1 "^R13 mode" "$T/fail/stderr.log")" ]' +# omega #527: the judge keeps stdout in its receipt; the reason must be there, not only on stderr. +check "stdout carries the first failure" '[ "$(sed -n "s/^R13 first failure: //p" "$T/fail/stdout.log")" = "$(jq -r .first_failure "$receipt")" ]' +check "stdout carries the FAILED counts line" 'grep -q "^R13 positive FAILED: plan " "$T/fail/stdout.log"' +check "stdout carries the AIEN, Omega and GPU state" 'grep -q "^R13 positive AIEN: prediction " "$T/fail/stdout.log" && grep -q "^R13 positive Omega: search epoch " "$T/fail/stdout.log" && grep -q "^R13 positive GPU: claims .*why no GPU result: " "$T/fail/stdout.log"' +check "normal run: no failure lines on stdout" '! grep -qE "^R13 (first failure|.* FAILED:)" "$T/pass/stdout.log"' check "nothing written under the real build/qual-runs by this test" '[ -z "$(find "$HERE/build/qual-runs" -newer "$T/make.log" 2>/dev/null | head -1)" ]' echo "rx_r13_first_failure_test: $FAILS failures" [ "$FAILS" = 0 ] diff --git a/tests/runtime/rx_r13_living.c b/tests/runtime/rx_r13_living.c index a390362be..402f28bc4 100644 --- a/tests/runtime/rx_r13_living.c +++ b/tests/runtime/rx_r13_living.c @@ -2138,6 +2138,108 @@ static void receipt(int tests_ok) { printf("R13 gate: " R13_GATE_KEY "=%s\nR13 receipt: %s\n", gate, path); } +/* omega #527: why a mode failed, on STDOUT (the judge keeps stdout in its receipt) as well as stderr. + * The counts line alone said "GPU 0" without saying why no GPU experiment ran. These lines name the + * state AIEN, Omega and the seat transport were in when the mode gave up. They only read the world. */ +static const char *pred_state_name(uint64_t s) { + return s == RX_AIEN_PRED_HOLDING ? "holding" : s == RX_AIEN_PRED_CONFIRMED ? "confirmed" : + s == RX_AIEN_PRED_FAILED ? "failed" : s == 0 ? "none" : "?"; +} +static const char *hyp_state_name(uint64_t s) { + return s == RX_AIEN_HYP_OPEN ? "open" : s == RX_AIEN_HYP_TESTING ? "testing (a plan is out)" : + s == RX_AIEN_HYP_SUPPORTED ? "supported" : s == RX_AIEN_HYP_UNSUPPORTED ? "unsupported" : + s == RX_AIEN_HYP_EXHAUSTED ? "exhausted" : s == 0 ? "none" : "?"; +} +static const char *why_name(uint64_t w) { + return w == RX_AIEN_WHY_CORE_CLASS ? "core class" : w == RX_AIEN_WHY_DRIFT ? "drift" : + w == RX_AIEN_WHY_GOAL ? "goal" : w == 0 ? "none" : "?"; +} +static void both(const char *fmt, ...) __attribute__((format(printf, 1, 2))); +static void both(const char *fmt, ...) { + char line[768]; + va_list ap; + va_start(ap, fmt); + vsnprintf(line, sizeof line, fmt, ap); + va_end(ap); + fprintf(stderr, "%s\n", line); + printf("%s\n", line); +} +static void explain_failure(Rig *r, const char *name) { + if (g_first_failure[0]) printf("R13 first failure: %s\n", g_first_failure); + both("R13 %s FAILED: plan %llu search %llu GPU %llu evidence %llu " + "belief %llu selection %llu candidate %llu promotion %llu in force %llu " + "result %d prepare refusal %d", name, + U(field(r, r->aien.o.plan, 0)), U(field(r, r->omega.o.search, 0)), + U(field(r, r->living.o.output, 0)), U(field(r, r->living.o.evidence, 0)), + U(field(r, r->aien.o.experiment_belief, 0)), + U(field(r, r->omega.o.selection, 0)), U(field(r, r->living.o.candidate, 0)), + U(field(r, r->living.o.promotion, 0)), U(field(r, r->living.o.inforce, 0)), + r->promoter.result, r->living.last_refusal); + if (!r->ready) return; /* setup failed: the objects below may not exist */ + both("R13 %s AIEN: prediction %llu %s on record %llu, hits %llu, expects %llu ns, failed at %llu ns; " + "belief record %llu, intervals %llu, baseline %llu ns, last %llu ns, misses %llu; " + "hypothesis %llu %s for prediction %llu, %s; plan %llu (%s, hypothesis %llu, goal %llu); goal %llu", + name, U(field(r, r->aien.o.prediction, 0)), pred_state_name(field(r, r->aien.o.prediction, 6)), + U(field(r, r->aien.o.prediction, 1)), U(field(r, r->aien.o.prediction, 3)), + U(field(r, r->aien.o.prediction, 5)), U(field(r, r->aien.o.prediction, 7)), + U(field(r, r->aien.o.belief, 0)), U(field(r, r->aien.o.belief, 5)), + U(field(r, r->aien.o.belief, 4)), U(field(r, r->aien.o.belief, 6)), + U(field(r, r->aien.o.belief, 7)), + U(field(r, r->aien.o.hypothesis, 0)), + field(r, r->aien.o.hypothesis, 1) == RX_AIEN_HYP_CORE_CLASS ? "core class" : + field(r, r->aien.o.hypothesis, 1) == RX_AIEN_HYP_DRIFT ? "drift" : "-", + U(field(r, r->aien.o.hypothesis, 2)), hyp_state_name(field(r, r->aien.o.hypothesis, 7)), + U(field(r, r->aien.o.plan, 0)), why_name(field(r, r->aien.o.plan, 5)), + U(field(r, r->aien.o.plan, 4)), U(field(r, r->aien.o.plan, 6)), + U(field(r, r->aien.o.goal, 0))); + uint64_t search = field(r, r->omega.o.search, 0), sel = field(r, r->omega.o.selection, 0); + both("R13 %s Omega: search epoch %llu (for plan %llu), selection epoch %llu realization %016llx; " + "production calls %llu using realization %016llx, in force epoch %llu realization %016llx%s", name, + U(search), U(field(r, r->omega.o.search, 6)), U(sel), U(field(r, r->omega.o.selection, 1)), + U(field(r, r->omega.o.demand, 0)), U(field(r, r->omega.o.demand, 6)), + U(field(r, r->living.o.inforce, 0)), U(field(r, r->living.o.inforce, 1)), + search != sel ? "; that search waits for the GPU experiment's evidence before it can select" : ""); + uint64_t claims = r->w.stats.resident_claims, seat_acts = acts(r, r->living.r_seat); + int err = atomic_load(&r->acceptor_error); + const char *why; + char buf[160]; + uint64_t prepared = field(r, r->living.o.input, 2); /* search epoch the experiment is for */ + if (err != 0) { snprintf(buf, sizeof buf, "seat transport error %d (the seat's own line is on stderr)", err); why = buf; } + else if (seat_blocked(r, 0)) why = "the seat was stopped by the authority check"; + else if (r->living.last_refusal != 0) { snprintf(buf, sizeof buf, "experiment prepare refused (%d)", r->living.last_refusal); why = buf; } + else if (prepared == 0) + why = r->acceptor_live ? "no GPU experiment was prepared (no AIEN plan taken up by an Omega search)" + : "no GPU experiment was prepared, and the seat transport was not started yet " + "(it starts with the goal)"; + else if (!r->acceptor_live) + why = "a GPU experiment was prepared but the seat transport that completes claims was not started yet " + "(it starts with the goal)"; + else if (claims != 0) why = "the seat claimed; see the counts above"; + else why = "a GPU experiment was prepared and the seat transport ran, but no claim completed"; + both("R13 %s GPU: claims %llu, seat activations %llu, transport %s, transport error %d, " + "experiment input search %llu trial %llu; why no GPU result: %s", name, + U(claims), U(seat_acts), r->acceptor_live ? "started" : "not started", err, + U(field(r, r->living.o.input, 2)), U(field(r, r->living.o.input, 3)), why); + /* The two pre-goal dead ends behind "AIEN never confirmed the incumbent cost" (omega #527). + * Both start from wall-clock jitter; neither is a GPU failure, and neither can recover before + * the goal, so the 60 s wait only runs out. */ + uint64_t sel_real = field(r, r->omega.o.selection, 1), used = field(r, r->omega.o.demand, 6); + if (field(r, r->aien.o.goal, 0) == 0 && field(r, r->aien.o.prediction, 6) != RX_AIEN_PRED_CONFIRMED) { + if (sel != 0 && sel_real != used && field(r, r->living.o.inforce, 0) == 0) + both("R13 %s diagnosis: Omega's first search selected realization %016llx, but production serves " + "the in-force record (%016llx, the reference) and nothing can be promoted before the goal; " + "AIEN discards every interval as \"production has not switched yet\", so it can never " + "confirm. Not a GPU failure.", name, U(sel_real), U(used)); + else if (field(r, r->aien.o.prediction, 6) == RX_AIEN_PRED_FAILED && search != sel) + both("R13 %s diagnosis: AIEN's prediction failed before the goal (baseline %llu ns, observed " + "%llu ns); its %s plan opened Omega search %llu, which waits for GPU evidence while the seat " + "transport starts only with the goal, and the failed prediction is not relearned while its " + "hypothesis is under test, so it can never confirm. Not a GPU failure.", name, + U(field(r, r->aien.o.prediction, 5)), U(field(r, r->aien.o.prediction, 7)), + why_name(field(r, r->aien.o.plan, 5)), U(search)); + } +} + int main(int argc, char **argv) { signal(SIGPIPE, SIG_IGN); setvbuf(stdout, NULL, _IONBF, 0); @@ -2193,16 +2295,7 @@ int main(int argc, char **argv) { names[mode]); rc = -1; } - if (rc != 0 && rc != OP_SHUTDOWN) - fprintf(stderr, "R13 %s FAILED: plan %llu search %llu GPU %llu evidence %llu " - "belief %llu selection %llu candidate %llu promotion %llu in force %llu " - "result %d prepare refusal %d\n", names[mode], - U(field(r, r->aien.o.plan, 0)), U(field(r, r->omega.o.search, 0)), - U(field(r, r->living.o.output, 0)), U(field(r, r->living.o.evidence, 0)), - U(field(r, r->aien.o.experiment_belief, 0)), - U(field(r, r->omega.o.selection, 0)), U(field(r, r->living.o.candidate, 0)), - U(field(r, r->living.o.promotion, 0)), U(field(r, r->living.o.inforce, 0)), - r->promoter.result, r->living.last_refusal); + if (rc != 0 && rc != OP_SHUTDOWN) explain_failure(r, names[mode]); if (r->admin && r->view) stop(r); free(r); if (rc == OP_SHUTDOWN) {