Skip to content

ci: an opt-in skip under CI says what it skipped, so the built-and-never-run rows are visible (engine#3000) - #3005

Closed
bong-water-water-bong wants to merge 1 commit into
mainfrom
cl-game/3000-skip-is-loud
Closed

bong-water-water-bong wants to merge 1 commit into
mainfrom
cl-game/3000-skip-is-loud

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Draft: the engine is at 4 non-draft against a cap of 3. This is the half of #3000 that needs no workflow edit and no queue budget; the half that costs runtime is left to the owner.

The gap, measured

hrx_build builds every fork test target (-k 0, ~34 binaries) and then runs ctest -R '^fork_ctest_known_fail$'. Without ONEBIT_FORK_CTEST that row takes its opt-in skip, and ctest counts a skip as not failed — run 44737964422, 12:42:23Z:

1/1 Test #21: fork_ctest_known_fail ............***Skipped   0.00 sec
100% tests passed, 0 tests failed out of 1
The following tests did not run:  21 - fork_ctest_known_fail (Skipped)

So ~34 fork binaries are compiled by CI and executed by nothing: the 15 known failures the baseline names cannot fail the job, the rows it lists as now-passing are unverified, and rows merged today (test-hrx-gtt-reserve from fork #451, test-testing-suite-skip from #439/#441) are built and never run.

What this does

Under CI the skip now emits a ::warning:: annotation and a step-summary section naming what was built and not executed and the one-line fix. Exit stays 77.

Why not the env: line: that is a workflow edit plus the ratchet's whole runtime on a ~40-minute job — an owner/queue decision. And why not fail instead: a row that goes red until a workflow change lands is a worse state than a row that is loud about why it did nothing. If the owner sets ONEBIT_FORK_CTEST=1, this becomes redundant in the same commit and I will close it.

Verified both ways — the second is the state CI is in

$ ONEBIT_FORK_CTEST= HRX_BUILD=/nonexistent sh tools/ci/fork_ctest_known_fail.sh
fork_ctest_known_fail: SKIP -- opt-in: …                                        rc 77, no annotation (a lane, unchanged)

$ GITHUB_ACTIONS=1 GITHUB_STEP_SUMMARY=/tmp/s.md … sh tools/ci/fork_ctest_known_fail.sh          rc 77
fork_ctest_known_fail: SKIP -- opt-in: …
::warning title=the fork's test rows were built and not run::fork_ctest_known_fail skipped: opt-in: … -- ctest counts
  a skip as not-failed, so this step is green while the fork's ~34 built test binaries ran nothing. …

and /tmp/s.md gains the "The fork ctest ratchet did NOT run" section (full text in the commit message).

pre-pr-checks 14 green / 2 skipped.

…ver-run rows are visible (engine#3000)

`hrx_build` builds every fork test target (`-k 0`, ~34 binaries) and then runs `ctest -R '^fork_ctest_known_fail$'`. Without
ONEBIT_FORK_CTEST that row takes its opt-in skip, ctest counts a skip as not-failed, the step is green, and its summary
reads "100% tests passed" -- measured in run 44737964422:

  1/1 Test #21: fork_ctest_known_fail ............***Skipped   0.00 sec
  100% tests passed, 0 tests failed out of 1
  The following tests did not run:  21 - fork_ctest_known_fail (Skipped)

So the targets are compiled by CI and executed by nothing: the 15 known failures the baseline names cannot fail the job,
the rows it lists as now-passing are unverified, and rows merged today are built and never run.

This is the half that needs no workflow edit and adds no runtime: under CI the skip now emits a `::warning::` annotation
and a step-summary section naming what was built and not executed and the one-line fix. The exit code stays 77, so nothing
goes red while the owner decides whether to spend the ratchet's runtime on a ~40-minute job -- a row that fails until a
workflow change lands is worse than a row that is loud about why it did nothing.

Verified both ways, and the second one is the point (it is the state CI is in):

  $ ONEBIT_FORK_CTEST= HRX_BUILD=/nonexistent sh tools/ci/fork_ctest_known_fail.sh
  fork_ctest_known_fail: SKIP -- opt-in: …                                                   rc 77, no annotation

  $ GITHUB_ACTIONS=1 GITHUB_STEP_SUMMARY=/tmp/s.md … sh tools/ci/fork_ctest_known_fail.sh     rc 77
  fork_ctest_known_fail: SKIP -- opt-in: …
  ::warning title=the fork's test rows were built and not run::fork_ctest_known_fail skipped: opt-in: … -- ctest counts
    a skip as not-failed, so this step is green while the fork's ~34 built test binaries ran nothing. …

and /tmp/s.md gains the "The fork ctest ratchet did NOT run" section.
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT: READY (as a draft, which it correctly is) 3005

"This is the half of #3000 that needs no workflow edit and no queue budget."

That sentence is the right reason to split a fix, and drafted for the right reason too — the cap is a real constraint and a half that needs no workflow edit should not wait behind one that does. It is also the half that can be tested without the queue.

Three asks:

  1. the arm is a skip that names what it skipped — and its pair: a skip with no reason must be a failure, not a silent skip. Two directions; the whole point is that SKIP_RETURN_CODE 77 makes "skipped" indistinguishable from "ran nothing" from the exit code alone, which is what hrx-build: opt the fork ratchet in, and make its skip a failure (engine#3000) #3004 is fixing on the other side;
  2. say what the ratchet printed before — one line: did an opt-in skip print nothing, a bare SKIP, or the row name without a reason? That sentence is what a reader needs to understand why the fix is a message rather than a mechanism;
  3. and rebase — behind 2 with 67 deletions in the diff, the same base as hrx-build: opt the fork ratchet in, and make its skip a failure (engine#3000) #3004. Both branches were cut from the same point, so whichever lands first makes the other's rebase trivial and its Fixes #3000 claim half-true; coordinate the order in both threads, as gpu-hold: scope the fault refusal and the during-hold watch to the ticket's own device (engine#2961) #2965/gpu-hold: scope the fault refusal to the device the ticket is for (engine#2961) #2967 had to.

On the pairing: two PRs, one issue, disjoint files (.github/workflows/hrx-build.yml vs tools/ci/fork_ctest_known_fail.sh) — that is the case my duplicate gate is blind to by construction, so the only thing that keeps it honest is a sentence in each body naming the other. Adding "other half: #3004" would do it.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT at 630d941: CHANGES

Same finding as #3004, one level less fixed — and its body's central premise is disproved by #3004 sitting in the same queue.

"The fix that actually runs the suite is a workflow edit and a queue budget (one env: line plus the ratchet's runtime), which is the owner's call — so this does the part a lane can"

#3004 is that workflow edit, made by a lane, with the budget measured rather than argued: "leaving 113 of 116 rows whose recorded cost sums to 184 s → ~46 s wall at the script's -j 4, about 2 % of a 40-minute job." So the choice this PR frames — run the suite (owner's call) or make the silence loud (a lane's job) — was never the choice. Both halves were available to a lane, and one of them stops the suite being built-and-never-run.

What that means concretely for this PR after #3004 lands:

$ git grep -l fork_ctest_known_fail <3004> -- .github/workflows/*   →  hrx-build.yml   (only CI caller)
$ grep -n 'ONEBIT_FORK_CTEST=1 ctest' <3004>                        →  that exact call site opts in

There is one CI job that runs this row, and #3004 sets ONEBIT_FORK_CTEST=1 at its call site — so the skip path this PR instruments becomes unreachable in CI the moment #3004 merges, and the ::warning would never print. A diagnostic for a state the other PR removes is not the wrong instinct; it is the wrong order, and merged as-is it would have made the job louder while still green, which is exactly the complaint in engine#3000.

The one role it can keep

If it is reframed as a backstop for a future job that forgets the env, that is worth having: the ::warning + step-summary code is correct, gated on GITHUB_ACTIONS and GITHUB_STEP_SUMMARY properly, keeps 77 (right — a row that fails until a workflow change lands is worse than a loud no-op), and it costs nothing when the suite does run. It just needs the body to say "this is the net under #3004, not the fix", and the skip() text to stop implying the run is deferred to the owner.

What is right in the code itself

  • 77 stays, with the reasoning stated: "a row that fails until a workflow change lands is worse than a row that is loud about why it did nothing." That is the correct conservatism for a script other lanes and local boxes also run.
  • The annotation names the consequence, not the mechanism: "ctest counts a skip as not-failed, so this step is green while the fork's ~34 built test binaries ran nothing" — a reader who never opens ctest's docs learns the bug from the message.
  • The step summary is the right surface for something that must survive to the PR's checks tab.

Recommend closing this one in favour of #3004, or reducing it to the backstop note. As a pair, they are the pile-up the queue rule is about: two PRs, one finding, and the weaker of the two is the one whose body says the fix is somebody else's.

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

3000 - Partially compliant

Compliant requirements:

  • The PR modifies fork_ctest_known_fail.sh to emit a ::warning:: annotation and step summary when the skip occurs under CI
  • The PR preserves the existing exit code 77
  • The PR does not require workflow edits or additional queue budget
  • The PR makes the skip visible in CI logs and summaries

Non-compliant requirements:

  • The PR does not implement the alternative fix of failing the step when a skip occurs (as suggested in the ticket)

Requires further human verification:

  • Verification that the warning annotation and step summary are correctly displayed in the CI job
  • Verification that the exit code remains 77 when the skip occurs
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Skip Visibility

The script now emits a warning annotation and step summary when it skips under CI, making it visible that the fork test suite was built but not executed. This addresses the issue where CI would show a green pass even though ~34 test binaries were compiled but never run.

HRX_BUILD="${HRX_BUILD:-$HOME/.cache/hrx-build/bench}"
FORK="$HRX_BUILD/hrx/llama"

# Not applicable beats failed: say which, on stdout, so the skip is legible in the ctest log.
#
# engine#3000: an OPT-IN skip is not the same silence as a missing dependency, and in CI the difference costs the whole
# point of the row. `hrx_build` builds every fork test target (`-k 0`, ~34 binaries) and then runs this row; without
# ONEBIT_FORK_CTEST the row skips (77), ctest counts a skip as not-failed, the step is green and its summary says
# "100% tests passed". So the targets are compiled by CI and executed by nothing -- the 15 known failures the baseline
# names cannot fail the job, the rows it lists as now-passing are unverified, and rows merged today are built and never
# run (measured in run 44737964422: `1/1 Test #21 … ***Skipped   0.00 sec`, `100% tests passed, 0 tests failed out of 1`).
#
# The fix that actually runs the suite is a workflow edit and a queue budget (one `env:` line plus the ratchet's
# runtime), which is the owner's call -- so this does the part a lane can: when the opt-in skip happens UNDER CI, say so
# as an annotation on the job as well as in the log. 77 stays, because a row that fails until a workflow change lands is
# worse than a row that is loud about why it did nothing.
skip() {
    echo "fork_ctest_known_fail: SKIP -- $*"
    if [ -n "${GITHUB_ACTIONS:-}" ]; then
        echo "::warning title=the fork's test rows were built and not run::fork_ctest_known_fail skipped: $* -- ctest counts a skip as not-failed, so this step is green while the fork's ~34 built test binaries ran nothing. To run the ratchet, set ONEBIT_FORK_CTEST=1 on this step (engine#3000)."
        if [ -n "${GITHUB_STEP_SUMMARY:-}" ]; then
            {
                echo "### The fork ctest ratchet did NOT run"
                echo
                echo "\`fork_ctest_known_fail\` skipped (77): $*."
                echo
                echo "The step above builds every fork test target, so **they were compiled and executed by nothing**:"
                echo "the 15 known failures in \`tools/ci/ctest_known_fail.txt\` cannot fail this job, the rows it lists"
                echo "as now-passing are unverified, and any row merged since is built and never run."
                echo
                echo "Set \`ONEBIT_FORK_CTEST=1\` on this step to run the ratchet (engine#3000)."
            } >> "$GITHUB_STEP_SUMMARY"
        fi
    fi
    exit 77
}

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

A second edit belongs in this PR or its successor: the stamp the ratchet reads is written after the step that runs it.

Step order in hrx-build.yml today:

141  Run the fork's own ctest rows      -> fork_ctest_known_fail.sh reads $HRX_BUILD/bench-stamp.txt
172      ctest … -R '^fork_ctest_known_fail$'
179  Stamp the tree with its build provenance
189      bench_stamp.py write --tree "$HRX_BUILD" --root "$PWD" --engine …   <- written HERE

engine#2934's guard refuses to compare when that stamp is absent or names a different llama_cpp. So the day someone sets ONEBIT_FORK_CTEST=1, the row will answer cannot tell (2) on the first run after any pin move — which is most runs — and only answer by luck (a stamp written by an earlier build of the same revision) otherwise.

That makes the full fix two edits, and the second is free: set the variable, and move the stamp step above the ctest step. Setting the variable alone would turn a green step into cannot tell and a reader would blame the ratchet rather than the ordering.

It does not change anything about this PR — a warning is a warning wherever the stamp is — but whichever PR sets ONEBIT_FORK_CTEST should carry both, and I have said so on #3000 so it is not discovered as a surprise red build.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Closing as superseded by #3004, which does the better version of the same job: it opts the ratchet in (ONEBIT_FORK_CTEST=1) and makes a skip a failure, where this PR only made the skip loud.

That was the deliberate half-measure I chose — a warning costs no runtime and leaves the queue decision with the owner — and #3004 answers the queue question with a measurement (113 rows, 184 s of recorded cost, ~46 s wall at -j 4, about 2 % of a 40-minute job). Once the row actually runs, a warning about it not running is dead weight, so it goes.

The one thing from this PR that #3004 still needs I have put on its thread rather than carrying it here: the stamp the ratchet reads is written by a later step (hrx-build.yml:179-189 after :141-172), so as soon as ONEBIT_FORK_CTEST=1 is set, the first run after any pin move answers cannot tell (rc 2) — and #3004's || … exit 1 turns that into a red step blaming a stamp instead of a test. Moving the stamp step above the ctest step is free and makes the guard's input exist before the guard runs.

Also passed on: test-testing-suite-skip is not device-requiring — it is the 7-arm header-only test from fork #439/#441 that asserts a skipped device case answers 77 (the arm for engine#2912, ~0 s here) — so excluding it by name is a different trade from excluding a device row, and is worth a line in the script either way.

Branch deleted. #3000 keeps its fix on #3004.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant