Rename some files and refactor some inclusions - #7796
Merged
Conversation
…ency Symptom: MODULE_RELAX_relax_new_relax failed. relax_step did nothing and all taud/latvec values stayed at their initial values. Root cause: Commit 977855a replaced the global PARAM.input in Test_RELAX with a local Input_para inp member, but missed three parameters that had been silently inherited from the global state. The inheritance worked because GoogleTest runs test suites in definition order: Test_SETGRAD runs first and leaves the following values in the global PARAM.input, which Test_RELAX reused without setting them: - calculation = cell-relax - force_thr = 0.001 - fixed_axes = a After the commit each test class has its own local inp, so this hidden sharing was lost: - calculation defaults to scf, so setup_gradient returns true immediately and relax_step does nothing. - force_thr defaults to -1, which changes line_search convergence behavior. - fixed_axes defaults to None, which skips the stress constraint branch and changes cell movement. Fix: Explicitly set the three previously-inherited parameters in Test_RELAX::SetUp(): inp.calculation = cell-relax; inp.force_thr = 0.001; inp.fixed_axes = a; Lessons learned: When removing a global-variable dependency, audit every field read by the code under test, including fields implicitly left behind by other test suites. Each test should be self-contained and not rely on inter-test-suite execution order.
19hello
approved these changes
Aug 11, 2026
added 3 commits
August 11, 2026 17:24
Resolve conflicts in psi_base.h and exx_lip.hpp: - psi_base.h: take upstream's minimal includes (forward declarations suffice) - exx_lip.hpp: keep PR deepmodeling#7796's removal of symmetry.h/stru_fac.h includes (after removing symm/sf constructor params), use psi_base.h (renamed from psi_initializer.h by upstream deepmodeling#7675) - Update 6 files in source_psi/ to use stru_fac.h instead of structure_factor.h (re-introduced by upstream deepmodeling#7675 merge)
# Conflicts: # source/source_esolver/esolver_fp.h # source/source_hamilt/module_surchem/test/CMakeLists.txt # source/source_hamilt/module_surchem/test/setcell.h # source/source_psi/test/psi_init_test.cpp # source/source_pw/module_pwdft/test/CMakeLists.txt
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.
Rename some files and refactor some inclusions