Skip to content

Add machine-readable scenario summary report#919

Open
shreyaskommuri wants to merge 5 commits into
NVIDIA:mainfrom
shreyaskommuri:issue/machine-readable-summary
Open

Add machine-readable scenario summary report#919
shreyaskommuri wants to merge 5 commits into
NVIDIA:mainfrom
shreyaskommuri:issue/machine-readable-summary

Conversation

@shreyaskommuri

Copy link
Copy Markdown
Contributor

Summary

  • Adds a default summary scenario reporter that writes cloudai-summary.json next to the existing scenario reports.
  • Includes scenario name/status, system metadata, result directory, scenario-level report artifacts, per-test-run status, output paths, artifacts, and metrics already exposed through configured metric reporters.
  • Registers the reporter by default and keeps tarball as the final scenario reporter.

Fixes #917.

Test Plan

Environment:

  • macOS
  • Python 3.10.20 via uv run

Commands and results:

$ uv run ruff check src/cloudai/reporter.py src/cloudai/registration.py src/cloudai/_core/registry.py src/cloudai/core.py tests/test_reporter.py tests/test_init.py
All checks passed!
$ uv run ruff format --check src/cloudai/reporter.py src/cloudai/registration.py src/cloudai/_core/registry.py src/cloudai/core.py tests/test_reporter.py tests/test_init.py
6 files already formatted
$ uv run pytest tests/test_reporter.py tests/test_init.py tests/test_registry.py
60 passed in 0.43s
$ uv run pytest
1573 passed, 4 skipped, 463 deselected in 5.14s

Additional Notes

  • This keeps existing HTML, tarball, comparison, and workload-specific reports unchanged.
  • The summary intentionally uses metrics CloudAI already exposes through each test run's configured metric reporter, so this PR adds a stable automation artifact without introducing new workload-specific parsing logic.

Generate cloudai-summary.json as a default scenario reporter so automation can discover scenario status, report artifacts, test run artifacts, and configured metrics without scraping workload-specific files.

Issue: NVIDIA#917

Tested: uv run ruff check src/cloudai/reporter.py src/cloudai/registration.py src/cloudai/_core/registry.py src/cloudai/core.py tests/test_reporter.py tests/test_init.py

Tested: uv run ruff format --check src/cloudai/reporter.py src/cloudai/registration.py src/cloudai/_core/registry.py src/cloudai/core.py tests/test_reporter.py tests/test_init.py

Tested: uv run pytest
Signed-off-by: shreyaskommuri <shreyaskommuri@gmail.com>
@coderabbitai

coderabbitai Bot commented Jun 9, 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: Enterprise

Run ID: 03018a0f-256f-4c8f-a6c2-b673f3d430cf

📥 Commits

Reviewing files that changed from the base of the PR and between dfa28da and 008e5d4.

📒 Files selected for processing (2)
  • src/cloudai/registration.py
  • tests/test_init.py

📝 Walkthrough

Walkthrough

Adds SummaryReporter to generate cloudai-summary.json, registers and exports it, updates report ordering to place summary before tarball, and extends tests for registry ordering and JSON summary contents.

Changes

Summary reporter and registry integration

Layer / File(s) Summary
SummaryReporter implementation
src/cloudai/reporter.py
Adds SummaryReporter to generate cloudai-summary.json with scenario metadata, artifact discovery, per-test-run summaries, DSE sweep nesting, and metric filtering that skips METRIC_ERROR.
Public export and registration
src/cloudai/core.py, src/cloudai/registration.py, src/cloudai/_core/registry.py
Exports SummaryReporter from cloudai.core, registers an enabled "summary" scenario report, and updates scenario report ordering so summary sorts before tarball.
Registry and summary output tests
tests/test_init.py, tests/test_reporter.py
Updates registry expectations to include summary, and adds a JSON test that runs SummaryReporter.generate() and asserts the emitted summary structure, artifacts, and metrics.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through JSON, neat and bright,
With summary trails in morning light.
A tarball last, a summary first,
For tools to sip when files are nursed.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: adding a machine-readable scenario summary report.
Description check ✅ Passed The description directly describes adding the summary reporter and its JSON artifact.
Linked Issues check ✅ Passed The changes implement the requested stable machine-readable summary artifact and include the core fields from #917.
Out of Scope Changes check ✅ Passed The diff stays focused on the summary reporter, registration, exports, and related tests.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment thread tests/test_reporter.py Outdated
Comment thread src/cloudai/reporter.py Outdated
Comment thread src/cloudai/reporter.py

return [
self._artifact(path)
for path in sorted(self.results_root.iterdir())

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.

this won't work gracefully when we run sweeping. in the sweeping case, the folders structure will be

/scenario foler/
               /case 1/
                      /sweep 1/
                              /some-report.html
                      /sweep 2/
                              /some-report.html

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.

sweeping is actually quite important in our work. I believe this json summary report should bring insights if those were run

shreyaskommuri and others added 2 commits June 12, 2026 11:10
Trim the default scenario summary to the fields external tools need and group DSE/sweep outputs under their parent test run so nested sweep artifacts remain discoverable.

Constraint: Reviewer requested a smaller JSON surface, a full-object regression assertion, and sweep-aware artifact reporting.

Rejected: Keeping iteration, step, description, schema_version, and system metadata in the first summary contract | they widen the surface before consumers have asked for them.

Confidence: high

Scope-risk: narrow

Directive: Treat cloudai-summary.json as an automation entry point; add fields only when they have clear consumer value.

Tested: uv run ruff check src/cloudai/reporter.py tests/test_reporter.py tests/test_init.py src/cloudai/registration.py src/cloudai/_core/registry.py src/cloudai/core.py

Tested: uv run ruff format --check src/cloudai/reporter.py tests/test_reporter.py tests/test_init.py src/cloudai/registration.py src/cloudai/_core/registry.py src/cloudai/core.py

Tested: uv run pytest tests/test_reporter.py tests/test_init.py tests/test_registry.py -q

Tested: uv run pytest -q

Not-tested: Live CloudAI sweep run on an HPC system.
@shreyaskommuri

Copy link
Copy Markdown
Contributor Author

Addressed the requested changes and updated the PR branch from latest main.

What changed:

  • Replaced the summary reporter regression with a full-object JSON assert.
  • Trimmed the first summary contract to the minimum useful automation fields: scenario, status, result_dir, reports, and test_runs.
  • Grouped DSE/sweep outputs under their parent test run via a sweeps list, including case-level artifacts such as trajectory.csv and per-sweep nested report artifacts.

Validation on the updated PR head dfa28da:

  • uv run ruff check src/cloudai/reporter.py tests/test_reporter.py tests/test_init.py src/cloudai/registration.py src/cloudai/_core/registry.py src/cloudai/core.py -> passed
  • uv run ruff format --check src/cloudai/reporter.py tests/test_reporter.py tests/test_init.py src/cloudai/registration.py src/cloudai/_core/registry.py src/cloudai/core.py -> passed
  • uv run pytest tests/test_reporter.py tests/test_init.py tests/test_registry.py -q -> 60 passed
  • uv run pytest -q -> 1599 passed, 4 skipped, 476 deselected

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.

Add a stable machine-readable summary artifact for generated scenario reports

2 participants