From fa5c8929d9c442889ffb03253277e211c2505221 Mon Sep 17 00:00:00 2001 From: Aizat Hawari Date: Sat, 28 Nov 2026 02:39:47 +0000 Subject: [PATCH 1/2] fix(exp35): a contrast term with no saved setup enters no question Found on the 2026-11-28 freeze-check output: reporttables35 crashed with a ZeroDivisionError in cells35.contrast when a row's term matched no saved setup (one answer setup only). The docstring rule already says a question enters only when every cell has a value; the code now follows it. --- experiments/35-full-rag-benchmark-2026-11-01/cells35.py | 7 ++++++- tests/test_clean_base_tripwire.py | 3 ++- tests/test_experiment35_factorial.py | 8 ++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/experiments/35-full-rag-benchmark-2026-11-01/cells35.py b/experiments/35-full-rag-benchmark-2026-11-01/cells35.py index b70279661..ffdbc4ae5 100644 --- a/experiments/35-full-rag-benchmark-2026-11-01/cells35.py +++ b/experiments/35-full-rag-benchmark-2026-11-01/cells35.py @@ -105,7 +105,12 @@ def contrast( every = set().union(*(cells[s] for s in setups)) if setups else set() if questions is not None: every = set(questions) - entered = [q for q in sorted(every) if all(q in cells[s] for s in used)] + # A term with no saved setup has no cell, so no question enters (no division by zero). + entered = ( + [q for q in sorted(every) if all(q in cells[s] for s in used)] + if all(match for _, match in terms) + else [] + ) d = { q: math.fsum(c * math.fsum(cells[s][q] for s in m) / len(m) for c, m in terms) for q in entered diff --git a/tests/test_clean_base_tripwire.py b/tests/test_clean_base_tripwire.py index 484d77ba3..f636a1670 100644 --- a/tests/test_clean_base_tripwire.py +++ b/tests/test_clean_base_tripwire.py @@ -567,7 +567,8 @@ # +13 (2026-11-27, task 16.20 and PR 239 review, by test-ID diff against v3 987a21be): # 9 in test_experiment35_hosted_usage, 2 in test_experiment35_run_arms, 1 in # test_experiment35_claimstage and 1 in test_experiment35_parallel_answers. -_BASE_EXECUTED = 14511 +# +1 (2026-11-28, freeze-check finding, by test-ID diff): 1 in test_experiment35_factorial. +_BASE_EXECUTED = 14512 # Re-baselined check-embedding-stamp-before-dimension (2026-10-18): 10 new cases # (store stamp-first tests and graph embed-step tests). Measured in two clean # venvs: 5741 with the web extra, 5091 without; the web extra still adds 650. diff --git a/tests/test_experiment35_factorial.py b/tests/test_experiment35_factorial.py index 5e892b3e9..e276b6b48 100644 --- a/tests/test_experiment35_factorial.py +++ b/tests/test_experiment35_factorial.py @@ -489,3 +489,11 @@ def test_confirmatory_result_applies_the_gate_rows(tmp_path) -> None: "financebench": [12, 13], "freshstack": [12, 13, 14], } + + +def test_a_term_with_no_saved_setup_enters_no_question() -> None: + # Only one answer setup saved: row 12's other cell has no setup, so no question enters. + one = "e4b-c1024-r0.6b-hon" + cells = {one: {"q0": 0.5, "q1": 0.7}} + d, excluded = factorial35.contrast(factorial35.ROWS[11], cells) + assert d == {} and excluded == 2 From ef12c273a0673e0488b72b1188a4622b20871c1b Mon Sep 17 00:00:00 2001 From: Aizat Hawari Date: Sat, 28 Nov 2026 08:42:33 +0000 Subject: [PATCH 2/2] test(exp35): give the timed-out stage 3 s so Python starts before SIGABRT Failed once on ubuntu-latest (PR 240): a 1 s stage timeout can fire before the Python process installs faulthandler on a loaded runner, so no stack prints. --- .../prefreeze/test_pod_test_session_script.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/experiments/35-full-rag-benchmark-2026-11-01/prefreeze/test_pod_test_session_script.py b/experiments/35-full-rag-benchmark-2026-11-01/prefreeze/test_pod_test_session_script.py index 8d6b8043f..62f794bab 100644 --- a/experiments/35-full-rag-benchmark-2026-11-01/prefreeze/test_pod_test_session_script.py +++ b/experiments/35-full-rag-benchmark-2026-11-01/prefreeze/test_pod_test_session_script.py @@ -444,6 +444,8 @@ def test_a_timed_out_stage_leaves_a_python_stack_in_the_log(tmp_path: Path) -> N def test_a_timed_out_foreground_python_stage_leaves_its_stack_in_the_log(tmp_path: Path) -> None: # A plain stage that ends at SIGTERM prints nothing, so the first signal must be SIGABRT. - result, _ = _run(tmp_path, 'slow@1s python3 -c "import time; time.sleep(40)"\n') + # 3 s, not 1 s: on a loaded CI runner Python may not have started within 1 s, and a + # signal before start-up prints no stack (failed once on ubuntu-latest, PR 240). + result, _ = _run(tmp_path, 'slow@3s python3 -c "import time; time.sleep(40)"\n') assert result.returncode == 1 assert "most recent call first" in result.stdout + result.stderr