Repository navigation
fix(input): reject missing values for ordinary string parameters - #8216
Open
Stardust0831 wants to merge 1 commit into
Open
Stardust0831 wants to merge 1 commit into
Stardust0831 wants to merge 1 commit into
Conversation
ABACUS-PR-BOT
left a comment
Collaborator
There was a problem hiding this comment.
Static review at 294c777. No builds or runtime tests were run. One nonblocking integration suggestion follows.
AsTonyshment
approved these changes
Oct 26, 2026
AsTonyshment
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. CC: @mohanchen merge PR #8215 first, thanks!
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.
What's changed?
A supplied string parameter with no value, such as a bare
stru_file, can reach an unchecked first-token access; at EOF without a newline it can instead be silently ignored. Ordinary string readers now register the shared scalar contract, requiring exactly one token before their read callbacks run. Invalid input reports the parameter, expected value and manual link:The change applies through
read_sync_string, includingstru_file,kpoint_file,suffixanddft_functional. It also rejects extra tokens such asstru_file STRU extra, which were previously ignored. Omitted parameters retain their defaults; custom readers permitting empty values or multiple tokens keep their existing grammar.Linked Issue
Addresses the missing-value follow-up in #8192, continuing #7719.
Merge #8215 first so duplicate parameters at EOF use the shared MPI error broadcast.
Unit Tests and/or Case Tests for my changes
Passed: 44 reader/item tests, 30 help tests, three documentation-generator tests, 12 executable input checks, and serial/four-process Si SCF calculations. Coverage includes EOF, comments, extra tokens, explicit paths, omitted defaults, legal empty values and generated INPUT round trips.
The combined changes with #8215 also passed four-process reader checks for duplicate, missing and valid
suffixinput at EOF without a final newline; all four processes reached shutdown in each case.Build and test commands
SERIAL_BUILDandMPI_BUILDare Release builds with MPI disabled/enabled respectively. Both use GCC 13.4, OpenMP enabled, LCAO/ELPA/FLOAT_FFTW disabled, andOMP_NUM_THREADS=1at runtime. Executables reportv3.11.0-beta11.Successful MPI
--check-inputhas an existing finalization issue, so MPI executable checks use normal execution. Governance and whitespace checks passed.Governance Notes
The shared reader registration supplies the scalar contract, and the developer guide describes it. YAML export and reference generation succeeded for 590 parameters. The change is confined to input validation and its tests; no calculation modules are modified. No exceptions requested.