Skip to content

test(smoketest): stop reporting a skipped or never-launched example as a full PASS - #665

Merged
nihalpasham merged 1 commit into
NVIDIA:mainfrom
vyncint:fix/smoketest-skipped-and-no-launch-verdicts
Aug 6, 2026
Merged

nihalpasham merged 1 commit into
NVIDIA:mainfrom
vyncint:fix/smoketest-skipped-and-no-launch-verdicts

Conversation

@vyncint

@vyncint vyncint commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #656. This is the smoketest.sh half of that issue; #658 fixed the example-side half and deliberately left the script untouched.

Touches one file, so it does not overlap #664.

What was wrong

verdict_standard decides a bare PASS from grep -qE 'SUCCESS|PASS|Complete' over the whole log. Skip declarations routinely contain those words, so a skip the function fails to recognise is not merely missing its (skipped) annotation — it is promoted to a full execution PASS, indistinguishable in the summary from an example that launched kernels and verified results.

Three cases all reported a clean PASS:

case why live?
wgmma_mma_bf16 never launches its main only prints; module doc says "compilation and PTX generation only. Do not launch this kernel." Yet it is in standard, whose contract is that execution succeeds yes, on every GPU run
generated_ldmatrix prints PASS (skipped): … the skip check matched only a leading lowercase skipping:, so the line fell through to the success grep, which matched its own PASS only below sm_75
a capitalised Skipping: same fall-through no — #658 reworded the two examples that hit it

I am being explicit about the third row: nothing triggers it today, so matching case-insensitively is purely defensive. It is included because it is the same fall-through that produced two of the original false passes in #656, and the next example to capitalise the word would silently get a full PASS again.

What this changes

  • Recognise the skip declaration in both spellings the examples use, case-insensitively, before the success-marker check.
  • Add NO_LAUNCH_EXAMPLES=(wgmma_mma_bf16) and report PASS (compiled, no launch) for it, mirroring the existing verify_nvvm_in_compile_only helper shape.
  • Pass ${ex} into verdict_standard, as the dispatch already does for verdict_error.

wgmma_mma_bf16 stays in standard on purpose. It cannot move to WGMMA_EXAMPLES — verdict_wgmma's gate patterns (WARNING: WGMMA requires, PTX load failed (expected on non-Hopper), …) match none of its output, so it would land on FAIL (wgmma, no success marker). And blackwell-compile, the existing always-compile-only category, carries a bespoke dual-route run_cargo branch specific to generated_intrinsics_blackwell. The build and host binary genuinely must succeed here; only the label was wrong.

Verification

No GPU was used, and none is needed: the verdict_* functions are pure by design — "Each verdict_* function consumes a log file + exit code … They never run cargo themselves". I extracted the real verdict_standard, grep_failure_markers, and example_never_launches from the script and drove them with synthetic logs.

scenario before after
real execution pass PASS PASS
lowercase skipping: PASS (skipped) PASS (skipped)
capitalised Skipping: … -- PASS (skipped) PASS PASS (skipped)
PASS (skipped): ldmatrix… requires sm_75+ PASS PASS (skipped)
wgmma_mma_bf16 no-launch output PASS PASS (compiled, no launch)
no marker at all FAIL (no success marker) unchanged
failure marker (panicked at) FAIL (failure marker in output) unchanged
exit code 1 FAIL (exit=1) unchanged
signal 11 FAIL (crashed, signal 11) unchanged

The three bold rows are the fix; the other six confirm nothing else moved.

I also checked that no other example is reclassified: of the 14 self-gating message forms across the examples, 13 already use lowercase skipping: and only generated_ldmatrix uses the PASS (skipped) spelling. No example prints a capitalised Skipping: any more.

The summary tallies on the verdict function's return code, not on parsing the label, so the new string changes no counts. bash -n is clean, and both sibling guards (check-error-example-status.sh, which parses ERROR_EXAMPLES out of this same file, and check-dependency-licenses.sh) still pass.

Scope note on CI

Compile-only runs collapse every category into verdict_compile, so the GPU-less examples-compile lane never reaches verdict_standard. This change affects real-GPU runs only, which is also why it cannot be exercised by upstream CI.

One maintenance note: if wgmma_mma_bf16 ever starts launching, its NO_LAUNCH_EXAMPLES entry should go. The failure mode of forgetting is understating a genuine execution pass as PASS (compiled, no launch), not a false pass.

…s a full PASS

verdict_standard decides a bare `PASS` from `grep -qE 'SUCCESS|PASS|Complete'`
over the whole log. Skip declarations routinely contain those words, so a skip
the function fails to recognise is not merely missing its "(skipped)"
annotation: it is promoted to a full execution PASS, indistinguishable in the
summary from an example that launched kernels and verified results.

Three cases all reported a clean `PASS`:

  * wgmma_mma_bf16's `main` only prints. Its module doc says "compilation and
    PTX generation only. Do not launch this kernel." It belongs in `standard`
    because the build and the host binary must both succeed, but that
    category's contract is that execution succeeds, so every GPU run counted
    it as an execution pass. Name it in NO_LAUNCH_EXAMPLES and report
    `PASS (compiled, no launch)`.
  * generated_ldmatrix prints `PASS (skipped): ...` below sm_75. The skip
    check matched only a leading lowercase `skipping:`, so that line fell
    through to the success grep, which then matched its own `PASS`.
  * A capitalised `Skipping:` did the same thing. NVIDIA#658 reworded the two
    examples that hit it, so nothing triggers this today; matching
    case-insensitively keeps the next one from reaching the success grep.

Compile-only runs collapse every category into verdict_compile, so the
GPU-less examples-compile lane is unaffected. This changes real-GPU runs.

Fixes NVIDIA#656

Signed-off-by: Vyncint Ng <[email protected]>
@nihalpasham nihalpasham added bug Something isn't working tests Adds or improves test coverage labels Aug 6, 2026
@nihalpasham

Copy link
Copy Markdown
Collaborator

The script-side half #656 needed, verified on RTX 5090:

  • future_apis reports a true PASS and wgmma_mma_bf16 reports PASS (compiled, no launch) — the loose SUCCESS|PASS|Complete grep can no longer be satisfied by the word PASS inside a skip line, because the skip check now runs first and matches both spellings case-insensitively.
  • pass/fail totals unchanged; only the labels stop overstating what ran.

Closes #656 (example-side half merged as #658).

@nihalpasham
nihalpasham merged commit b101e3d into NVIDIA:main Aug 6, 2026
34 checks passed
nihalpasham added a commit that referenced this pull request Aug 6, 2026
…test verdict requires

Merging #670 (new example) and #665 (stricter smoketest verdicts) in the
same batch left this example failing the standard-category check: both
kernels verify to exact match but nothing prints SUCCESS/PASS/Complete,
and the stricter harness rightly no longer rescues such a log.
vyncint added a commit to vyncint/cuda-oxide that referenced this pull request Aug 6, 2026
scripts/smoketest.sh assumes two things about the examples that nothing
verified, and neither is reachable without a GPU: the compile-only lane
collapses every category into verdict_compile, so it exercises neither
classify() nor the standard-category success marker.

A `standard` example that verifies its results but prints no
SUCCESS/PASS/Complete marker is reported as FAIL (no success marker). That
landed two days ago: 981b9eb added a marker to disjoint_from_raw_parts on
main after NVIDIA#670 (the new example) and NVIDIA#665 (stricter verdicts) merged in one
batch. Nothing in an example's own directory says a marker is required, and
its author cannot see the consequence without hardware.

Separately, classify() falls through to `standard` for anything its seven
arrays do not claim, so a misspelled or renamed entry does not fail -- it
matches nothing and the example quietly gets the wrong verdict rules. All 45
entries across the 11 arrays are valid today, so that half is preventive.

Add scripts/check-example-smoketest-contract.sh and run it from
status-guard.yml, next to the existing guard that keeps ERROR_EXAMPLES and
STATUS.md in step. It reads sources only: no cargo, no toolkit, no LLVM.

The guard duplicates two of verdict_standard's greps, so it pins that
coupling: if smoketest.sh stops grepping SUCCESS|PASS|Complete, or changes
the skip pattern, the guard says so instead of quietly checking a contract
that no longer exists. Following NVIDIA#643 it also fails closed on a missing
python3 and on a parse self-test, rather than reporting success from a check
that could not run.

Fixes NVIDIA#682

Signed-off-by: Vyncint Ng <[email protected]>
nihalpasham pushed a commit that referenced this pull request Aug 7, 2026
…#683)

scripts/smoketest.sh assumes two things about the examples that nothing
verified, and neither is reachable without a GPU: the compile-only lane
collapses every category into verdict_compile, so it exercises neither
classify() nor the standard-category success marker.

A `standard` example that verifies its results but prints no
SUCCESS/PASS/Complete marker is reported as FAIL (no success marker). That
landed two days ago: 981b9eb added a marker to disjoint_from_raw_parts on
main after #670 (the new example) and #665 (stricter verdicts) merged in one
batch. Nothing in an example's own directory says a marker is required, and
its author cannot see the consequence without hardware.

Separately, classify() falls through to `standard` for anything its seven
arrays do not claim, so a misspelled or renamed entry does not fail -- it
matches nothing and the example quietly gets the wrong verdict rules. All 45
entries across the 11 arrays are valid today, so that half is preventive.

Add scripts/check-example-smoketest-contract.sh and run it from
status-guard.yml, next to the existing guard that keeps ERROR_EXAMPLES and
STATUS.md in step. It reads sources only: no cargo, no toolkit, no LLVM.

The guard duplicates two of verdict_standard's greps, so it pins that
coupling: if smoketest.sh stops grepping SUCCESS|PASS|Complete, or changes
the skip pattern, the guard says so instead of quietly checking a contract
that no longer exists. Following #643 it also fails closed on a missing
python3 and on a parse self-test, rather than reporting success from a check
that could not run.

Fixes #682

Signed-off-by: Vyncint Ng <[email protected]>
nihalpasham pushed a commit that referenced this pull request Aug 21, 2026
…a pass (#1112)

`has_skip_marker` accepts `skipping:` and nothing else. The convention it is
implementing has two spellings, and `scripts/smoketest.sh` -- which owns it --
accepts both:

    if grep -qiE '^[[:space:]]*(skipping:|pass \(skipped\))' "${log}"; then

Its own comment names the second form in so many words: "`PASS (skipped): ...`
form below sm_75". `generated_ldmatrix` prints exactly that:

    println!(
        "PASS (skipped): ldmatrix.m8n8.x4.b16 requires sm_75+; device is sm_{major}{minor}"
    );

An example declining that way exits 0 and prints no mismatch marker, so
`run_binary` classifies the run `RunKind::Pass`. That matters because the
campaign gates on it:

    if !matches!(baseline.kind, RunKind::Pass) {
        ... println!("schedule-fuzz: BASELINE FAILURE: {:?}; no schedule
        variants were run", ...)

With the right kind the campaign stops there and says so. With `Pass` it
proceeds: it patches the PTX, sweeps every seed, and each variant declines
identically -- same exit code, same output, so not even `OutputChanged` fires.
The campaign reports a clean sweep of a kernel that never launched.

This is #665's bug in the second consumer of the same convention. That fix
put it as "a skip the function fails to recognise is not merely missing its
`(skipped)` annotation -- it is promoted to a full execution PASS", and taught
`verdict_standard` the second spelling. `ptx-schedule`'s campaign arrived later
(#1065) with only the first. A silent all-clear is the worst outcome available
to a bug-finding tool, and it is the one this produces on any device below an
example's floor.

Hoist both spellings into a `SKIP_MARKERS` constant and check the line against
each, with the coupling to the smoketest's pattern recorded next to it.
Case-insensitivity is unchanged and already correct: `run_binary` lowercases
before classifying, which is what makes this match the smoketest's `grep -i`.

Two tests: both spellings are recognised with and without leading whitespace,
and the near-misses are not -- a bare `pass`, `pass: 1024 elements verified`,
`success`, and a mid-line `no skipping: here`, since the marker is anchored to
the start of the line in the smoketest too. Both fail with the second marker
removed.

Verified: 11 tests pass, fmt clean, `clippy --all-targets -- -D warnings`
clean, and `cargo doc --document-private-items` clean.

Signed-off-by: Vyncint Ng <[email protected]>
nihalpasham pushed a commit to vyncint/cuda-oxide that referenced this pull request Aug 23, 2026
…ailure

`RunKind::Skipped` became reachable in NVIDIA#1112, when `has_skip_marker` learned
the second spelling examples use to decline. Nothing consumes it distinctly.
Both places that read the baseline test for `Pass` and treat everything else
alike:

    if !matches!(baseline.kind, RunKind::Pass) {
        ... println!("schedule-fuzz: BASELINE FAILURE: {:?}; ...")

    Ok(summary) if !matches!(summary.baseline.kind, RunKind::Pass) => {
        eprintln!("Error: baseline example did not pass; ...");
        std::process::exit(1);
    }

So `cargo oxide fuzz-schedule redux_f32` on anything below sm_100a prints
`BASELINE FAILURE: Skipped`, then `Error: baseline example did not pass`, and
exits 1. The example did not fail. It ran, declared it cannot run on this
device, and exited 0 -- which is precisely what `scripts/smoketest.sh` reports
as `PASS (skipped)`. NVIDIA#665 exists because reporting a decline as anything else
made an arch-gated example indistinguishable from a broken one, and this is the
same conflation in the campaign: sweeping a fleet, "below this example's arch
floor" comes back red alongside a genuinely wedged device.

Rather than repeat a `matches!` in two crates, the distinction becomes one
typed definition: `RunKind::baseline_verdict()` returns `Usable`, `Declined` or
`Broken`, and the campaign and the CLI both consult it. The match is exhaustive,
so a new `RunKind` cannot join a class by accident -- adding one now fails with
E0004 instead of silently reading as broken.

Behaviour: `Declined` prints `BASELINE DECLINED` and, in the CLI, a `Note:` on
stderr with exit **0**. Every other non-`Pass` baseline keeps `BASELINE
FAILURE` and exit 1, now with the kind in the message so the reader knows
whether it hung, crashed or wedged. `--fail-on-finding` is untouched and
remains the switch for failing on real findings. If you would rather a decline
carry a distinct nonzero code, that is a one-line change in the new arm.

Two tests: the three classes pinned exhaustively over all eight `RunKind`
variants, and that every *finding* kind is a `Broken` baseline -- a mismatch is
a finding in a variant, but as the baseline it means there is no ground truth
to compare against. The first fails with `Skipped` moved back into the broken
class.

Verified: 16 ptx-schedule tests and 177 cargo-oxide tests pass, fmt clean,
`clippy --all-targets -- -D warnings` clean on both crates, and
`cargo doc --document-private-items` clean.

Signed-off-by: Vyncint Ng <[email protected]>
nihalpasham added a commit that referenced this pull request Aug 23, 2026
…ailure (#1135)

* fix(ptx-schedule): an example that declines to run is reported as a failure

`RunKind::Skipped` became reachable in #1112, when `has_skip_marker` learned
the second spelling examples use to decline. Nothing consumes it distinctly.
Both places that read the baseline test for `Pass` and treat everything else
alike:

    if !matches!(baseline.kind, RunKind::Pass) {
        ... println!("schedule-fuzz: BASELINE FAILURE: {:?}; ...")

    Ok(summary) if !matches!(summary.baseline.kind, RunKind::Pass) => {
        eprintln!("Error: baseline example did not pass; ...");
        std::process::exit(1);
    }

So `cargo oxide fuzz-schedule redux_f32` on anything below sm_100a prints
`BASELINE FAILURE: Skipped`, then `Error: baseline example did not pass`, and
exits 1. The example did not fail. It ran, declared it cannot run on this
device, and exited 0 -- which is precisely what `scripts/smoketest.sh` reports
as `PASS (skipped)`. #665 exists because reporting a decline as anything else
made an arch-gated example indistinguishable from a broken one, and this is the
same conflation in the campaign: sweeping a fleet, "below this example's arch
floor" comes back red alongside a genuinely wedged device.

Rather than repeat a `matches!` in two crates, the distinction becomes one
typed definition: `RunKind::baseline_verdict()` returns `Usable`, `Declined` or
`Broken`, and the campaign and the CLI both consult it. The match is exhaustive,
so a new `RunKind` cannot join a class by accident -- adding one now fails with
E0004 instead of silently reading as broken.

Behaviour: `Declined` prints `BASELINE DECLINED` and, in the CLI, a `Note:` on
stderr with exit **0**. Every other non-`Pass` baseline keeps `BASELINE
FAILURE` and exit 1, now with the kind in the message so the reader knows
whether it hung, crashed or wedged. `--fail-on-finding` is untouched and
remains the switch for failing on real findings. If you would rather a decline
carry a distinct nonzero code, that is a one-line change in the new arm.

Two tests: the three classes pinned exhaustively over all eight `RunKind`
variants, and that every *finding* kind is a `Broken` baseline -- a mismatch is
a finding in a variant, but as the baseline it means there is no ground truth
to compare against. The first fails with `Skipped` moved back into the broken
class.

Verified: 16 ptx-schedule tests and 177 cargo-oxide tests pass, fmt clean,
`clippy --all-targets -- -D warnings` clean on both crates, and
`cargo doc --document-private-items` clean.

Signed-off-by: Vyncint Ng <[email protected]>

* fix(ptx-schedule): pin baseline and CLI verdict policy

Keep stronger process failures ahead of skips and make the CLI distinction between declined, broken, and finding-bearing campaigns explicit and testable.

Signed-off-by: nihalp <[email protected]>

---------

Signed-off-by: Vyncint Ng <[email protected]>
Signed-off-by: nihalp <[email protected]>
Co-authored-by: nihalp <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working tests Adds or improves test coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

smoketest: standard examples are not gated by compute capability (2 false PASS, 2 false FAIL, 8 failures on sm_75)

2 participants