Skip to content

Rename some files and refactor some inclusions - #7796

Merged
mohanchen merged 10 commits into
deepmodeling:developfrom
mohanchen:2026-08-10
Aug 12, 2026
Merged

Rename some files and refactor some inclusions#7796
mohanchen merged 10 commits into
deepmodeling:developfrom
mohanchen:2026-08-10

Conversation

@mohanchen

Copy link
Copy Markdown
Collaborator

Rename some files and refactor some inclusions

@mohanchen mohanchen added Refactor Refactor ABACUS codes The Absolute Zero Reduce the "entropy" of the code to 0 labels Aug 10, 2026
@mohanchen
mohanchen requested a review from Critsium-xy August 10, 2026 15:16
abacus_fixer and others added 3 commits August 11, 2026 12:17
…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.
abacus_fixer 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
@mohanchen
mohanchen merged commit 4ec173c into deepmodeling:develop Aug 12, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Refactor ABACUS codes The Absolute Zero Reduce the "entropy" of the code to 0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants