Skip to content

CI: give scope-stats the DFX smoke step the other four have - #1983

Merged
ChaoWao merged 1 commit into
hw-native-sys:mainfrom
ChaoWao:support/scope-stats-ci-smoke
Aug 24, 2026
Merged

CI: give scope-stats the DFX smoke step the other four have#1983
ChaoWao merged 1 commit into
hw-native-sys:mainfrom
ChaoWao:support/scope-stats-ci-smoke

Conversation

@ChaoWao

@ChaoWao ChaoWao commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

tests/st/{a2a3,a5}/tensormap_and_ringbuffer/dfx/scope_stats/ is the only test of the scope-stats capture pipeline, and its artifact validation never ran in any pipeline.

_validate_scope_stats_artifact returns early unless --enable-scope-stats is on (test_scope_stats.py:117), and nothing passed it:

$ grep -rn "scope_stats\|enable-scope-stats" .github/
$ # empty

$ # meanwhile, in the same two workflows:
      3 enable-dep-gen
      1 enable-chip-swimlane
      1 enable-pmu
      1 --dump-args

To be precise about what was and wasn't covered: the scene half did run. The class is an ordinary SceneTestCase, so the main sweep compiled and ran its vector_example and checked the golden. What never ran is the part that matters for this feature — the scope_stats.jsonl assertions: at least four begin/end records, dropped == 0, the metadata schema, and the required per-record fields. A collector that silently emitted nothing, or dropped every record, would have kept CI green.

Both new steps copy the shape of the args_dump step beside them, including the manual_mode mapping that keeps only as only and otherwise uses include, since these steps own the whole corpus under their path.

docs/ci.md had recorded the omission as a fact — "Scope-stats has no dedicated CI smoke: its ordinary scene test stays in the main sweep, and artifact validation runs only when --enable-scope-stats is supplied explicitly." It now describes the step, and why scope-stats needed one for a different reason than the others: for the other four the dedicated step exists so coverage survives a case being marked manual, whereas here the scene test runs either way and only the artifact assertions were gated off.

Testing

  • check-yaml equivalent (yaml.safe_load) on both workflows; markdownlint-cli2 clean on docs/ci.md

  • Both new steps run exactly as the workflows invoke them, including --manual include:

    $ pytest tests/st/a2a3/tensormap_and_ringbuffer/dfx/scope_stats/ \
        --platform a2a3sim --device 0-15 -p no:xdist --pto-session-timeout 600 \
        --require-pto-isa --manual include --enable-scope-stats
    1 passed
    
    $ pytest tests/st/a5/tensormap_and_ringbuffer/dfx/scope_stats/ \
        --platform a5sim --device 0-15 -p no:xdist --pto-session-timeout 600 \
        --require-pto-isa --manual include --enable-scope-stats
    1 passed
  • The assertions are not vacuous — the validator checks record count, dropped == 0, schema and per-record fields, so the step fails if the collector stops producing.

This touches .github/workflows/_*.yml, which .claude/rules/ci-change-detection.md §2 keeps out of NON_CODE precisely so a CI-implementation change runs the whole matrix — including the two jobs this PR modifies.

`tests/st/{a2a3,a5}/tensormap_and_ringbuffer/dfx/scope_stats/` is the only test
of the scope-stats capture pipeline, and its artifact validation never ran in any
pipeline. `_validate_scope_stats_artifact` returns early unless
`--enable-scope-stats` is on (`test_scope_stats.py:117`), and no workflow or
action passed it — `grep -rn "scope_stats\|enable-scope-stats" .github/` came
back empty, while dep_gen, chip_swimlane, PMU and args_dump each own a dedicated
step in the same two workflows.

The scene half of that test did run: the class is an ordinary `SceneTestCase`, so
the main sweep compiled and ran its `vector_example` and checked the golden. What
never ran is the part that matters for this feature — the `scope_stats.jsonl`
assertions: at least four begin/end records, `dropped == 0`, the metadata schema,
and the required per-record fields. A collector that silently emitted nothing, or
dropped every record, would have kept CI green.

Both new steps copy the shape of the args_dump step beside them, including the
`manual_mode` mapping that keeps `only` as `only` and otherwise uses `include`,
since these steps own the whole corpus under their path.

`docs/ci.md` recorded the omission as a fact ("Scope-stats has no dedicated CI
smoke"). It now describes the step and why scope-stats needed one where the
others' reasoning does not apply: for the other four the dedicated step exists to
survive a case being marked manual, whereas here the scene test runs either way
and only the artifact assertions were gated off.

Verified by running both steps exactly as the workflows invoke them:

    pytest tests/st/a2a3/tensormap_and_ringbuffer/dfx/scope_stats/ \
      --platform a2a3sim --device 0-15 -p no:xdist --pto-session-timeout 600 \
      --require-pto-isa --manual include --enable-scope-stats
    1 passed

    pytest tests/st/a5/tensormap_and_ringbuffer/dfx/scope_stats/ \
      --platform a5sim ... --manual include --enable-scope-stats
    1 passed
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 79bd9e40-1f15-4726-acb2-6c2ef55e3bb7

📥 Commits

Reviewing files that changed from the base of the PR and between 66ba5c4 and 57285a6.

📒 Files selected for processing (3)
  • .github/workflows/_st-sim-a2a3.yml
  • .github/workflows/_st-sim-a5.yml
  • docs/ci.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The CI workflows add dedicated scope-stats smoke steps for A2A3 and A5. The CI documentation describes their mode selection and scope_stats.jsonl artifact validation.

Changes

Scope-stats CI coverage

Layer / File(s) Summary
Dedicated scope-stats smoke execution
.github/workflows/_st-sim-a2a3.yml, .github/workflows/_st-sim-a5.yml, docs/ci.md
The A2A3 and A5 workflows run the scope-stats suites when include_dfx_smokes is enabled. The steps enable scope-stat collection and preserve the manual_mode selection. The documentation describes scope_stats.jsonl validation.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 57285

This adds the missing scope-stats artifact checks to the two relevant CI workflows and documents the coverage change; no actionable merge-blocking risk remains after normal checks and review.

Poem

I’m a rabbit in the CI lane,
Scope stats hop through smoke-test rain.
A2A3 and A5 run bright,
JSONL checks confirm the flight.
“Only” or “include”—both paths are right!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the CI change: adding the missing DFX smoke step for scope-stats.
Description check ✅ Passed The description directly explains the missing artifact validation, workflow changes, documentation update, and testing performed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (3 skipped: 3 unsupported.)
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.

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.

@ChaoWao
ChaoWao merged commit f1542c3 into hw-native-sys:main Aug 24, 2026
20 checks passed
@ChaoWao
ChaoWao deleted the support/scope-stats-ci-smoke branch August 24, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant