Skip to content

feat(skills): add dpgen-run skill for concurrent learning workflow - #1885

Draft
SchrodingersCattt wants to merge 9 commits into
deepmodeling:masterfrom
SchrodingersCattt:feat/add-dpgen-run-skill
Draft

feat(skills): add dpgen-run skill for concurrent learning workflow#1885
SchrodingersCattt wants to merge 9 commits into
deepmodeling:masterfrom
SchrodingersCattt:feat/add-dpgen-run-skill

Conversation

@SchrodingersCattt

@SchrodingersCattt SchrodingersCattt commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Documentation

    • Added a comprehensive guide for running DP-GEN concurrent-learning workflows, including param.json and machine.json configuration, setup requirements, runtime environments, validation steps, expected outputs, and configuration guidance.
    • Documented training, exploration, first-principles, descriptor, input-format, machine-configuration, authorization, and option-preservation requirements.
  • Tests

    • Added checks ensuring documentation links resolve to valid repository resources.
    • Added validation for machine configuration examples, required workflow stages, resource settings, and execution commands.
    • Enabled standalone execution of the documentation validation tests.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds DP-GEN workflow documentation for separate param.json and machine.json files. It defines preparation, authorization, validation, execution, reporting, configuration guardrails, reference links, and machine-schema tests.

Changes

DP-GEN Run Skill

Layer / File(s) Summary
Skill overview and execution rules
skills/dpgen-run/SKILL.md
Defines workflow scope, the two-file configuration contract, agent responsibilities, execution boundaries, descriptor guidance, environment handling, and configuration guardrails.
Workflow inputs and configuration contract
skills/dpgen-run/SKILL.md
Specifies required system, training, exploration, first-principles, and execution inputs. It defines the contents of param.json and the stage-specific machine.json blocks.
Pre-run validation and output reporting
skills/dpgen-run/SKILL.md
Adds ordered validation steps and defines required configuration paths, commands, checklists, unresolved fields, and post-execution reporting.
References and machine schema validation
skills/dpgen-run/SKILL.md, tests/test_dpgen_run_skill.py
Adds repository and external references. Tests validate repository-relative links and machine-example schemas before and after convert_mdata.

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a dpgen-run skill for concurrent-learning workflows.
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.

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.

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.81%. Comparing base (66232e5) to head (91ecc42).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1885   +/-   ##
=======================================
  Coverage   49.80%   49.81%           
=======================================
  Files          83       83           
  Lines       14986    14986           
=======================================
+ Hits         7464     7465    +1     
+ Misses       7522     7521    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

🤖 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 `@skills/dpgen-run/SKILL.md`:
- Around line 325-357: The numbered checklist in SKILL.md after step 4 uses "1."
for four subsequent items; update those list markers to continue the sequence as
steps 5, 6, 7, and 8 (i.e., change the four "1." occurrences following "verify
`type_map.raw` content matches `param.json` `type_map` ordering" to "5.", "6.",
"7.", and "8.") so the validation steps read as a proper ordered sequence.
- Around line 104-116: Update the descriptor/backend guidance text to remove the
incorrect absolute claim that "dpgen (v0.13.x) only supports the TensorFlow
backend" and instead state that the codebase includes both train_backend values
"tensorflow" and "pytorch", so backend support may include PyTorch; soften the
PyTorch-only wording by either citing the authoritative source or rephrasing to
say users requiring PyTorch-only models or DPA-2/DPA-3 should prefer dpgen2;
keep the descriptor recommendations for se_e2_a, se_atten, and se_atten_v2
(spell se_atten_v2 exactly) and add a short note that users should verify
backend/descriptor compatibility against the repo's train_backend options
("tensorflow", "pytorch") if unsure.
- Around line 369-384: Update the guardrail text in SKILL.md so it no longer
requires specifically "[]" for training.training_data.systems; instead state
that training.training_data.systems should be left unset or empty (dpgen fills
it) — reference dpgen/generator/run.py behavior and the default_training_param
name when editing the rule text to mention both unset or empty as acceptable.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5b559805-4192-4c79-acde-08145257e989

📥 Commits

Reviewing files that changed from the base of the PR and between 66232e5 and 841acda.

📒 Files selected for processing (1)
  • skills/dpgen-run/SKILL.md

Comment thread skills/dpgen-run/SKILL.md Outdated
Comment thread skills/dpgen-run/SKILL.md
Comment thread skills/dpgen-run/SKILL.md

@coderabbitai coderabbitai 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.

Caution

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

⚠️ Outside diff range comments (1)
skills/dpgen-run/SKILL.md (1)

341-346: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use the configured init_data_prefix here.

The validation example hardcodes init_data/, which conflicts with the earlier init_data_prefix input and will mislead users whose project layout uses a different prefix.

🛠 Suggested fix
- ls init_data/*/type_map.raw
+ ls "${init_data_prefix}"*/type_map.raw
🤖 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 `@skills/dpgen-run/SKILL.md` around lines 341 - 346, In the validation example
in the SKILL.md file around lines 341-346, the bash command uses a hardcoded
directory path `init_data/` instead of the configurable `init_data_prefix` value
that was introduced earlier in the documentation. Replace the hardcoded
`init_data/` reference in the ls command with the appropriate placeholder or
variable reference that represents the configured `init_data_prefix`, so the
example remains consistent with the actual configuration users provide and
doesn't mislead them into using incorrect paths.
🤖 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.

Outside diff comments:
In `@skills/dpgen-run/SKILL.md`:
- Around line 341-346: In the validation example in the SKILL.md file around
lines 341-346, the bash command uses a hardcoded directory path `init_data/`
instead of the configurable `init_data_prefix` value that was introduced earlier
in the documentation. Replace the hardcoded `init_data/` reference in the ls
command with the appropriate placeholder or variable reference that represents
the configured `init_data_prefix`, so the example remains consistent with the
actual configuration users provide and doesn't mislead them into using incorrect
paths.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d8abfb50-acd6-4802-baac-90db57a1cd18

📥 Commits

Reviewing files that changed from the base of the PR and between 841acda and 39adc8f.

📒 Files selected for processing (1)
  • skills/dpgen-run/SKILL.md

@coderabbitai coderabbitai 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.

Caution

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

⚠️ Outside diff range comments (1)
skills/dpgen-run/SKILL.md (1)

71-72: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add explicit user confirmation requirement before auto-executing dpgen run.

The agent responsibilities include "validate the workflow before execution" and "provide the exact command for running," but lack an explicit requirement to ask the user for confirmation before actually executing the command. This creates an autonomous execution path without user verification—a concern flagged by the SkillSpector analyzer (EA2: Excessive Agency).

To mitigate this risk, either:

  1. Add a new responsibility step: "ask the user for explicit confirmation before executing the command," or
  2. Add a guardrail: "Never auto-execute dpgen run without explicit user confirmation after validation."

This ensures the agent validates thoroughly but defers the final execution decision to the user.

💡 Suggested additions

Add to agent responsibilities (after line 72):

 1. validate the workflow before execution
 1. provide the exact command for running
+1. ask the user for explicit confirmation before executing

Or add to guardrails section (after line 384):

 - Do not assume outer-shell activation is inherited by stage jobs; for scheduler execution, require explicit `source_list` per stage.
+- Never auto-execute `dpgen run param.json machine.json` without explicit user confirmation after validation passes.
🤖 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 `@skills/dpgen-run/SKILL.md` around lines 71 - 72, The SKILL.md file lacks an
explicit requirement for user confirmation before executing the dpgen run
command, creating a potential autonomous execution risk. Add either a new
responsibility item after line 72 that states "ask the user for explicit
confirmation before executing the command," or add a guardrail in the guardrails
section (after line 384) that states "Never auto-execute dpgen run without
explicit user confirmation after validation." This ensures the agent validates
the workflow and provides the command but defers the final execution decision to
the user for explicit approval.

Source: Linters/SAST tools

🤖 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.

Outside diff comments:
In `@skills/dpgen-run/SKILL.md`:
- Around line 71-72: The SKILL.md file lacks an explicit requirement for user
confirmation before executing the dpgen run command, creating a potential
autonomous execution risk. Add either a new responsibility item after line 72
that states "ask the user for explicit confirmation before executing the
command," or add a guardrail in the guardrails section (after line 384) that
states "Never auto-execute dpgen run without explicit user confirmation after
validation." This ensures the agent validates the workflow and provides the
command but defers the final execution decision to the user for explicit
approval.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5b543243-4fa4-4894-b52d-054cefc40be9

📥 Commits

Reviewing files that changed from the base of the PR and between 39adc8f and f1ee958.

📒 Files selected for processing (1)
  • skills/dpgen-run/SKILL.md

@njzjz-bot njzjz-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: Changes requested. This draft skill references resources that are not included, does not require explicit user authorization before launching an expensive DP-GEN/HPC workflow, and contains two hard requirements that do not match current dpdispatcher behavior. CI passes, but it does not validate relative resource links or the instructions against the real schema.

Note: The Codex quota is about to reset, so I am using the remaining tokens to review all open PRs in this repository.

Coding agent: Codex
Codex version: codex-cli 0.144.6
Model: gpt-5.6-sol
Reasoning effort: xhigh

Comment thread skills/dpgen-run/SKILL.md
1. generate or patch `machine.json`
1. explain important parameters in plain language when asked
1. validate the workflow before execution
1. provide the exact command for running

@njzjz-bot njzjz-bot Aug 10, 2026

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.

[Blocking] This skill covers both preparation/explanation and execution, while dpgen run can submit substantial HPC and first-principles workloads. Please state explicitly that the agent may execute dpgen run only when the user has requested execution and confirmed the validated command. Requiring validation and providing the command does not by itself prevent autonomous execution.

Comment thread skills/dpgen-run/SKILL.md Outdated

Use these bundled files:

- `assets/param.template.json`

@njzjz-bot njzjz-bot Aug 10, 2026

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.

[Blocking] This PR changes only SKILL.md, but the six assets/* files and four references/* files referenced here and above are not included. Following the skill will fail as soon as it attempts to read a template. Add all referenced resources, or point to real repository examples/docs, and add a check that every repository-relative link in the skill exists.

Comment thread skills/dpgen-run/SKILL.md Outdated
- Keep `type_map` ordering consistent with `init_data_sys` type_map.raw files.
- If required inputs are missing, stop and ask instead of guessing.
- Always spell `se_atten_v2` correctly (not `se_attn_v2`).
- Always include `remote_root` in machine config — it is mandatory even for local execution.

@njzjz-bot njzjz-bot Aug 10, 2026

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 absolute requirement is inaccurate. remote_root is optional in the dpdispatcher schema, and whether it is needed depends on the context; some lazy/local execution paths can omit it. Please describe the requirement by context_type so the skill does not rewrite an existing working local configuration.

Comment thread skills/dpgen-run/SKILL.md Outdated
- If required inputs are missing, stop and ask instead of guessing.
- Always spell `se_atten_v2` correctly (not `se_attn_v2`).
- Always include `remote_root` in machine config — it is mandatory even for local execution.
- Always capitalize `batch_type` values: `"Shell"`, `"Slurm"`, `"PBS"`.

@njzjz-bot njzjz-bot Aug 10, 2026

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 casing rule is also inaccurate. dpdispatcher registers canonical names and lowercase aliases, and repository configurations/tests use "shell". Please advise users to use a value accepted by the installed dpdispatcher version and preserve an existing working value instead of claiming lowercase values always fail.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 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 `@skills/dpgen-run/SKILL.md`:
- Line 269: Update the machine-example links near the existing local example
references so they point to examples matching the schema produced by
convert_mdata, or document the required version-specific mapping for legacy
flattened fields. Ensure nested train, model_devi, and fp blocks are represented
and validate both linked examples with the current parser.

In `@tests/test_dpgen_run_skill.py`:
- Around line 16-18: Update the link validation around target_path to resolve
each target and reject it unless it remains inside repository_root, before
checking whether it exists. Preserve the existing missing-target collection
behavior for paths within the repository, including fragment-stripped targets.
🪄 Autofix

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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 573c066c-6d3e-4621-bb80-4e9a704fdb4e

📥 Commits

Reviewing files that changed from the base of the PR and between f1ee958 and ae2c345.

📒 Files selected for processing (2)
  • skills/dpgen-run/SKILL.md
  • tests/test_dpgen_run_skill.py

Comment thread skills/dpgen-run/SKILL.md Outdated
Comment thread tests/test_dpgen_run_skill.py Outdated

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 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 `@tests/test_dpgen_run_skill.py`:
- Around line 35-48: Update test_linked_machine_examples_use_current_schema to
derive its machine JSON targets by extracting the documented
examples/machine/*.json links from skills/dpgen-run/SKILL.md, then validate
those resolved paths instead of maintaining the hard-coded DeePMD-kit entries.
Reuse the existing link-parsing approach in the test module if available.
- Around line 50-60: Strengthen the test around convert_mdata by validating each
input stage’s machine and resources are non-empty dictionaries and command is a
non-empty string before conversion, including assertions for the required
machine/resource fields. Retain the existing converted-key checks, and add
assertions that converted stage values preserve the expected nested types and
non-empty command.
🪄 Autofix

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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6b3443ba-c98f-4054-b828-b7253907815d

📥 Commits

Reviewing files that changed from the base of the PR and between ae2c345 and 730249a.

📒 Files selected for processing (2)
  • skills/dpgen-run/SKILL.md
  • tests/test_dpgen_run_skill.py

Comment thread tests/test_dpgen_run_skill.py Outdated
Comment thread tests/test_dpgen_run_skill.py
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.

2 participants