Reject negative DeePKS output frequency - #7740
Merged
mohanchen merged 1 commit intoAug 1, 2026
Merged
Conversation
AsTonyshment
approved these changes
Aug 1, 2026
AsTonyshment
left a comment
Collaborator
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reminder
AGENTS.mdanddocs/developers_guide/agent_governance.md.deepks_out_freq_elecbehavior change.source_ioinput validation and tests.Linked Issue
Related to #7719. Follow-up to the
deepks_out_freq_elecfeature introduced in #6325.Unit Tests and/or Case Tests for my changes
deepks_out_freq_elec -1was accepted and silently rewritten to0.MODULE_IO_read_input_serialandMODULE_IO_read_item_serialpass.deepks_out_basediagnostic, and preservation of a positive frequency through to the existing DeePKS build guard.git diff --checkpasses.What changed?
When an INPUT file specified a negative
deepks_out_freq_elec, the reset callback silently changed it to0. 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_baseanddeepks_out_labelsrequirements. Other DeePKS resets and output cadence logic are unchanged.Governance Notes
source_ioinput validation and focused tests. DeePKS runtime calculations and output cadence are unchanged.