Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/hw-gate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -631,11 +631,11 @@ fi

# ---- kat + needle + KLD: one step per model -----------------------------------------------
if has kat || has needle || has kld; then
[ -f "$TEXT" ] || { has kld && { result kld FAIL 0 "text missing: $TEXT"; infra=1; }; }
[ -f "$TEXT" ] || { has kld && { result kld SKIP 0 "text missing (input absent): $TEXT"; infra=1; }; }
while IFS='|' read -r name file repeat donee srvargs; do
want_model "$name" || continue
model=$MODELS/$file base=$STORE/kld/$name.kld
if [ ! -f "$model" ]; then result "model $name" FAIL 0 "model missing: $model"; infra=1; continue; fi
if [ ! -f "$model" ]; then result "model $name" SKIP 0 "model missing (input absent): $model"; infra=1; continue; fi
dokat=0; has kat && dokat=1
needle=0; [ "$donee" = 1 ] && has needle && needle=1
dokld=0; has kld && [ -f "$TEXT" ] && [ -z "$srvargs" ] && dokld=1
Expand Down
16 changes: 16 additions & 0 deletions tests/hw_gate_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,22 @@ def script_invariants():
npu = src.find("if has npu;")
if npu < 0 or "flock" not in src[npu:]:
bad.append("the NPU phase must still hold ~/npu.lock: an NPU dispatch must not overlap another")
# engine#2501: an absent INPUT is a SKIP row, not a FAIL row. The exit code already said so
# (infra=1 -> exit 2), but the row is what a human reads, and it said FAIL on something nobody can
# fix -- so every PR went red on main's own pin. A `sed` over all three FAILs would also flip the
# KLD row, and that one is a RESULT: asserted below to stay FAIL.
for absent in ('"model missing', '"text missing'):
i = src.find(absent)
if i < 0: # renamed or removed: fail rather than pass over nothing
bad.append(f"no {absent} row found: the absent-input rows must exist and be SKIP")
continue
line = src[src.rfind(chr(10), 0, i) + 1:src.find(chr(10), i)]
if " SKIP " not in line:
bad.append(f"{absent} must be SKIP, not FAIL: an absent input is not a result (engine#2501)")
if "infra=1" not in line: # SKIP alone would let "ran nothing" look like "all passed"
bad.append(f"{absent} must keep infra=1, so a run with no inputs still exits 2")
if src.find('result "kld $name" FAIL') < 0:
bad.append("the KLD mismatch row must stay FAIL: a verify mismatch is a result, not an absent input")
return bad


Expand Down
Loading