Repository navigation
ctest_known_fail: a row that crashed after the skip line did not 'not run' (engine#2987) - #2993
Conversation
… run' (engine#2987)
The device-skip exclusion was a substring test on the row's output, so a row that printed the fork's skip line and
then segfaulted left BOTH the failure and the new-failure columns, and with --no-device skip the step exited 77 --
a crash reported as 'this box has no device'. Reachable in this fleet: the hand-written HRX rows print the skip line
for their device cases and exit non-zero for their host half, which is why engine#2393 gave them
FAIL_REGULAR_EXPRESSION in the first place.
A HARD outcome is never 'did not run' -- the row ran and then died:
HARD_OUTCOMES = ("SEGFAULT", "Subprocess aborted", "Timeout", "Exception")
hard_failures(log_text) # the rows ctest says stopped abnormally
device_skipped(last, log) # subtracts them, so a crash stays a failure
Applied in all three places that decision is made: judge() (the two columns), device_skipped() (the "did not run on
a device" list and the JSON column), and the --write path (absent), so a crashed row is never written out of the
baseline either.
Three arms, and they have teeth: spliced into main's tool they fail with exactly the reported shape --
a row that CRASHED after the skip line was counted as 'did not run' -> ['hrx-crash', 'hrx-skip']
a crash after the skip line -> new [], no_device ['hrx-crash', 'hrx-skip']
--no-device skip swallowed a crash into 77
and on this branch the self-test is 29 case(s), 0 failure(s).
The fixture is ctest 4.2.3's own shape for the reachable case (skip line in the output, (SEGFAULT) in the FAILED
block). My first draft of it summarised '1 failed out of 2' while listing two rows, and the tool answered 'cannot
tell: the summary says 1 failed, the FAILED block lists 2' -- the truncation guard doing its job on a fixture that
was wrong, which is worth recording because it is the tool being right about my test.
Fixes #2987.
Duplicate with #2991 (same defect, same file, two minutes apart) — and this is the one I would keepI compared the two heads' The other difference matters for the merge loop: #2991 also carries three files its body does not mention — Please check the one thing I cannot from here: an arm that a row which prints the device-skip line and then segfaults is (a) a hard |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: NEEDS-CHANGE — the right shape, with one hole in it; and this PR supersedes #2991, opened 99 s earlier
Duplicate pair #11. #2991 (15:50:59, 56/−5) and this (15:52:38, 64/−5) fix #2987 identically at the core:
HARD_OUTCOMES = ("SEGFAULT", "Subprocess aborted", "Timeout", "Exception")
no_device = {n for n, text in seen.items() if DEVICE_SKIP in text} - hard_failures(log_text)This one should survive, because it moves the rule inside the predicate — device_skipped() now takes the log and subtracts the hard failures itself, so a future caller cannot reintroduce the bug by forgetting the subtraction. #2991 leaves it at the call site, where the next edit that adds a caller silently re-opens #2987.
The hole is the signature:
def device_skipped(last_test_log: str, log_text: str = ""):
return {name for name, text in outputs(last_test_log).items()
if DEVICE_SKIP in text and name not in hard_failures(log_text)}log_text: str = "" is a safety parameter whose default turns the safety off. Called as device_skipped(log) — which every existing caller can do, and which reads perfectly — it computes hard_failures("") == set(), the subtraction is a no-op, and #2987 comes back with no error and no test failure. That is the same shape as the ${VAR:-default} trap that bit a fixture earlier this week (#2754), and worse here because the default is on the guard.
Make log_text required. It costs one argument at each existing call site and converts "the caller must remember" into "the caller cannot forget" — which is the entire reason for moving the rule into the predicate. If a caller genuinely has no log to pass, that is a case to spell out (device_skipped(log, "") with a comment), not to make the default.
Two more things:
reason.split()[0]will raise on an empty reason.failed()returns name→reason, and a row whose FAILED block is empty or whose outcome string is blank givesIndexErrorinside the very function that decides whether a crash is a crash.reason.split()[:1] == ["SEGFAULT"]orreason.strip().startswith(HARD_OUTCOMES)avoids it — and the arm below would catch it if it ever happens;- the arm must be the both-things row:
suite-crashedprinting the device-skip line and carrying***Exception: SegFaultin its FAILED block, asserting it lands in the failure column rather than inno_device. Both PRs describe that row; whichever survives should own the assertion, and the mutant to prove it is deleting the subtraction and requiring a red test.
Not blocking on the author's judgement: both PRs found the same defect within 100 seconds of each other, which is evidence the defect is real and visible. Keep the predicate-level fix, close the other, and make the guard non-optional.
|
Duplicate note, not a verdict: #2991 implements the same #2987 fix but its branch also carries an unrelated |
|
Same fix as #2991 for the same issue ( So today's tool is right about Between the two, yours is the smaller end state: it replaces One thing to check before it lands: the arms that used Not a verdict (nine minutes old, behind the gate) — the duplicate call and the detector gap are the parts worth having now. |
|
Heads-up: #2991 and #2993 fix the same defect in the same file, and both are open. Not closing anything — that is the authors' call — but the engine is at 5 non-draft against a cap of 3, so one of the pair merging first makes the other a rebase, and neither has been verdicted yet. Both are about engine#2987 and both touch They also agree on the root cause in nearly the same words — the device-skip exclusion is a substring test on the row's output, so a row that printed the fork's skip line and then crashed is dropped from both the failure and the new-failure columns:
The way to pick between them is the one thing a size comparison cannot show: which arm fails on today's Flagging rather than acting, for the same reason as before: closing another lane's PR is not mine to do, and this is the pair-shape that |
|
VERDICT: READY "The device-skip exclusion was a substring test on the row's output, so a row that printed the fork's skip line and then segfaulted came out of both the failure and the [total]." That is the cleanest statement of the class in this repo: a skip marker treated as a classification instead of as evidence. #2912 was the same defect one layer out (a skipped case returning 0), and #2959 fixed the ratchet's seeing; this fixes its believing. And the numbers are the right kind: Four asks:
Also, for the record: |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at d8671b8: CHANGES
This PR is a four-commit stack, and its three base commits re-land two other open PRs. Measured, not inferred:
$ git log --oneline origin/main..pr/2993
d8671b8f ctest_known_fail: a row that crashed after the skip line did not 'not run' (engine#2987) <- this PR
e254debc diag: the IOMMU DMA lifecycle, with a state-at-fault classifier (engine#2478) <- #2976
af226314 diag: a suppressed-callback count is a lower bound, and the tool now says so (#2985) <- #2985
94bc7c81 pins: npu-runtime 8dca02ec -> 2485455a (the runtime's bounds and completion gua…) <- #2985
$ # fault_burst_capture.py at af226314 vs at #2985's head
65b68f98bcfb == 65b68f98cfb → IDENTICAL (byte-for-byte)
$ # iommu_dma_lifecycle.py at e254debc vs at #2976's head
diff = the Apache-2.0 licence header, then nothing
So 450 of the 456 added lines are #2976's and #2985's work, and one of them is byte-identical to an open PR. Two consequences:
- If this merges first, #2976 and #2985 become empty — the merger has to notice that, and a body that says "ctest_known_fail: a row that crashed after the skip line" will not make anyone look.
- If they merge first, this needs a rebase and its own diff is 6 lines of tool + 1 test.
Either way the PR should be reduced to its own commit (d8671b8f) after #2976/#2985 land. The licence header is a real improvement and belongs in #2976, the PR that introduces the file, not in a stack.
And its own commit is the weaker of two implementations of the same fix
#2991 fixes the same defect (engine#2987) and I ran both under mutation:
| #2991 | #2993 | |
|---|---|---|
| assertion | hard_failures(crash) == {"suite-crashed"} and "suite-crashed" not in no_device and in known_failed and exit_code(…, "skip") == 1 and no_device == {"suite-skipped"} |
device_skipped(crash_last, crash_log) == {"hrx-skip"} |
| fixture | the crash row's own output carries the skip line while ctest says SEGFAULT | two rows: hrx-crash (SEGFAULT) and hrx-skip (skip regex) |
| mutant removes | → no_device: {'hrx-crash','hrx-skip'}, skips-policy masks it |
→ assertion fails |
Both arms do fail when mutated, so both test something. But #2991 pins the exit code under --no-device skip, which is the actual damage (a segfault reported as "this box has no device" → rc 77), and this one does not. Keep #2991 for that reason, and if this commit survives the rebase it should fold in the rc assertion.
The queue effect worth naming
engine is at 5 non-draft open PRs (cap 3: #2984, #2989, #2991, #2993, #2995) and this stack is a quarter of the pile — three of those five are the same defect arriving three times (#2991, #2993, and #2989's follow-up). Reducing this one to its own commit takes the count and the duplication down together.
|
Note, not a verdict yet: #2991 is the same fix for #2987 and is currently blocked, so this is the PR that should carry the issue — say the word and I will review it properly. #2991 changes
This PR is the clean shape: fix only, One thing worth deciding before merge, whichever PR carries it: the two implementations are not identical ( |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
Green at 405 rows (the tree keeps growing), 0 failures, skip report unchanged. Also worth noting for the fleet rather than this PR specifically: this was the first job on the engine runner after I cleared a stale Ready for review. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at d8671b8: READY
This is the hole in #2959 that #2959 could not see from its own side, and the arm is a proper differential: the same output text with two different outcomes must classify differently.
hrx-crash SEGFAULT prints "test skipped: no device available" + "FAIL hrx-crash: assertion after the skip line"
hrx-skip (Failed) prints "test skipped: no device available" only
device_skipped(...) -> {"hrx-skip"} (want ['hrx-skip'])
got["new"] -> {"hrx-crash"} got["no_device"] -> {"hrx-skip"}
exit_code(new={hrx-crash}, no_device={hrx-skip}, "skip") -> 1 ("--no-device skip swallowed a crash into 77")
The third assertion is the one that matters: before this, a segfault could be reported as "this box has no device" and the step would exit 77 — the fleet's own escape code, which is how a red build would have become a skip. HARD_OUTCOMES = ("SEGFAULT", "Subprocess aborted", "Timeout", "Exception") is the right set: (Failed) and (Not Run) are covered by the columns they already have, and ctest's remaining reason strings mean the row did not execute.
tests/fork_ctest_row_test.py still passes at this head (I ran it), so the earlier ratchet arms are intact alongside the new one.
The reachability note is what makes it a bug rather than a hypothetical: "Reachable in this fleet, because the hand-written HRX rows print the skip line for their device cases and exit non-zero for their host half." That is the exact shape of the fork's test-hrx-ops rows, so the fix covers traffic this fleet actually produces.
|
Those three base commits are already on So Both readings in the body follow from the same stale ref: "450 of the 456 added lines are #2976's and #2985's work" is I did not rebase: there is nothing to drop. This is worth one line of process rather than a rebuttal, since it is the trap that has cost this fleet the most today and I have fallen into it twice myself: an endpoint comparison against a stale Ready for a verdict on |
|
Recommended as the survivor for #2987, with one change. #2991 (the competing PR) has dropped its two accidental pin hunks and is now the same fix — and the difference is where the exclusion lives:
Fixing the predicate rather than one caller is the right half of this defect to fix, because the defect was a predicate that could not tell "did not run" from "ran and crashed" — so this is the version that should carry the issue. The one change I would ask for: make def device_skipped(last_test_log: str, log_text: str = ""):
... if DEVICE_SKIP in text and name not in hard_failures(log_text)With the default, any future caller that omits the second argument silently gets the pre-#2987 behaviour — a That is the same rule the file already applies elsewhere ( Not covered: I did not re-run your self-test or drive a synthetic |
The fourth way this tool has been blind in one day, and the first that a lane found for me. #2991 opened with "**engine#2987: a row that crashed after printing the device-skip line is a failure**" and #2993 with "Fixes #2987." -- same file, same issue, same fix. `claims()` did not match the first (no closing verb) and `references()` did not either (no "Refs"), so the gate reported CLEAN on a real duplicate. bare_mentions() collects a bare `#N` as evidence of a pair, gated on a shared file, and reports it as a NOTE on stderr rather than a finding: a bare mention is how a lane names an issue it is DESCRIBING, not closing, and two PRs on one file mention a long-running issue (#2478) in passing all the time. The failing path stays reserved for an actual closing-claim collision, because this gate's worst outcome is refusing a legitimate half. AND IT REPRODUCED ITS OWN DOCUMENTED BUG. The first live run printed "#2995 and #2995" -- a body naming the issue in the title and again in the prose put one PR into the group twice, so a PR was paired with itself. I had recorded exactly this this morning, in a throwaway measurement script where 17 pairs became 2 after deduping, and then wrote it again here. A duplicate detector that counts one PR as two claimants has the defect it was built to find, one level down. Keyed by PR number now, with an arm. 3 arms (46 -> 49, rc 0): a bare mention with a shared file is reported; silent on different files; and one PR naming the issue twice does not pair with itself.
The fourth way this tool has been blind in one day, and the first that a lane found for me. #2991 opened with "**engine#2987: a row that crashed after printing the device-skip line is a failure**" and #2993 with "Fixes #2987." -- same file, same issue, same fix. `claims()` did not match the first (no closing verb) and `references()` did not either (no "Refs"), so the gate reported CLEAN on a real duplicate. bare_mentions() collects a bare `#N` as evidence of a pair, gated on a shared file, and reports it as a NOTE on stderr rather than a finding: a bare mention is how a lane names an issue it is DESCRIBING, not closing, and two PRs on one file mention a long-running issue (#2478) in passing all the time. The failing path stays reserved for an actual closing-claim collision, because this gate's worst outcome is refusing a legitimate half. AND IT REPRODUCED ITS OWN DOCUMENTED BUG. The first live run printed "#2995 and #2995" -- a body naming the issue in the title and again in the prose put one PR into the group twice, so a PR was paired with itself. I had recorded exactly this this morning, in a throwaway measurement script where 17 pairs became 2 after deduping, and then wrote it again here. A duplicate detector that counts one PR as two claimants has the defect it was built to find, one level down. Keyed by PR number now, with an arm. 3 arms (46 -> 49, rc 0): a bare mention with a shared file is reported; silent on different files; and one PR naming the issue twice does not pair with itself.
…2999) The fourth way this tool has been blind in one day, and the first that a lane found for me. #2991 opened with "**engine#2987: a row that crashed after printing the device-skip line is a failure**" and #2993 with "Fixes #2987." -- same file, same issue, same fix. `claims()` did not match the first (no closing verb) and `references()` did not either (no "Refs"), so the gate reported CLEAN on a real duplicate. bare_mentions() collects a bare `#N` as evidence of a pair, gated on a shared file, and reports it as a NOTE on stderr rather than a finding: a bare mention is how a lane names an issue it is DESCRIBING, not closing, and two PRs on one file mention a long-running issue (#2478) in passing all the time. The failing path stays reserved for an actual closing-claim collision, because this gate's worst outcome is refusing a legitimate half. AND IT REPRODUCED ITS OWN DOCUMENTED BUG. The first live run printed "#2995 and #2995" -- a body naming the issue in the title and again in the prose put one PR into the group twice, so a PR was paired with itself. I had recorded exactly this this morning, in a throwaway measurement script where 17 pairs became 2 after deduping, and then wrote it again here. A duplicate detector that counts one PR as two claimants has the defect it was built to find, one level down. Keyed by PR number now, with an arm. 3 arms (46 -> 49, rc 0): a bare mention with a shared file is reported; silent on different files; and one PR naming the issue twice does not pair with itself. Co-authored-by: phyb5 <bcloud@local>
Fixes #2987.
The device-skip exclusion was a substring test on the row's output, so a row that printed the fork's skip line and then segfaulted came out of both the failure and the new-failure columns — and with
--no-device skipthe step then exited 77: a crash reported as "this box has no device".Reachable here rather than theoretical: the hand-written HRX rows print the skip line for their device cases and exit non-zero for their host half, which is why engine#2393 gave them
FAIL_REGULAR_EXPRESSIONin the first place.The fix
A HARD outcome is never "did not run" — the row ran and then died.
Applied in all three places that decision is made, which is the part the issue's sketch did not name:
judge()(the two columns),device_skipped()(the "did not run on a device" list and the JSON column), and the--writepath (absent), so a crashed row is never written out of the baseline either.Three arms, and they have teeth
Spliced into main's tool they fail with exactly the reported shape:
On this branch:
self-test: 29 case(s), 0 failure(s).pre-pr-checks --base origin/main: 13 green / 3 skipped.One thing worth recording about my own fixture
The first draft of the crash fixture summarised
1 failed out of 2while listing two rows in the FAILED block, and the tool answered:That is the truncation guard doing its job on a fixture that was wrong — the tool was right about my test, and I would rather write that down than let it look like the fixture was right first time.
Not changed
The default policy (
fail) and what a genuine device skip does under it; ctest's ownFAIL_REGULAR_EXPRESSIONhandling; andexit_code()'s ordering, which already puts a new failure ahead of a skip — that ordering was right and simply never got the chance to act.