Skip to content

Commit 4a01bfa

Browse files
committed
W32: gate_phoenix.sh --wiring infra repair (Option A + B layered fix)
scripts/gate_phoenix.sh exited via pipefail in Step 3 (Phoenix Tests) before Step 4-6 ran in every invocation since the gate was added at D-1776714419: the Phoenix output's `Result: SUCCESS` literal could be absent (zero-test runs, format drift) so PHOENIX_RESULT misclassified clean runs as UNKNOWN, and the diagnostic FAILURES grep returned exit 1 on no-match, killing the script under `set -euo pipefail`. Step 6 wiring smoke had never run end-to-end. Empirical surface: docs/gates/cd5a1c50a0.log truncates after `Phoenix: 0 tests, 0/0 modules, Result: UNKNOWN` then `Phoenix FAILURES:` and nothing else. This commit applies both fixes from W32: Option B (semantic fix): drop the regex-on-output classification and use the test command's exit code as the canonical SUCCESS/FAIL signal. Bracket the test invocation with `set +e ... PHOENIX_EXIT=$? ... set -e` so the exit code is captured cleanly, and report it alongside RESULT for forensic traceability. Option A (defense-in-depth): wrap the FAILURES diagnostic grep in a `{ ... || true; }` block so a no-match exit no longer cascades through the pipeline and tee under pipefail. Together these unblock Step 4-6 and let the wiring smoke test actually run end-to-end for the first time. Per supervisor L2764 + theologian L2944 W32 spec § 3 Option C (layered fix recommended per W26 § 4b precedent). W32 doc-only companion already filed at docs/w32-gate-phoenix-wiring-repair.md. Verification deferred to testkeeper per lane split: induced-fault test (corrupt one of the 5 force_compile fns to trigger JIT_CHECK) + end-to-end run on cbb9453 push 101 known-PASS commit confirming Step 6 trailer `wiring smoke: PASS` lands in the gate log. The W32 doc § 4 calls out that without this triplet the gate is muted, not repaired.
1 parent 2325932 commit 4a01bfa

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

scripts/gate_phoenix.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,20 +225,33 @@ echo "JIT Smoke: PASS" | tee -a "$RESULTS_FILE"
225225
echo "" | tee -a "$RESULTS_FILE"
226226
echo "--- Step 3: Phoenix Tests ---" | tee -a "$RESULTS_FILE"
227227
PHOENIX_MODULES="test_phoenix_jit_arithmetic test_phoenix_jit_autocompile test_phoenix_jit_comparisons test_phoenix_jit_containers test_phoenix_jit_controlflow test_phoenix_jit_coverage test_phoenix_jit_functions test_phoenix_jit_generators test_phoenix_jit_inline_except_closure test_phoenix_jit_loadattr_golden test_phoenix_float test_phoenix_hir_type test_phoenix_profiling_hooks test_phoenix_deferred_compile test_phoenix_benchmark_correctness test_phoenix_usetype_float"
228-
PHOENIX_OUTPUT=$(JIT_ENABLE=1 ASAN_OPTIONS=detect_leaks=0 "$PYTHON" -m test $PHOENIX_MODULES 2>&1 || true)
228+
# W32 Option B: capture exit code as canonical SUCCESS/FAIL signal.
229+
# The output `Result: SUCCESS` literal can be missing (zero tests, format
230+
# drift) and previously misclassified clean runs as UNKNOWN. The exit
231+
# code is the authoritative signal.
232+
set +e
233+
PHOENIX_OUTPUT=$(JIT_ENABLE=1 ASAN_OPTIONS=detect_leaks=0 "$PYTHON" -m test $PHOENIX_MODULES 2>&1)
234+
PHOENIX_EXIT=$?
235+
set -e
229236

230237
PHOENIX_TOTAL=$(echo "$PHOENIX_OUTPUT" | grep -oP 'Total tests: run=\K[0-9]+' || echo 0)
231-
PHOENIX_RESULT=$(echo "$PHOENIX_OUTPUT" | grep -oP 'Result: \K\w+' || echo "UNKNOWN")
238+
if [ $PHOENIX_EXIT -eq 0 ]; then
239+
PHOENIX_RESULT="SUCCESS"
240+
else
241+
PHOENIX_RESULT="FAIL"
242+
fi
232243

233244
PHOENIX_MODULES_PASS=$(echo "$PHOENIX_OUTPUT" | grep -oP 'run=\K[0-9]+(?=/[0-9]+$)' | tail -1 || echo 0)
234245
PHOENIX_MODULES_TOTAL=$(echo "$PHOENIX_OUTPUT" | grep -oP 'run=[0-9]+/\K[0-9]+' | tail -1 || echo 0)
235246

236-
echo "Phoenix: $PHOENIX_TOTAL tests, $PHOENIX_MODULES_PASS/$PHOENIX_MODULES_TOTAL modules, Result: $PHOENIX_RESULT" | tee -a "$RESULTS_FILE"
247+
echo "Phoenix: $PHOENIX_TOTAL tests, $PHOENIX_MODULES_PASS/$PHOENIX_MODULES_TOTAL modules, Result: $PHOENIX_RESULT (exit=$PHOENIX_EXIT)" | tee -a "$RESULTS_FILE"
237248
if [ "$PHOENIX_RESULT" != "SUCCESS" ]; then
238249
GATE_PASS=0
239250
FAILURES="$FAILURES Phoenix:$PHOENIX_RESULT"
240251
echo "Phoenix FAILURES:" | tee -a "$RESULTS_FILE"
241-
echo "$PHOENIX_OUTPUT" | grep -E "FAIL|ERROR|CRASH|Assertion failed" | tee -a "$RESULTS_FILE"
252+
# W32 Option A: tolerate grep-no-match (pipefail would otherwise kill
253+
# the script before Step 4-6 ran).
254+
{ echo "$PHOENIX_OUTPUT" | grep -E "FAIL|ERROR|CRASH|Assertion failed" || true; } | tee -a "$RESULTS_FILE"
242255
fi
243256

244257
# Step 4: CPython test suite (parallel, JIT enabled)

0 commit comments

Comments
 (0)