Skip to content

ci: Drive gem5 workflows with parallux#875

Open
tastynoob wants to merge 1 commit into
xs-devfrom
parallux-ci
Open

ci: Drive gem5 workflows with parallux#875
tastynoob wants to merge 1 commit into
xs-devfrom
parallux-ci

Conversation

@tastynoob

@tastynoob tastynoob commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Chores
    • Replaced the legacy autotest CI runner with a Parallux-driven workflow, removing the old autotest configs and scripts.
  • New Features
    • Added centralized checkpoint listings and Parallux-based runners for standard, “h”, vector, and smoke GEM5 test suites.
    • Introduced shared Parallux utilities for runner setup, workload scheduling, and environment handling to improve parallel test reliability and observability.

Review Change Stack

@tastynoob tastynoob requested a review from jensen-yan May 28, 2026 09:26
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR removes legacy autotest configs/scripts and adds Parallux-based workflow tooling: common orchestration utilities, static checkpoint/test lists, Parallux runner scripts for checkpoint/H/smoke/vector runs, and CI YAML updates to invoke the new runners.

Changes

Parallux-Based GEM5 Workflow Runners

Layer / File(s) Summary
Parallux orchestration utilities
.github/workflows/parallux_common.py
Foundation module providing shell-quoting, repo/gem5 path helpers, runner registration, environment export, and workload scheduling functions used by runner scripts.
Checkpoint and test definitions
.github/workflows/checkpoint_lists.py
Static data module defining GEM5_CHECKPOINTS, GEM5_H_CHECKPOINTS, and VECTOR_TESTS constants that specify checkpoint archive paths and vector-test patterns.
GEM5 checkpoint test runners
.github/workflows/gem5.py, .github/workflows/gem5_h.py
Parallux runners that construct per-checkpoint gem5 command lines (including difftest/restorer/restore flags) and schedule workloads across the checkpoint lists.
Smoke test and vector test runners
.github/workflows/gem5_smoke.py, .github/workflows/gem5_vec.py
Case-driven smoke-test runner with per-case env/command generation and a vector-test runner scheduling vector binaries via Parallux.
CI workflow YAML updates
.github/workflows/gem5.yml, .github/workflows/gem5-vector.yml
Replaces legacy autotest.py/cfg invocations with parallux commands that call the new Parallux runner scripts.

Sequence Diagram(s)

sequenceDiagram
  participant ComponentA
  participant ComponentB
  ComponentA->>ComponentB: observable interaction
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • OpenXiangShan/GEM5#856: Removes legacy .github/workflows/autotest/ configuration files and utilities similar to this migration.

Suggested reviewers

  • jensen-yan
  • jueshiwenli

Poem

🐰 From config nests I hop and peep,
Old autotest laid down to sleep,
Parallux hums and schedules play,
Checkpoints march and tests obey,
CI carrots line the path — hooray!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'ci: Drive gem5 workflows with parallux' directly and accurately describes the main change: migrating CI workflows from the previous autotest system to parallux-based execution.
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.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch parallux-ci

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/gem5.yml (1)

12-37: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Define explicit permissions for least-privilege GITHUB_TOKEN.

This workflow relies on default token permissions, which is broader than needed for these jobs.

🔒 Suggested fix
 name: gem5 Full Test (Tier 2 - Post-Merge)
+permissions:
+  contents: read
 
 on:
   push:
     branches: [ xs-dev ]

Also applies to: 65-102

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/gem5.yml around lines 12 - 37, Add an explicit
least-privilege permissions block for GITHUB_TOKEN (e.g., permissions: contents:
read) at the workflow root and/or per-job to replace the implicit default;
update the top-level workflow to include a permissions stanza and add the same
minimal permissions to the paralel_cpt_h_test job (and the other job block) so
the checkout and build steps (actions/checkout@v4,
./.github/actions/build-dramsim, and the Parallux runs) only get the privileges
they need.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/gem5-vector.yml:
- Around line 20-21: Add an explicit GitHub Actions permissions block to the
workflow and pin the token scope to read-only instead of using broad defaults:
add a top-level or job-level permissions section (target the job that contains
the "run vector test" step) and set the appropriate read-only scopes (for
example, permissions: contents: read and any other minimal read scopes required)
so the job only uses least-privilege credentials unless it explicitly needs
additional write or admin scopes.

---

Outside diff comments:
In @.github/workflows/gem5.yml:
- Around line 12-37: Add an explicit least-privilege permissions block for
GITHUB_TOKEN (e.g., permissions: contents: read) at the workflow root and/or
per-job to replace the implicit default; update the top-level workflow to
include a permissions stanza and add the same minimal permissions to the
paralel_cpt_h_test job (and the other job block) so the checkout and build steps
(actions/checkout@v4, ./.github/actions/build-dramsim, and the Parallux runs)
only get the privileges they need.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4d80d73a-8da3-486f-a22d-f0f8ff0d2d0f

📥 Commits

Reviewing files that changed from the base of the PR and between 33792f5 and a9d6f26.

📒 Files selected for processing (13)
  • .github/workflows/autotest/gem5-h.cfg
  • .github/workflows/autotest/gem5-vec.cfg
  • .github/workflows/autotest/gem5.cfg
  • .github/workflows/autotest/script/autotest.py
  • .github/workflows/autotest/script/utils.py
  • .github/workflows/checkpoint_lists.py
  • .github/workflows/gem5-vector.yml
  • .github/workflows/gem5.py
  • .github/workflows/gem5.yml
  • .github/workflows/gem5_h.py
  • .github/workflows/gem5_smoke.py
  • .github/workflows/gem5_vec.py
  • .github/workflows/parallux_common.py
💤 Files with no reviewable changes (5)
  • .github/workflows/autotest/gem5-h.cfg
  • .github/workflows/autotest/gem5.cfg
  • .github/workflows/autotest/script/autotest.py
  • .github/workflows/autotest/gem5-vec.cfg
  • .github/workflows/autotest/script/utils.py

Comment on lines 20 to +21
- name: run vector test
run: python3 .github/workflows/autotest/script/autotest.py -f .github/workflows/autotest/gem5-vec.cfg
run: parallux .github/workflows/gem5_vec.py

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add explicit workflow permissions to avoid broad defaults.

Please pin token scope to read-only unless a job explicitly needs more.

🔒 Suggested fix
 name: gem5 Vector Test (Tier 2 - Post-Merge)
+permissions:
+  contents: read
 
 on:
   push:
     branches: [ xs-dev ]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/gem5-vector.yml around lines 20 - 21, Add an explicit
GitHub Actions permissions block to the workflow and pin the token scope to
read-only instead of using broad defaults: add a top-level or job-level
permissions section (target the job that contains the "run vector test" step)
and set the appropriate read-only scopes (for example, permissions: contents:
read and any other minimal read scopes required) so the job only uses
least-privilege credentials unless it explicitly needs additional write or admin
scopes.

@github-actions

Copy link
Copy Markdown

🚀 Coremark Smoke Test Results

Branch IPC Change
Base (xs-dev) 2.3123 -
This PR 2.3123 ➡️ 0.0000 (0.00%)

✅ Difftest smoke test passed!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/gem5.yml (1)

12-37: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Set explicit least-privilege GitHub token permissions for this workflow.

This workflow relies on default GITHUB_TOKEN permissions, which are broader than needed for these jobs.

🔐 Proposed fix
 name: gem5 Full Test (Tier 2 - Post-Merge)

 on:
   push:
     branches: [ xs-dev ]
   # Removed pull_request trigger - moved to pr-quick-check.yml (Tier 1)
   # can be triggered manually
   workflow_dispatch:
+
+permissions:
+  contents: read

Also applies to: 65-66, 77-78, 90-91, 102-103

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/gem5.yml around lines 12 - 37, Add explicit
least-privilege GITHUB_TOKEN permissions at the top of the workflow (or per-job)
instead of relying on defaults: add a permissions: block that grants only what's
required (for these jobs that only checkout code and run builds/tests, typically
permissions: contents: read and actions: read are sufficient) and remove broader
defaults; apply this change for the job that runs "parallux
.github/workflows/gem5.py" and for the job "paralel_cpt_h_test" (and any similar
jobs that run "parallux .github/workflows/gem5_h.py") so each job declares the
minimal permissions it needs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/parallux_common.py:
- Line 62: The call to goal.setParallel currently treats falsy values like 0 as
unset because it uses "parallel or ..."; change it to explicitly check for None
so callers can pass 0 intentionally: compute the value as (parallel if parallel
is not None else max_jobs * len(runner_specs)) and pass that into
goal.setParallel, keeping the variable names parallel, max_jobs, runner_specs
and the target function goal.setParallel to locate the change.

---

Outside diff comments:
In @.github/workflows/gem5.yml:
- Around line 12-37: Add explicit least-privilege GITHUB_TOKEN permissions at
the top of the workflow (or per-job) instead of relying on defaults: add a
permissions: block that grants only what's required (for these jobs that only
checkout code and run builds/tests, typically permissions: contents: read and
actions: read are sufficient) and remove broader defaults; apply this change for
the job that runs "parallux .github/workflows/gem5.py" and for the job
"paralel_cpt_h_test" (and any similar jobs that run "parallux
.github/workflows/gem5_h.py") so each job declares the minimal permissions it
needs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 88871700-3a09-4d02-850b-eb5b9ea57073

📥 Commits

Reviewing files that changed from the base of the PR and between a9d6f26 and 575108f.

📒 Files selected for processing (13)
  • .github/workflows/autotest/gem5-h.cfg
  • .github/workflows/autotest/gem5-vec.cfg
  • .github/workflows/autotest/gem5.cfg
  • .github/workflows/autotest/script/autotest.py
  • .github/workflows/autotest/script/utils.py
  • .github/workflows/checkpoint_lists.py
  • .github/workflows/gem5-vector.yml
  • .github/workflows/gem5.py
  • .github/workflows/gem5.yml
  • .github/workflows/gem5_h.py
  • .github/workflows/gem5_smoke.py
  • .github/workflows/gem5_vec.py
  • .github/workflows/parallux_common.py
💤 Files with no reviewable changes (5)
  • .github/workflows/autotest/gem5-vec.cfg
  • .github/workflows/autotest/gem5-h.cfg
  • .github/workflows/autotest/script/autotest.py
  • .github/workflows/autotest/gem5.cfg
  • .github/workflows/autotest/script/utils.py
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/checkpoint_lists.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/gem5-vector.yml

raise RuntimeError("runners must not be empty")

goal.setRunner(runner_specs)
goal.setParallel(parallel or max_jobs * len(runner_specs))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Respect explicit parallel=0 instead of falling back.

Line 62 currently treats 0 as “unset” because of or, so callers cannot intentionally pass 0 (or any other falsy value) through. Use an explicit None check.

Suggested fix
-    goal.setParallel(parallel or max_jobs * len(runner_specs))
+    goal.setParallel(parallel if parallel is not None else max_jobs * len(runner_specs))
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
goal.setParallel(parallel or max_jobs * len(runner_specs))
goal.setParallel(parallel if parallel is not None else max_jobs * len(runner_specs))
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/parallux_common.py at line 62, The call to
goal.setParallel currently treats falsy values like 0 as unset because it uses
"parallel or ..."; change it to explicitly check for None so callers can pass 0
intentionally: compute the value as (parallel if parallel is not None else
max_jobs * len(runner_specs)) and pass that into goal.setParallel, keeping the
variable names parallel, max_jobs, runner_specs and the target function
goal.setParallel to locate the change.

@github-actions

Copy link
Copy Markdown

🚀 Coremark Smoke Test Results

Branch IPC Change
Base (xs-dev) 2.3170 -
This PR 2.3170 ➡️ 0.0000 (0.00%)

✅ Difftest smoke test passed!

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