Repository navigation
fix(input): reject PW gamma_only without rewriting KPT - #8184
Closed
Stardust0831 wants to merge 2 commits into
Closed
Stardust0831 wants to merge 2 commits into
Stardust0831 wants to merge 2 commits into
Conversation
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.
Closed after reviewing the intended INPUT semantics.
gamma_only=1has also served as a convenient request for Gamma-point sampling without a separate KPT file. Rejecting that request outright for PW would remove an existing user workflow; a reset audit alone does not establish that the input is invalid. Any future change should distinguish the sampling request from the internal algorithm choice and protect user-supplied KPT contents.The magnetic-mixing fix in #8185 and the focused
mem_savervalidation in #8186 remain separate draft PRs. #7719 remains open for further reset auditing and standardized value/dependency validation.Replace silent correction of an invalid, explicitly specified INPUT parameter with a clear input error. With
basis_type=pw,gamma_only=1currently becomes0and ABACUS creates or overwrites KPT before continuing. This PR stops instead, reports the supplied value and the requiredgamma_only=0, gives a Gamma-mesh example and manual link, and preserves KPT.#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.
Unit Tests and/or Case Tests for my changes
Commands run with
OMP_NUM_THREADS=1andLD_LIBRARY_PATH=/home/stardust/miniconda3/envs/phono3py/lib(GNU 13.4, CPU/OpenMP, MPI and LCAO numerical backends disabled):Build and both CTest targets passed. The new reader regression checks rejected PW input with an existing and an absent KPT, asserts file preservation, and checks the diagnostic. Supported PW and LCAO inputs also pass.
--check-inputwas run from six valid case directories: PW1with/without KPT exits 1; PW default/0and LCAO1withnspin=1/2exit 0. KPT contents/existence remain unchanged in all six cases. Executable reportsv3.11.0-beta11; help and generated Markdown include the updated behavior (579 parameters, 37 categories). MPI/GPU and numerical LCAO calculations were not run: this change is in the shared input reader.The shipped PW cases now explicitly use
gamma_only=0and supply their single-Gamma KPT. The five regression meshes and all numerical reference files are unchanged; four example directories that previously relied on implicit KPT creation now include that file.Additional fixture verification (same toolchain environment), from
/tmp/abacus-7719-gamma-fixtures/tests/01_PWcontaining copies of the updated cases:bash ../integrate/Autotest.sh -a /tmp/abacus-7719-small-pr-build/abacus_pw_omp -n 0 -o 1 -j 1 -r '^(027_PW_PINT_RKS|028_PW_PINT_UKS)$' -f CASES_CPU.txtBoth previously failing PW numerical cases passed all four energy/reference checks with the existing
1e-7 eVtolerance. Both focused CTest targets also passed after the migration.--check-inputpassed for eight updated INPUT files and preserved their KPT files. Three DeePKS test INPUTs reached the expected local-build limitation (please compile with DeePKS); they require the ML-enabled CI build. A scan of shipped INPUT files in tests/examples/source found no remainingbasis_type=pwwithgamma_only=1.What's changed?
nspin=4rejection.gamma_only=0and a1 1 1 0 0 0Gamma mesh in KPT.gamma_onlyregistration metadata and focused reader tests. Other reset cases in Audit INPUT reset semantics and formalize final parameter validation #7719 are outside this small PR.Governance Notes
gamma_onlyvalidation, diagnostics, and registration 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/gamma-event.json --format textpassed. Whole-file quality scoring reports 13/0 for the touched implementation/test files (baseline 0/0); these existing oversized files remain below 60.