Skip to content

Reject negative DeePKS output frequency - #7740

Merged
mohanchen merged 1 commit into
deepmodeling:developfrom
Stardust0831:fix/validate-deepks-output-frequency
Aug 1, 2026
Merged

Reject negative DeePKS output frequency#7740
mohanchen merged 1 commit into
deepmodeling:developfrom
Stardust0831:fix/validate-deepks-output-frequency

Conversation

@Stardust0831

Copy link
Copy Markdown
Collaborator

Reminder

  • I have read AGENTS.md and docs/developers_guide/agent_governance.md.
  • I have linked the reset audit issue and the original feature PR.
  • I have added focused real-INPUT regression coverage.
  • I have listed the verification results below.
  • I have described the deepks_out_freq_elec behavior change.
  • Core-module impact is limited to source_io input validation and tests.
  • No governance exception is requested.

Linked Issue

Related to #7719. Follow-up to the deepks_out_freq_elec feature introduced in #6325.

Unit Tests and/or Case Tests for my changes

  • Before the change, the regression test showed that deepks_out_freq_elec -1 was accepted and silently rewritten to 0.
  • MODULE_IO_read_input_serial and MODULE_IO_read_item_serial pass.
  • Real-INPUT coverage verifies omitted/default zero, explicit zero, negative rejection, the existing missing-deepks_out_base diagnostic, and preservation of a positive frequency through to the existing DeePKS build guard.
  • git diff --check passes.
  • No DeePKS runtime case was run. This PR does not change enabled-path output cadence; the focused input test verifies the existing feature guard without pretending DeePKS is enabled.

What changed?

When an INPUT file specified a negative deepks_out_freq_elec, the reset callback silently changed it to 0. Because zero disables per-electronic-step DeePKS output, an invalid or mistyped negative value looked like an intentional request to disable the feature.

This PR removes that silent reset and rejects negative values with a direct diagnostic. Omitted and explicit zero remain valid, and positive values retain the existing deepks_out_base and deepks_out_labels requirements. Other DeePKS resets and output cadence logic are unchanged.

Governance Notes

  • INPUT/docs changes: no generated documentation change is needed. Parameter type, default, description, and availability are unchanged; the existing metadata already describes operation only for positive frequencies.
  • Core module impact: limited to source_io input validation and focused tests. DeePKS runtime calculations and output cadence are unchanged.
  • Exceptions requested: none.

@AsTonyshment AsTonyshment left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. Negative deepks_out_freq_elec values are now rejected instead of being silently rewritten to zero, while the existing disabled and positive-frequency behavior remains unchanged.

@mohanchen mohanchen added Refactor Refactor ABACUS codes Input&Output Suitable for coders without knowing too many DFT details labels Aug 1, 2026
@mohanchen
mohanchen merged commit 4a86b41 into deepmodeling:develop Aug 1, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Input&Output Suitable for coders without knowing too many DFT details Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants