From 9f7e8c064f2d3a266bad1d306142802007de359d Mon Sep 17 00:00:00 2001 From: agent Date: Sun, 15 Nov 2026 08:51:19 -0400 Subject: [PATCH] hw-gate: the ops zero-cases SKIP is an input not tested (infra=1), and placement is not a per-model phase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Answers the CHANGES at `9dd6077` on #2523, both points. **1. `infra=1` on the ops zero-cases SKIP.** The zero-cases guard refuses to report a pass when nothing matched, but the gate still did: the verdict logic consults `infra` only for a PASS, so a SKIP row without the flag produced `## HRX hardware gate: PASS` and exit 0 over a run that tested nothing. Engine#2522 set the flag for absent inputs; this is the same rule for the third case — the filter matched no case. result ops SKIP ... "no case matched ... refused to report a pass ..." infra=1 **2. `placement` is not a per-model phase.** The comment and the code contradicted each other in adjacent lines: the `^($_ph|model )` alternative exists because kat/kld/needle report missing models as `model ` rows, but `placement` writes `placement ` (hw-gate.sh:696). Accepting a `model ` row for a `placement` request re-opens exactly the hole this PR closes — a run that asked about placement and matched somebody else's row. case "$_ph" in kat|kld|needle) _phre="^($_ph|model )" ;; placement) _phre="^placement" ;; *) _phre="^$_ph" ;; esac Verified against the script's own code rather than a copy (both snippets extracted from `scripts/hw-gate.sh` and driven with synthetic rows): placement request + `placement handoff` row -> 0 rows appended (correct pass) placement request + only a `model x` row -> 1 FAIL appended (would have passed before this fix) build,placement with only a `build` row -> 1 FAIL appended verdict: nfail/infra 0/0 PASS · 0/1 INCOMPLETE · 2/1 FAIL (2) · 2/0 FAIL (2) `bash -n scripts/hw-gate.sh` clean. Not caused by this branch, for the record: the failing `hybrid_route` test starts a real server with a **1-second** hybrid-prefill grace window (`ONEBIT_HYBRID_PREFILL_TIMEOUT_S=1`, "a provider that finished inside its grace window") and does not read `hw-gate.sh` at all, while this PR touches nothing but that script. It is a timing-sensitive test on a shared runner — worth a re-run rather than a code change. --- scripts/hw-gate.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/hw-gate.sh b/scripts/hw-gate.sh index a6abe5e69..2a5354f13 100755 --- a/scripts/hw-gate.sh +++ b/scripts/hw-gate.sh @@ -589,7 +589,10 @@ if has ops; then # pass". That is a *filter* problem, not a kernel result - and it must never read as a pass either. # Report it as SKIP with the selection that produced it, so neither an empty run nor a broken filter # can be mistaken for a measured one. + # An input that was not tested is not a pass (engine#2522 set the same flag for absent inputs): the + # zero-cases guard refused to report a PASS, so neither may the gate. result ops SKIP $(( $(date +%s) - t0 )) "no case matched -b HRX0 -o \"$OPS\": the zero-cases guard refused to report a pass (fork engine#657) - fix the filter or the build" + infra=1 else unknown=$(printf '%s\n' "$fails" | grep -v -F "$FLAKY_CASES" | grep -c . || true) st=FAIL detail="${passed:-rc=$rc}: $(printf '%s' "$fails" | head -n 3 | tr '\n' ' ')" @@ -805,11 +808,13 @@ total=$(( $(date +%s) - START )) # command line has to appear as a row (PASS, FAIL, SKIP, or a `model …` row), or the gate says so by name. for _ph in $(printf '%s' "$PHASES" | tr ',' ' '); do case "$_ph" in ''|*' '*) continue ;; esac - # The per-model phases report their missing/throttled models as a `model ` row, so that row satisfies the - # request for any of them; only a phase that produced NO row at all is a slip. + # The per-model phases (kat/kld/needle) report their missing/throttled models as a `model ` row, so that row + # satisfies the request for any of them; only a phase that produced NO row at all is a slip. `placement` is NOT one + # of those: it writes `placement ` rows, so it matches on its own name only. case "$_ph" in - placement|kat|kld|needle) _phre="^($_ph|model )" ;; - *) _phre="^$_ph" ;; + kat|kld|needle) _phre="^($_ph|model )" ;; + placement) _phre="^placement" ;; + *) _phre="^$_ph" ;; esac grep -qE "$_phre" "$RESULTS" 2>/dev/null || printf '%s\tFAIL\t0\trequested but produced no result row: --phases %s ran nothing for it\n' "$_ph" "$_ph" >> "$RESULTS"