Skip to content

coverage CI: mark SlangcCoverageManifestOutput as expected failure on macOS#11630

Merged
skiminki-nv merged 1 commit into
shader-slang:masterfrom
jvepsalainen-nv:fix/coverage-metallib-expected-failure
Jun 16, 2026
Merged

coverage CI: mark SlangcCoverageManifestOutput as expected failure on macOS#11630
skiminki-nv merged 1 commit into
shader-slang:masterfrom
jvepsalainen-nv:fix/coverage-metallib-expected-failure

Conversation

@jvepsalainen-nv

Copy link
Copy Markdown
Contributor

Motivation

slang-unit-test-tool/SlangcCoverageManifestOutput.internal has been failing on the macOS coverage nightly runner (https://github.com/shader-slang/slang/actions/runs/27591487109/job/81572949146) since the runner gained a Metal toolchain. PR #11610 loosened the manifest content check but did not fix the root cause: coverage metadata (ICoverageTracingMetadata) is not propagated through the Metal downstream compilation chain, so _maybeWriteCoverageManifest finds no metadata on the final artifact and writes no file at all. The manifest-content check never runs.

On non-Apple CI the two MetalLib sub-checks skip cleanly via _isMetalLibDownstreamUnavailable, so the test appeared to pass everywhere before the nightly.

Proposed solution

Add the unit test to tests/expected-failure-coverage.txt so the nightly classifies the known failure as expected rather than breaking the run. The underlying compiler issue (metadata propagation through downstream compilation) is tracked in #11629.

Change summary

File Change
tests/expected-failure-coverage.txt Add slang-unit-test-tool/SlangcCoverageManifestOutput.internal with a comment linking to #11629

Process report

No code change. The expected-failure entry uses the same -expected-failure-list mechanism already in place for other coverage-only skips. The entry is scoped to this file (consumed only by the coverage CI workflow) and does not affect regular CI.

… macOS

The two MetalLib sub-checks inside SlangcCoverageManifestOutput
(_testCoverageAutoSidecarForMetalLibDisassembly and
_testCoverageExplicitSidecarForMetalLibDisassembly) always fail on the
macOS coverage nightly because coverage metadata is not propagated
through the Metal downstream compilation chain — _maybeWriteCoverageManifest
finds no ICoverageTracingMetadata on the final artifact and writes no
manifest file.

On non-Apple CI the sub-checks skip via _isMetalLibDownstreamUnavailable,
so the test appears to pass everywhere except the coverage nightly.

Marking the whole unit test as expected-failure keeps the nightly green
while the underlying compiler issue is tracked in shader-slang#11629.
@jvepsalainen-nv jvepsalainen-nv requested a review from a team as a code owner June 16, 2026 16:03
@jvepsalainen-nv jvepsalainen-nv added the pr: non-breaking PRs without breaking changes label Jun 16, 2026
@jvepsalainen-nv jvepsalainen-nv requested review from bmillsNV and removed request for a team June 16, 2026 16:03
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b1cef444-6453-435e-875e-b7fc196564eb

📥 Commits

Reviewing files that changed from the base of the PR and between 5353bc5 and c1d7666.

📒 Files selected for processing (1)
  • tests/expected-failure-coverage.txt

📝 Walkthrough

Walkthrough

Adds slang-unit-test-tool/SlangcCoverageManifestOutput.internal to tests/expected-failure-coverage.txt with inline comments explaining that on macOS coverage CI the test's Metal downstream sub-checks fail because coverage metadata is not propagated through the Metal compilation chain, causing _maybeWriteCoverageManifest to write no manifest.

Changes

Coverage CI Expected-Failure Entry

Layer / File(s) Summary
SlangcCoverageManifestOutput macOS Metal expected-failure entry
tests/expected-failure-coverage.txt
Appends the slang-unit-test-tool/SlangcCoverageManifestOutput.internal skiplist entry and inline documentation covering the Metal downstream coverage-metadata propagation gap and the _isMetalLibDownstreamUnavailable skip path on non-Apple CI.

Suggested reviewers

  • bmillsNV
  • skiminki-nv
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: marking a specific test as an expected failure in coverage CI on macOS, which matches the core purpose of the PR.
Description check ✅ Passed The description is well-related to the changeset, providing clear motivation, root cause analysis, proposed solution, and detailed change summary that directly corresponds to the file modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@skiminki-nv skiminki-nv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@skiminki-nv skiminki-nv enabled auto-merge June 16, 2026 16:12
@jvepsalainen-nv jvepsalainen-nv self-assigned this Jun 16, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: 🟡 Has issues — 0 bugs, 2 gaps

The PR adds one entry to tests/expected-failure-coverage.txt to mark slang-unit-test-tool/SlangcCoverageManifestOutput.internal as an expected failure on macOS coverage CI, deferring the underlying metallib-asm metadata-propagation fix to #11629. The technical claims about _maybeWriteCoverageManifest / ICoverageTracingMetadata and the entry-name format match source. Two issues: (1) expected-failure granularity is per-unit-test, but only 2 of the test's 27 SLANG_CHECK sub-checks are Metal-related, so the entry silently masks future regressions in 25 unrelated sub-checks on the macOS-coverage lane; (2) the inline comment misattributes the non-Apple skip to _isMetalLibDownstreamUnavailable, when it is actually the #if SLANG_APPLE_FAMILY preprocessor guard that compiles those sub-checks out.

Changes Overview

Coverage CI expected-failure list (tests/expected-failure-coverage.txt)

  • What changed: Adds slang-unit-test-tool/SlangcCoverageManifestOutput.internal plus a 7-line explanatory comment. The comment describes that _maybeWriteCoverageManifest (source/slang/slang-end-to-end-request.cpp:511) finds no ICoverageTracingMetadata on the Metal final artifact because metadata is dropped going through xcrun metallib-asm, so the test's two MetalLib sub-checks fail on macOS coverage CI; on non-Apple CI the sub-checks are skipped. No source code, IR pass, emitter, or prelude is touched.
Findings (2 total)
Severity Location Finding
🟡 Gap tests/expected-failure-coverage.txt:36 Per-test granularity masks future regressions in the 25 non-Metal sub-checks of SlangcCoverageManifestOutput on macOS coverage CI
🟡 Gap tests/expected-failure-coverage.txt:35 Comment says non-Apple CI skips via _isMetalLibDownstreamUnavailable, but the actual non-Apple skip is the #if SLANG_APPLE_FAMILY preprocessor guard at unit-test-stdin-compile.cpp:800–803, 876–879

# inside this unit test therefore always fail on macOS coverage CI where the
# Metal toolchain is present. Tracked in: https://github.com/shader-slang/slang/issues/11629
# On non-Apple CI the sub-checks are skipped via _isMetalLibDownstreamUnavailable.
slang-unit-test-tool/SlangcCoverageManifestOutput.internal

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Gap: Expected-failure granularity masks future regressions in 25 unrelated sub-checks

expected-failure-coverage.txt operates at unit-test granularity, but SLANG_UNIT_TEST(SlangcCoverageManifestOutput) at tools/slang-unit-test/unit-test-stdin-compile.cpp:1610 aggregates 27 SLANG_CHECK calls. Only sub-checks 3 and 6 — _testCoverageAutoSidecarForMetalLibDisassembly (line 778) and _testCoverageExplicitSidecarForMetalLibDisassembly (line 852) — are Metal-related. The other 25 cover auto-sidecar, explicit-sidecar, stdout artifact, overwrite/symlink/case-alias collisions, multi-entry, whole-program, unsupported-target rejection, write-failure reporting, and compiler-option-hash invariance. With this entry, a future regression in any of those 25 that only manifests under LLVM coverage instrumentation on macOS will be reclassified as "expected" and ship undetected on that lane (Linux/Windows non-coverage and macOS non-coverage CI would still catch it, so the blind spot is genuinely macOS-coverage-only — but the file's own header documents that LLVM-coverage-only failure modes do exist).

Example: If a refactor of the sidecar-overwrite logic introduces a regression that only repros under LLVM coverage on macOS, the unit test fails, the runner reclassifies it as expected, the regression ships, and is only caught when #11629 is fixed and this entry is removed.

Suggested fix: Guard the two MetalLib sub-checks at the test level rather than skipping the whole test. For example, skip lines 1614 and 1617–1618 (the two SLANG_CHECK(_testCoverageExplicit/AutoSidecarForMetalLibDisassembly(...)) invocations) when running under coverage instrumentation on macOS — via a runtime probe in those helpers, an env-var, or a coverage-build define. Then drop this expected-failure-coverage.txt entry. That preserves regression coverage for the 25 non-Metal sub-checks until #11629 is fixed.

# final artifact and writes no manifest file. The two MetalLib sub-checks
# inside this unit test therefore always fail on macOS coverage CI where the
# Metal toolchain is present. Tracked in: https://github.com/shader-slang/slang/issues/11629
# On non-Apple CI the sub-checks are skipped via _isMetalLibDownstreamUnavailable.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Gap: Comment misidentifies the non-Apple skip mechanism

The line says: # On non-Apple CI the sub-checks are skipped via _isMetalLibDownstreamUnavailable. In source, both Metal sub-checks at tools/slang-unit-test/unit-test-stdin-compile.cpp:778 (_testCoverageAutoSidecarForMetalLibDisassembly) and :852 (_testCoverageExplicitSidecarForMetalLibDisassembly) are wrapped in #if SLANG_APPLE_FAMILY with an #else return SLANG_OK; branch (around lines 800–803 and 876–879). On non-Apple builds the entire body is compiled out — _isMetalLibDownstreamUnavailable is never reached. That helper only handles the runtime case where the Metal toolchain is missing on Apple.

Suggestion: Reword to accurately credit the preprocessor guard:

# On non-Apple builds the sub-checks are compiled out via `#if SLANG_APPLE_FAMILY`;
# on Apple platforms without a Metal toolchain they return early via
# `_isMetalLibDownstreamUnavailable` (E52002 "pass-through compiler not found").

@skiminki-nv skiminki-nv added this pull request to the merge queue Jun 16, 2026
Merged via the queue into shader-slang:master with commit 08e95b8 Jun 16, 2026
48 checks passed
@jkwak-work

Copy link
Copy Markdown
Collaborator

@nv-slang-bot , please create a new issue to track the follow up.
This PR is a workaround not a fix.
The current PR makes the passing test on Linux marked as expected-failure when the intention was to make the test expected-failure only on mac-os.

We need a proper fix to make it working for both mac-os and linux; or at least bring back the coverage on linux.
Make a new issue an assign to @jvepsalainen-nv to follow up

@nv-slang-bot

nv-slang-bot Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@jkwak-work Tracked as #11632, assigned to @jvepsalainen-nv.

The follow-up issue captures the request — a proper cross-platform fix, or at minimum restoring coverage — plus the verified specifics:

  • The workaround lists the entire SlangcCoverageManifestOutput unit test in tests/expected-failure-coverage.txt, and -expected-failure-list matches on the whole test name, so on macOS coverage CI it suppresses the pass/fail signal for all ~20 sub-checks — not just the two failing MetalLib ones (_testCoverageAutoSidecarForMetalLibDisassembly, _testCoverageExplicitSidecarForMetalLibDisassembly).
  • Note for reference: at master HEAD, expected-failure-coverage.txt is wired into the coverage workflow only inside the macOS branch (.github/workflows/ci-slang-coverage.yml:258), so the Linux coverage job doesn't load it and the test still runs/passes on Linux. The issue flags the non-platform-scoped entry as a latent trap regardless and asks you/@jvepsalainen-nv to confirm if there's another path. Root cause stays tracked in Coverage manifest not written for metallib/metallib-asm downstream compilation targets #11629.

🤖 Generated by an automated Slang coworker — may be inaccurate. A human maintainer should verify.

jvepsalainen-nv added a commit that referenced this pull request Jun 22, 2026
… macOS (#11630)

## Motivation

`slang-unit-test-tool/SlangcCoverageManifestOutput.internal` has been
failing on the macOS coverage nightly runner
(https://github.com/shader-slang/slang/actions/runs/27591487109/job/81572949146)
since the runner gained a Metal toolchain. PR #11610 loosened the
manifest content check but did not fix the root cause: coverage metadata
(`ICoverageTracingMetadata`) is not propagated through the Metal
downstream compilation chain, so `_maybeWriteCoverageManifest` finds no
metadata on the final artifact and writes no file at all. The
manifest-content check never runs.

On non-Apple CI the two MetalLib sub-checks skip cleanly via
`_isMetalLibDownstreamUnavailable`, so the test appeared to pass
everywhere before the nightly.

## Proposed solution

Add the unit test to `tests/expected-failure-coverage.txt` so the
nightly classifies the known failure as expected rather than breaking
the run. The underlying compiler issue (metadata propagation through
downstream compilation) is tracked in #11629.

## Change summary

| File | Change |
|---|---|
| `tests/expected-failure-coverage.txt` | Add
`slang-unit-test-tool/SlangcCoverageManifestOutput.internal` with a
comment linking to #11629 |

## Process report

No code change. The expected-failure entry uses the same
`-expected-failure-list` mechanism already in place for other
coverage-only skips. The entry is scoped to this file (consumed only by
the coverage CI workflow) and does not affect regular CI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: non-breaking PRs without breaking changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants