Repository navigation
fix(input): reject mem_saver resets in SCF and relaxation - #8186
Open
Stardust0831 wants to merge 1 commit into
Open
Stardust0831 wants to merge 1 commit into
Stardust0831 wants to merge 1 commit into
Conversation
Stardust0831
marked this pull request as ready for review
October 20, 2026 13:26
This branch has not been deployed
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.
Replace silent correction of an invalid, explicitly specified INPUT parameter with a clear input error.
mem_saver=1currently becomes0for SCF and relaxation and execution continues; other integers are accepted despite the documented 0/1 choices. This PR rejects these inputs, reporting the supplied value, the legal value or corrective action, and the parameter manual link.#7719 tracks INPUT finalization that silently changes user-specified parameters and can make an explicit value behave differently from the equivalent default. Its central requirement is to preserve valid explicit input and replace silent correction of invalid or contradictory input with a clear error: name the offending parameters and values, explain the conflict, and provide legal values/corrective guidance and the relevant manual link. Intentional defaults for omitted parameters remain useful; they must not overwrite the user's explicit choices.
Linked Issue
Part of #7719. Independent of the other reset-cleanup PRs.
Unit Tests and/or Case Tests for my changes
Commands run with the GNU 13.4 conda toolchain on PATH,
LD_LIBRARY_PATH=/home/stardust/miniconda3/envs/phono3py/lib, andOMP_NUM_THREADS=1:Build and both CTest targets passed. Full-reader regressions cover eight invalid value/mode combinations, verify corrective diagnostics and the manual link, and cover default/zero values and PW/LCAO NSCF acceptance.
--check-inputwas run in eight case directories: SCF/relax with1and out-of-range-1/2exit 1; default, explicit0, PW NSCF1, and LCAO NSCF1exit 0. Version reportsv3.11.0-beta11; help and generated documentation contain the updated guidance (579 parameters, 37 categories). Validation uses a CPU/OpenMP build with MPI/LCAO backends disabled; MPI/GPU, numerical LCAO, and Wannier90 workflows were not run.What's changed?
mem_saverreset hook with a const validation hook.1forcalculation=scf/relaxand recommend0.to_w90_lcao_pw.cppalso consumes this option, so this change does not impose a new blanket LCAO rejection.Governance Notes
mem_savervalue and combination validation, diagnostics, and metadata updated. No documentation update required outside theInput_Itemregistration; generated YAML/Markdown are build artifacts.git diff --cached --checkandpython3 tools/03_code_analysis/agent_governance_check.py --staged --event-path /mnt/g/work/agent/abacus/issue-7719-pr-notes/mem-saver-event.json --format textpassed. Whole-file quality scores remain 0/0 (baseline 0/0); the existing large implementation/test files remain below 60, and these additions increase their length.