Repository navigation
Conversation
ABACUS-PR-BOT
left a comment
There was a problem hiding this comment.
Static review of 33675211e76d60821044d263a9a49c5f45258218 with independent verification: one malformed-input regression and two nonblocking follow-ups below. Governance and whitespace checks passed; builds/tests were not run. CI diagnostics were unavailable.
| std::vector<double> re(nm * nm); | ||
| std::vector<double> im(nm * nm); | ||
| std::vector<double> dd(nm * nm); | ||
| char word[20]; |
There was a problem hiding this comment.
[P2] Check SOC label reads before comparing the new buffer
With nspin=4, a file ending immediately after Fe Atom 1 L 2 enters skip_compact_soc_label() with this uninitialized buffer. On libstdc++, failed extraction at EOF leaves it untouched, so strcmp reads indeterminate storage before the checked matrix-read error; previously the outer parser had already filled word with L. Please use checked label reads (preferably std::string) and cover this truncated-header case.
| ifdftu.ignore(150, '\n'); | ||
| } | ||
| } | ||
| read_legacy_soc_matrix(ifdftu, occ, iat, l, npol); |
There was a problem hiding this comment.
Non-blocking: This legacy path still stores a real spin-basis matrix regardless of soc_layout, while PW consumes contiguous Pauli blocks. That limitation predates this refactor, and the new legacy SOC test covers only the real LCAO layout. Please scope the legacy compatibility claim accordingly; a layout-aware conversion and PW test can follow up after merge.
| template <typename T> | ||
| void read_required(std::ifstream& ifs, T& value) | ||
| { | ||
| if (!(ifs >> value)) |
There was a problem hiding this comment.
Non-blocking: The new read_required and fused-index rejection branches are not exercised by the added valid-file fixtures. Please add process-exit checks for truncated collinear/legacy SOC data and Atom=1x; this can follow up after the refactor.
|
Current refactor is not ready due to a few reasons. The file is still huge. Please resubmit PR when it is ready. |
Reminder
AGENTS.mdanddocs/developers_guide/agent_governance.md.Atom=1restart files emitted by the existing writer now load correctly;Atom= 1remains supported. No INPUT parameter changes.Unit Tests and/or Case Tests for my changes
source /home/lanshuyue/intel/oneapi/setvars.sh && cmake --build build --target MODULE_PW_dftu_base_test -j4— passed.OMP_NUM_THREADS=1 ctest --test-dir build --output-on-failure -R "^MODULE_PW_dftu_base_test$"— passed (1/1 CTest target; 18/18 Google Tests).git diff --check— passed.python3 tools/03_code_analysis/code_quality_score.py --format json source/source_pw/module_pwdft/dftu_base_io.cpp—read_occup_mand new helpers have no high-complexity finding (previouslyread_occup_mhad complexity 40). The whole-file score remains 0 because unrelated existing file-level debt and other functions are out of scope.python3 tools/03_code_analysis/agent_governance_check.py --base upstream/develop --head HEAD --format text— no blocking findings; migration-neutral global-reference and documentation-review warnings explained below.What's changed?
Atom=1that the existing legacy writer produces, as well asAtom= 1.Governance Notes
GlobalVreferences were moved without increase (added=2, removed=2, net=0).