Skip to content

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

Closed

Description

@vyncint

Description

scripts/smoketest.sh classifies an example as standard by default, and the standard contract is execution must succeed (smoketest.sh:321). Nothing in the script gates that on compute capability — each example is expected to self-declare a skip by printing skipping:. That self-declaration is incomplete and inconsistent, so on a pre-Ampere GPU the suite reports two examples as passing when they executed nothing, two as failing when they did exactly the right thing, and eight as hard failures.

I ran the full suite on a Tesla T4 (sm_75): 178 examples, 1515s, 11 failures. Upstream CI compiles examples without executing them, so none of this is reachable from ubuntu-latest.


1. Two examples report a full PASS without executing

cp_async_small and cp_async_zfill guard correctly in host code, but print a capitalised marker:

     Running `target/oxide-examples/release/cp_async_small`
=== cp.async small-copy example (4-byte and 8-byte) ===

Skipping: cp.async requires sm_80+, device is sm_75 -- PASS (skipped)

smoketest verdict: PASS — not PASS (skipped).

Two things go wrong in sequence:

  • the skip check at smoketest.sh:333 is grep -qE '^[[:space:]]*skipping:', which is case-sensitive and does not match Skipping:;
  • the example is then rescued by the success check at :337, grep -qE 'SUCCESS|PASS|Complete', because its message contains the substring PASS.

So it is counted as a genuine execution pass, indistinguishable in the summary from an example that ran and validated results. The comment at :329-332 says examples may gate themselves "without having to fake a success marker" — these two do exactly that, and pass only by accident. Reword the message without the word PASS and both would report FAIL (no success marker).

2. Two examples report FAIL despite behaving correctly

tma_copy checks capability, falls back to verify_ptx_only, and exits 0:

⚠️  WARNING: TMA requires sm_90+ (Hopper or newer)
ℹ️  PTX load failed (expected on pre-Hopper): DriverError(218, "a PTX JIT compilation failed")

tma_multicast has the skipping: marker, but in the wrong branch. Its driver-error fallback prints it (main.rs:181), directly under a comment (:178-180) explaining it is there so "smoketest's failure-marker scan doesn't flag this as a regression". The early capability check at :154 omits it:

⚠️  TMA multicast requires sm_100a (Blackwell datacenter).
   Your GPU is sm_75. Use: cargo oxide run tma_copy

On sm_75 the capability path wins, so the intent recorded in that comment is defeated. Both report FAIL (no success marker).

3. Eight standard examples fail with no working guard

example cause exit
barrier mbarrier (sm_80), no guard 101 (panic main.rs:132)
future_apis mbarrier (sm_80), no guard 1
mcast_barrier_test cluster + multicast (sm_90), no guard 1
coop_groups_demo cluster (sm_90), no guard 101 (panic main.rs:672)
generated_intrinsics bf16 (sm_80), no guard 101 (panic main.rs:1260)
cvt_f16x2 packed f16 conversions, no guard 1
clc guard only warns, then continues 101 (panic main.rs:205)
cutile_inter_kernel cuTile toolchain has no sm_75 support 101

The first seven fail with DriverError(218, "a PTX JIT compilation failed"). cutile_inter_kernel fails earlier, inside the third-party toolchain:

tileiras failed (exit exit status: 1) for gpu sm_75:
stderr: tileiras: for the --gpu-name option: Cannot find option named 'sm_75'!

4. wgmma_mma_bf16 is compile-only but categorised standard

It prints SUCCESS: BF16 WGMMA deferred accumulator lowering compiled. and never launches, yet sits in the category whose contract is execution must succeed. WGMMA_EXAMPLES contains only wgmma (smoketest.sh:52).


Expected behavior

On a GPU below an example's required compute capability, the example reports PASS (skipped) and the suite says so; an example that handles the case correctly is never reported as FAIL.

Actual behavior

Two false passes, two false failures, eight hard failures, and one compile-only example counted as an execution pass.

Environment

  • GPU: Tesla T4 (sm_75, 15360 MiB)
  • CUDA driver version: 595.71.05
  • nvcc: Build cuda_13.2.r13.2/compiler.37434383_0
  • Rust toolchain: nightly-2026-04-03 (per rust-toolchain.toml)
  • Source revision: e28248c1

Suggested direction

Two independent parts:

Harness (smoketest.sh) — these are bugs regardless of what the examples do:

  1. make the skip check case-insensitive, or keep requiring the documented lowercase form and fix the two examples that don't use it. (The check order is already right — :333 runs before :337; what lets a skip through as a full pass is the case-sensitive match falling through to a success test that accepts a bare PASS substring anywhere in the log.)
  2. consider tightening that success marker. grep -qE 'SUCCESS|PASS|Complete' matching anywhere in the output is what rescued these two examples into a green result; anchoring it would make a missing marker fail loudly instead of being papered over by incidental text.
  3. move wgmma_mma_bf16 into WGMMA_EXAMPLES.

Examples — give the eight unguarded ones the same skipping: guard the other 13 already use, and move tma_multicast's marker into its capability branch. I prefer this over a declarative example -> minimum sm table in the script, because these examples are broken for anyone on older hardware running them directly, not just for the test suite: a table would make the suite green while cargo oxide run barrier still panics in a user's face.

Happy to implement this if you agree with the split, or to take the table approach instead if you'd rather have the requirements in one enforceable place.

Additional context

There may be a related compiler-side question. Every DriverError(218) failure above shows Detected GPU arch: sm_75 (via nvidia-smi), i.e. the backend built for the detected arch and emitted instructions the Turing JIT rejects, rather than raising the target to the required floor. commands.rs:1058-1061 describes the intent as "the backend builds for the required arch and the module simply skips at load time", and intrinsics/catalog.json records per-selection predicates such as Subtarget->getSmVersion() >= 90. generated_intrinsics fails this way too, so it is not limited to hand-written wrappers. I have not investigated whether this is a gap or intended, and did not want to fold it into this issue — happy to open a separate one if it is worth pursuing.

Activity

  1. vyncint commented on Aug 4, 2026

    @vyncint
    ContributorAuthor

    Opened #658 for the example-side half of this (the eleven examples that misreport). It leaves smoketest.sh untouched.

    Two corrections to my own suggestions above, found while implementing:

    Suggestion 3 does not work. Moving wgmma_mma_bf16 into WGMMA_EXAMPLES would not fix it. Its output (SUCCESS: BF16 WGMMA deferred accumulator lowering compiled.) matches none of the non-Hopper markers at smoketest.sh:475, so it falls through to :488 and reports PASS (wgmma, executed) — as untrue as the current PASS. The real question is whether a compile-only wgmma bucket should exist alongside blackwell-compile, which is a call for you rather than a relabel. Left out of #658.

    cutile_inter_kernel is also left out. It fails inside the third-party toolchain (tileiras: for the --gpu-name option: Cannot find option named 'sm_75'!), and I do not know cuTile's actual floor. Guessing one seemed worse than leaving it unguarded and visible.

    The remaining harness item is the success check accepting SUCCESS|PASS|Complete anywhere in the output, which is what let the two false passes through. That is a change with blast radius across every example, so I have not touched it — happy to if you want it.

  2. vyncint commented on Aug 5, 2026

    @vyncint
    ContributorAuthor

    Ran the full suite on an A10G (sm_86) as well, which resolves the cutile_inter_kernel question I left open above and puts the rest of this issue on a firmer footing. 3 failures / 178, against 11 on sm_75.

    cutile_inter_kernel needs no guard

    It passes on sm_86 (119s, real execution). So cuTile's floor is above sm_75 and at or below sm_86 — and since this project's documented minimum is Ampere (cuda-oxide-book/getting-started/installation.md:12 — "NVIDIA GPU | Ampere+ (sm_80+)"), it only fails below the supported range. No guard is warranted; the honest answer is "not a bug", not the invented floor I declined to write. Please disregard that bullet from the issue body.

    The guards hold in both directions

    @nihalpasham's CC 12.0 check confirmed no guard misfires at the top of the range. sm_86 tests the other direction at the same time — sm_80-floor examples must run, sm_90/sm_100-floor examples must skip:

    Example Floor sm_75 (pre-fix) sm_86
    barrier sm_80 hard FAIL PASS — executed
    cp_async_small sm_80 false PASS PASS — executed
    cp_async_zfill sm_80 false PASS PASS — executed
    cvt_f16x2 sm_80 hard FAIL PASS — executed
    cvt_packed sm_80 PASS (skipped) PASS — executed
    bf16x2_fma sm_80 PASS (skipped) PASS — executed
    generated_intrinsics sm_80 hard FAIL PASS — executed
    coop_groups_demo sm_90 hard FAIL PASS (skipped)
    cluster sm_90 PASS (skipped) PASS (skipped)
    clc sm_100 hard FAIL PASS (skipped)
    tma_copy sm_90 false FAIL PASS (skipped)
    tma_multicast sm_100 false FAIL PASS (skipped)

    This also brackets cvt_f16x2 empirically: it fails at sm_75 and executes at sm_86, so the sm_80 floor I inferred from cvt_packed's precedent is neither too high nor too low.

    Scope note I should have made when filing

    sm_75 is below the documented sm_80+ minimum, so the six sm_80-floor guards only change behaviour on unsupported hardware. The sm_90 and sm_100 ones do not: tma_copy and tma_multicast produce a false FAIL, and coop_groups_demo, mcast_barrier_test and clc fail outright, on any supported Ampere or Hopper device. Five of the eleven are therefore in scope regardless of what one thinks of Turing.

    Still failing on sm_86, tracked elsewhere

    • vectorization — vectorization: f32x4_view_copy accesses lower to generic space, not .global #657, same two f32x4_view_copy assertions. Worth noting it fails on the exact architecture that module's docs cite for their measurements ("Measured on sm_86", crates/cuda-device/src/vector.rs:30), so that one is not a Turing artifact either.
    • future_apis — fails with DriverError(218) on sm_86 even after forcing a full backend rebuild. Its PTX is emitted as .target sm_100 while the only arch-sensitive instructions in it are mbarrier.{init,arrive,test_wait,inval} (sm_80), so the guard I added is gating the wrong thing. I do not yet understand why the target is raised to sm_100, and will file it separately rather than guess — it looks like the same target-selection question I raised under "Additional context" above, seen from the other side.

    Hardware: nvidia-smi reports NVIDIA A10G, 8.6. All 178 examples, at e28248c1 plus #658.

  3. vyncint commented on Aug 5, 2026

    @vyncint
    ContributorAuthor

    Measured the harness half, and it retires my own suggestion (2) above — tightening the success marker is not a small change, and the looseness turns out to be load-bearing.

    Why anchoring does not work

    148 of the 178 examples print a success marker, in 293 distinct strings. Of those:

    • 185 would fail a ^-anchored match — they lead with a space, a newline, ✓, ===, [, or ⚠
    • only 69 begin with a bare SUCCESS/PASS/Complete

    A sample of the shapes actually in use:

      ✓ PASSED
      ✓ PASSED (max_error={:.6})
    \nSUCCESS: {n} cases x 4 variants within {ULP_LIMIT} ULP of host libm
    \n=== Test Complete ===
    \n✓ All tests PASSED!
      [PASS] f32 -> u32: 1.5 -> {}
    PASS {name}: {got:?}
    

    The part that actually matters

    PASS is not only a final verdict here. Several examples print [PASS] or PASS {name} per sub-test, so any rule keyed on the token appearing somewhere cannot distinguish "all 20 cases passed" from "19 printed PASS and the 20th did not print anything". Anchoring does not fix that either — PASS {name}: ... is anchored and per-case.

    So a stricter marker is not a regex change. It needs a declared final-verdict convention — one line, emitted once, e.g. RESULT: PASS — adopted across 148 examples, with the loose match kept until every one has it. That is a much larger and more invasive change than the false-pass it would prevent, which is why I am not proposing it.

    What does protect the current rule is grep_failure_markers running first: an example that prints 19 [PASS] lines and then fails still trips FAIL, ✗, a panic, or a non-zero exit. The two false passes in this issue slipped through only because those examples printed a fake success marker of their own (-- PASS (skipped)), which #658 removed.

    Suggest closing suggestion (2) as won't-fix unless you want the convention change, in which case it deserves its own issue. That leaves wgmma_mma_bf16's category as the one open harness item here — and per my earlier comment, moving it to WGMMA_EXAMPLES would just relabel it PASS (wgmma, executed), which is equally untrue, so it needs a decision about whether a compile-only wgmma bucket should exist at all.

    All of the above is static analysis of the example sources — no GPU, no execution.

  4. added
    bug
    tests
    examples
    on Aug 6, 2026
  5. added a commit that references this issue on Aug 6, 2026
    b101e3d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugexamplestests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions