Skip to content

Commit 91400e3

Browse files
authored
Merge branch 'develop' into parallel_neighlist
2 parents 8b833bc + 0b7a266 commit 91400e3

423 files changed

Lines changed: 25349 additions & 9684 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coderabbit.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
2+
language: en-US
3+
4+
reviews:
5+
auto_review:
6+
enabled: true
7+
drafts: false
8+
request_changes_workflow: false
9+
high_level_summary: true
10+
poem: false
11+
path_instructions:
12+
- path: "source/**"
13+
instructions: |
14+
Apply the ABACUS agent governance rules before general style feedback.
15+
Focus on newly introduced GlobalV/GlobalC/PARAM dependencies, default
16+
parameters in headers, module placement, CMakeLists.txt linkage, C++11
17+
compatibility, and focused tests for behavior changes.
18+
- path: "source/source_io/module_parameter/**"
19+
instructions: |
20+
Treat INPUT parameter metadata, parsing, defaults, descriptions, and
21+
availability changes as user-visible behavior. Require matching updates
22+
to docs/parameters.yaml and docs/advanced/input_files/input-main.md, or
23+
a clear no-update explanation in the PR.
24+
- path: "docs/**"
25+
instructions: |
26+
Check that documentation changes match the implementation and do not
27+
weaken the rule grading matrix without an explicit rationale.
28+
- path: ".github/**"
29+
instructions: |
30+
Check workflow, PR-template, CodeRabbit, and Copilot instruction
31+
changes for consistency with AGENTS.md and
32+
docs/developers_guide/agent_governance.md.
33+
- path: "tools/03_code_analysis/**"
34+
instructions: |
35+
Review governance checker changes for false positives, missing
36+
diff-scoping, test coverage, and consistency with the GitHub Actions
37+
summary output. Prefer deterministic checks for low-noise blockers and
38+
leave semantic ownership decisions to AI and human review.
39+
40+
knowledge_base:
41+
code_guidelines:
42+
enabled: true
43+
filePatterns:
44+
- "AGENTS.md"
45+
- "docs/developers_guide/agent_governance.md"
46+
- ".github/copilot-instructions.md"
47+
- ".github/instructions/*.instructions.md"

.gitattributes

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Shell scripts and the bash-parsed integration-test case lists must keep LF
2-
# endings so they run under bash, including MSYS2/Git-Bash on Windows where
3-
# core.autocrlf may rewrite them to CRLF (which breaks `#!/bin/bash` and adds
4-
# stray \r to parsed lines such as the case names in CASES_*.txt).
1+
# Text files use LF by default. Windows command scripts keep CRLF because
2+
# cmd.exe and installer tooling may depend on it.
3+
* text=auto eol=lf
4+
*.bat text eol=crlf
5+
*.cmd text eol=crlf
56
*.sh text eol=lf
67
CASES_*.txt text eol=lf
78

.github/copilot-instructions.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# ABACUS Copilot Instructions
2+
3+
Before generating code or reviewing pull requests in this repository, follow
4+
the ABACUS development baseline in:
5+
6+
- `AGENTS.md`
7+
- `docs/developers_guide/agent_governance.md`
8+
9+
Treat `AGENTS.md` as the short entry point and
10+
`docs/developers_guide/agent_governance.md` as the complete rule source. Review
11+
the pull request diff before general style feedback, and separate blocking
12+
diff-scoped issues from historical or advisory observations.
13+
14+
Use the ABACUS review finding format for actionable findings:
15+
16+
```markdown
17+
Rule: <rule name>
18+
Severity: error | warning | info
19+
Location: <file:line>
20+
Reason: <specific trigger>
21+
Suggested action: <concrete next step>
22+
Exception: allowed | not allowed | human approval required
23+
```
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
applyTo: "**"
3+
---
4+
5+
# ABACUS Governance Review Instructions
6+
7+
Apply these instructions when reviewing or changing ABACUS code:
8+
9+
- Use `AGENTS.md` and `docs/developers_guide/agent_governance.md` as the
10+
authoritative project baseline.
11+
- Keep review scope diff-oriented: new files, diff-added lines, new includes,
12+
newly introduced symbols, and changed text files for line-ending checks.
13+
- Do not treat untouched historical debt as a default blocker. Mention it only
14+
when it affects the changed area, and label it as advisory.
15+
- Flag newly introduced `GlobalV`, `GlobalC`, or `PARAM` cross-layer control.
16+
Prefer explicit dependencies or narrow local interfaces.
17+
- Flag new default arguments in existing header interfaces. Prefer explicit
18+
call-site updates, overloads, or a clearer configuration object.
19+
- Review header include growth and `.hpp` propagation carefully. These are
20+
usually warnings unless the PR records a narrow reason.
21+
- Require LF line endings for text files. `.bat` and `.cmd` files are the CRLF
22+
exceptions.
23+
- For INPUT parameter behavior changes, require synchronized updates to
24+
`docs/parameters.yaml` and `docs/advanced/input_files/input-main.md`, or a
25+
clear no-update explanation in the PR.
26+
- Check that new source files are linked through the relevant `CMakeLists.txt`
27+
unless the PR explains generated or indirect inclusion.
28+
- Keep default C++ changes compatible with the repository C++11 baseline.
29+
- Ask for focused tests or explicit test rationale for feature changes, bug
30+
fixes, INPUT behavior changes, heterogeneous kernels, and core-module
31+
refactors.
32+
- Treat CI governance findings as deterministic evidence and semantic review
33+
findings as advisory until maintainers approve them.

.github/pull_request_template.md

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,51 @@
11
### Reminder
2-
- [ ] Have you linked an issue with this pull request?
3-
- [ ] Have you added adequate unit tests and/or case tests for your pull request?
4-
- [ ] Have you noticed possible changes of behavior below or in the linked issue?
5-
- [ ] Have you explained the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi? (ignore if not applicable)
2+
- [ ] I have read `AGENTS.md` and `docs/developers_guide/agent_governance.md`.
3+
- [ ] I have linked an issue or explained why this PR does not need one.
4+
- [ ] I have added adequate unit tests and/or case tests, or explained why not.
5+
- [ ] I have listed the exact verification commands run and their results.
6+
- [ ] I have described user-visible behavior changes, including INPUT parameter changes.
7+
- [ ] I have explained core-module impact for ESolver, HSolver, ElecState, Hamilt, Operator, Psi, or other `source/` changes.
8+
- [ ] I have requested any needed governance exception below.
69

710
### Linked Issue
811
Fix #...
912

1013
### Unit Tests and/or Case Tests for my changes
1114
- A unit test is added for each new feature or bug fix.
1215

16+
### Exact Verification Performed
17+
- Commands run:
18+
- Result summary:
19+
- Checks not run, with reason:
20+
1321
### What's changed?
1422
- Example: My changes might affect the performance of the application under certain conditions, and I have tested the impact on various scenarios...
1523

16-
### Any changes of core modules? (ignore if not applicable)
17-
- Example: I have added a new virtual function in the esolver base class in order to ...
24+
### Governance Checklist
25+
- Global dependencies: no new `GlobalV`, `GlobalC`, or `PARAM` cross-layer control, or exception requested below.
26+
- Default parameters: no new default arguments added to existing interfaces, or exception requested below.
27+
- Headers: no unnecessary header dependencies or `.hpp` propagation, or rationale provided below.
28+
- Line endings: text files use LF; only `.bat` and `.cmd` use CRLF.
29+
- Build linkage: new source files are listed in the relevant `CMakeLists.txt`, or rationale provided below.
30+
- Documentation: behavior/interface changes include documentation updates, or no documentation update is required because ...
31+
- CodeRabbit: if automatic review has not started and the repository has CodeRabbit installed, request `@coderabbitai review`.
32+
33+
### INPUT Parameter Changes
34+
- Parameters added/removed/changed:
35+
- `docs/parameters.yaml` updated: yes/no/not applicable
36+
- `docs/advanced/input_files/input-main.md` updated: yes/no/not applicable
37+
- If not updated, explain why no INPUT documentation update is required:
38+
39+
### Core Module Impact
40+
- Affected core modules:
41+
- Risk summary:
42+
- Compatibility or performance impact:
43+
44+
### Governance Exception
45+
- Rule:
46+
- Reason:
47+
- Scope:
48+
- User or maintenance risk:
49+
- Why the normal rule cannot be followed now:
50+
- Follow-up cleanup plan:
51+
- Requested approver:
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Agent Governance
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, edited, ready_for_review]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: read
10+
11+
jobs:
12+
governance:
13+
name: Governance checks
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Run ABACUS governance checker
22+
id: governance
23+
run: |
24+
set +e
25+
base_sha="${{ github.event.pull_request.base.sha }}"
26+
head_sha="${{ github.event.pull_request.head.sha }}"
27+
merge_base="$(git merge-base "$base_sha" "$head_sha")"
28+
merge_base_status=$?
29+
if [ "$merge_base_status" -ne 0 ]; then
30+
{
31+
echo "## Agent Governance Check"
32+
echo
33+
echo "Failed to compute the pull request merge base."
34+
} > agent_governance_summary.md
35+
exit "$merge_base_status"
36+
fi
37+
python3 tools/03_code_analysis/agent_governance_check.py \
38+
--base "$merge_base" \
39+
--head "$head_sha" \
40+
--event-path "$GITHUB_EVENT_PATH" \
41+
--format markdown | tee agent_governance_summary.md
42+
status=${PIPESTATUS[0]}
43+
if [ ! -s agent_governance_summary.md ]; then
44+
{
45+
echo "## Agent Governance Check"
46+
echo
47+
echo "Checker failed before producing a summary."
48+
} > agent_governance_summary.md
49+
fi
50+
exit "$status"
51+
52+
- name: Publish governance summary
53+
if: always()
54+
run: |
55+
cat agent_governance_summary.md >> "$GITHUB_STEP_SUMMARY"

.github/workflows/ase_plugin_test.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Atomic Simulation Environment (ASE) Plugin Test
33
on:
44
pull_request:
55

6+
defaults:
7+
run:
8+
shell: bash
9+
610
jobs:
711
test:
812
name: abacuslite
@@ -33,15 +37,24 @@ jobs:
3337
cd interfaces/ASE_interface
3438
pip install .
3539
40+
- name: Install external tools from toolchain
41+
run: |
42+
sudo apt update && sudo apt install -y xz-utils ninja-build
43+
cd toolchain
44+
./install_abacus_toolchain_new.sh --with-dftd4=install --dry-run -j8
45+
./scripts/stage4/install_stage4.sh
46+
cd ..
47+
3648
- name: Configure & Build ABACUS (GNU)
3749
run: |
3850
git config --global --add safe.directory `pwd`
3951
export LD_LIBRARY_PATH=${GKLIB_ROOT}/lib:${METIS32_ROOT}/lib:${PARMETIS32_ROOT}/lib:${SUPERLU32_DIST_ROOT}/lib:${PEXSI32_ROOT}/lib:${LD_LIBRARY_PATH}
4052
export PKG_CONFIG_PATH=${GKLIB_ROOT}/lib/pkgconfig:${METIS32_ROOT}/lib/pkgconfig:${PARMETIS32_ROOT}/lib/pkgconfig:${SUPERLU32_DIST_ROOT}/lib/pkgconfig:${PEXSI32_ROOT}/lib/pkgconfig:${PKG_CONFIG_PATH}
4153
export CPATH=${GKLIB_ROOT}/include:${METIS32_ROOT}/include:${PARMETIS32_ROOT}/include:${SUPERLU32_DIST_ROOT}/include:${PEXSI32_ROOT}/include:${CPATH}
4254
export CMAKE_PREFIX_PATH=${PEXSI32_ROOT}:${SUPERLU_DIST32_ROOT}:${PARMETIS32_ROOT}:${METIS32_ROOT}:${GKLIB_ROOT}:${CMAKE_PREFIX_PATH}
55+
source toolchain/install/setup
4356
rm -rf build
44-
cmake -B build
57+
cmake -B build -G Ninja
4558
cmake --build build -j2
4659
4760
- name: Install and Soft Link ABACUS

.github/workflows/build_test_cmake.yml

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ on:
33
push:
44
pull_request:
55

6+
defaults:
7+
run:
8+
shell: bash
9+
610
jobs:
711
test:
812
runs-on: ubuntu-latest
@@ -13,30 +17,38 @@ jobs:
1317
build_args: ""
1418
name: "Build with GNU toolchain"
1519
- tag: intel
20+
external_toolchain_args: "--with-intel"
1621
build_args: ""
1722
name: "Build with Intel toolchain"
1823

1924
- tag: gnu
20-
build_args: "-DENABLE_LIBXC=1 -DENABLE_MLALGO=1 -DENABLE_LIBRI=1"
25+
external_toolchain_args: ""
26+
build_args: "-DENABLE_LIBXC=ON -DENABLE_MLALGO=ON -DENABLE_LIBRI=ON"
2127
name: "Build extra components with GNU toolchain"
2228
- tag: intel
23-
build_args: "-DENABLE_LIBXC=1 -DENABLE_PEXSI=1 -DENABLE_MLALGO=1 -DENABLE_LIBRI=1"
29+
external_toolchain_args: "--with-intel"
30+
build_args: "-DENABLE_LIBXC=ON -DENABLE_PEXSI=ON -DENABLE_MLALGO=ON -DENABLE_LIBRI=ON"
2431
name: "Build extra components with Intel toolchain"
2532

2633
- tag: cuda
27-
build_args: "-DUSE_CUDA=1"
34+
external_toolchain_args: ""
35+
build_args: "-DUSE_CUDA=ON"
2836
name: "Build with CUDA support"
2937
- tag: gnu
30-
build_args: "-DENABLE_LCAO=0"
38+
external_toolchain_args: ""
39+
build_args: "-DENABLE_LCAO=OFF"
3140
name: "Build without LCAO"
3241
- tag: gnu
33-
build_args: "-DUSE_ELPA=0 "
42+
external_toolchain_args: ""
43+
build_args: "-DUSE_ELPA=OFF "
3444
name: "Build without ELPA"
3545
- tag: gnu
36-
build_args: "-DENABLE_MPI=0"
46+
external_toolchain_args: ""
47+
build_args: "-DENABLE_MPI=OFF"
3748
name: "Build without MPI"
3849
- tag: gnu
39-
build_args: "-DENABLE_MPI=0 -DENABLE_LCAO=0"
50+
external_toolchain_args: ""
51+
build_args: "-DENABLE_MPI=OFF -DENABLE_LCAO=OFF"
4052
name: "Build without LCAO and MPI"
4153

4254
name: ${{ matrix.name }}
@@ -47,13 +59,22 @@ jobs:
4759
with:
4860
submodules: recursive
4961

62+
- name: Install external tools from toolchain
63+
run: |
64+
sudo apt update && sudo apt install -y gfortran ninja-build xz-utils
65+
cd toolchain
66+
./install_abacus_toolchain_new.sh --with-dftd4=install --dry-run ${{matrix.external_toolchain_args}}
67+
./scripts/stage4/install_stage4.sh
68+
cd ..
69+
5070
- name: Build
5171
run: |
5272
git config --global --add safe.directory `pwd`
5373
export LD_LIBRARY_PATH=${GKLIB_ROOT}/lib:${METIS32_ROOT}/lib:${PARMETIS32_ROOT}/lib:${SUPERLU32_DIST_ROOT}/lib:${PEXSI32_ROOT}/lib:${LD_LIBRARY_PATH}
5474
export PKG_CONFIG_PATH=${GKLIB_ROOT}/lib/pkgconfig:${METIS32_ROOT}/lib/pkgconfig:${PARMETIS32_ROOT}/lib/pkgconfig:${SUPERLU32_DIST_ROOT}/lib/pkgconfig:${PEXSI32_ROOT}/lib/pkgconfig:${PKG_CONFIG_PATH}
5575
export CPATH=${GKLIB_ROOT}/include:${METIS32_ROOT}/include:${PARMETIS32_ROOT}/include:${SUPERLU32_DIST_ROOT}/include:${PEXSI32_ROOT}/include:${CPATH}
5676
export CMAKE_PREFIX_PATH=${PEXSI32_ROOT}:${SUPERLU_DIST32_ROOT}:${PARMETIS32_ROOT}:${METIS32_ROOT}:${GKLIB_ROOT}:${CMAKE_PREFIX_PATH}
77+
source toolchain/install/setup
5778
rm -rf build
58-
cmake -B build ${{ matrix.build_args }}
59-
cmake --build build -j2
79+
cmake -B build -G Ninja ${{ matrix.build_args }}
80+
cmake --build build -j $(nproc)

.github/workflows/build_test_makefile.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ on:
33
push:
44
pull_request:
55

6+
defaults:
7+
run:
8+
shell: bash
9+
610
jobs:
711
test:
812
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)