Skip to content

[clr][graph] Empty-node markers + Phase 1 PR diff-coverage gate#1

Open
jainprad wants to merge 4 commits into
developfrom
jainprad/clr-graph-empty-node-coverage
Open

[clr][graph] Empty-node markers + Phase 1 PR diff-coverage gate#1
jainprad wants to merge 4 commits into
developfrom
jainprad/clr-graph-empty-node-coverage

Conversation

@jainprad

@jainprad jainprad commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

Copy of upstream PR ROCm/rocm-systems#7026 (originally by @anugodavar), re-applied on top of current develop, plus a Phase 1 PR code-coverage gate.

1. CLR/graph change (cherry-picked from ROCm#7026)

  • Empty nodes are captured as zero-packet dependency ranges; cross-stream ordering handled by BuildSyncPlan barriers.
  • Removed the pre/post Marker pair around uncaptured nodes.
  • GraphEmptyNode::GraphCaptureEnabled() now returns true only under segment scheduling.

Note: the .cpp portion of ROCm#7026 is already merged on develop, so the net delta here is the .hpp guard. The original commit is preserved via git cherry-pick -x.

2. Phase 1 PR diff-coverage gate (new)

Measures the lines this PR changes and fails when they aren't exercised by existing or newly added tests — designed to be a required status check that blocks under-tested PRs.

  • ci/coverage/build_and_test.sh--coverage build + full test run (ROCm/self-hosted runner).
  • ci/coverage/collect_and_gate.shgcovr -> Cobertura, then diff-cover --fail-under=80; skips neutrally when no coverage data (non-ROCm runner).
  • .github/workflows/pr-diff-coverage.yml — runs on PRs touching projects/clr/**; runner/build configurable via repo variables.
  • ci/coverage/README.md — design + Change-Based Testing (Phase 2) roadmap.

Test plan

  • Workflow triggers on this PR (paths include projects/clr/** and ci/coverage/**).
  • gcov .gcno (compile time) + .gcda (run time) generation verified locally with gcovr/diff-cover.
  • On a ROCm-capable runner: build with coverage, run tests, enforce the patch-coverage gate.
  • Confirm gate fails when changed lines are uncovered and passes otherwise.

anugodavar and others added 2 commits July 6, 2026 11:29
… uncaptured nodes

Empty nodes are pure dependency points with no GPU work. Previously they
were treated as uncaptured nodes causing unnecessary pre/post Marker pairs.
Now they are recognized during AQL capture and registered as zero-packet
ranges, with cross-stream ordering handled entirely by BuildSyncPlan
barrier packets.

Also removed the pre/post amd::Marker barriers around uncaptured (non-AQL)
nodes in EnqueueSegment. These markers were added to resync the Barriers()
tracker but are unnecessary: upstream flat batches already hand off via
attach_signal (SDMA memcpy) or BuildSyncPlan dep barriers, and the
uncaptured node's own commands enqueue directly to the HW queue in order.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
(cherry picked from commit cd3d0e6)
Add a per-PR diff (patch) coverage gate that measures the lines a PR
changes and fails when they are not exercised by existing or newly
added tests. Intended to be a required status check to block
under-tested PRs.

- ci/coverage/build_and_test.sh: --coverage build + full test run
- ci/coverage/collect_and_gate.sh: gcovr collection + diff-cover gate
- .github/workflows/pr-diff-coverage.yml: PR workflow on projects/clr/**
- ci/coverage/README.md: design, config, and CBT (Phase 2) roadmap

Co-authored-by: Cursor <cursoragent@cursor.com>
jainprad and others added 2 commits July 6, 2026 14:48
The gate ran on a hosted runner that has no ROCm/hipcc toolchain or GPU,
so the instrumented CLR build never happened (no .gcno/.gcda) and gcovr
errored on a missing build dir. Fixes:

- Skip the gate neutrally (exit 0) when no *.gcda coverage data exists,
  instead of failing.
- Allow targeting a self-hosted ROCm runner + wiring the real build via
  repo variables (COVERAGE_RUNNER / COVERAGE_{CONFIGURE,BUILD,TEST}_CMD)
  so coverage is actually generated where CLR/HIP can be built and run.
- Make coverage-tooling install resilient on self-hosted runners.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Use diff-cover --format html:...,markdown:... (non-deprecated).
- Print absolute paths to coverage.html (full) and diff-coverage.html
  (patch) after the gate, and add a "Coverage reports" pointer to the
  GitHub step summary so the uploaded coverage-reports artifact is easy
  to find and open.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

2 participants