Skip to content

fix(test): update stale expected values in spin model C++ and LAMMPS tests#7

Merged
OutisLi merged 3 commits intopr-4545from
copilot/fix-pr-4545-unit-tests-another-one
Feb 25, 2026
Merged

fix(test): update stale expected values in spin model C++ and LAMMPS tests#7
OutisLi merged 3 commits intopr-4545from
copilot/fix-pr-4545-unit-tests-another-one

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 25, 2026

Spin model tests had stale expected values that didn't match the current deeppot_dpa_spin.pth model. The C API tests, CC API tests, and LAMMPS Python tests all referenced incorrect energies, forces, force_mag, virials, and model metadata.

C++ API (test_deeppot_tf_spin.cc)

  • Fix TestInferDeepSpinNopbc::cpu_lmp_nlist_atomic atom_virial size: (natoms+2)*9natoms*9. The LMP nlist path maps back to real atoms only; the build_nlist path (which includes virtual spin atoms) was already correct.

C API (test_deepspin_a.cc, test_deepspin_a_hpp.cc)

  • Regenerate expected energy, force, force_mag from actual model output for both PBC and NoPBC
  • Fix model metadata: cutoff 6.0→4.0, numb_types 2→3, type_map "Ni O"→"Ni O H"

LAMMPS (test_lammps_spin_pt.py, test_lammps_spin_nopbc_pt.py)

  • Regenerate expected energy, force, force_mag, virial for PT model (deeppot_dpa_spin.pth)
  • Reduce expected_v / expected_v2 from 6 rows to 4 rows (real atoms only, no virtual spin atoms in LAMMPS output)
  • TF model deviation values (expected_f2, expected_fm2) verified correct, unchanged

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…virial size

Co-authored-by: OutisLi <137472077+OutisLi@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix unit tests in PR 4545 for spin model viral functionality fix(test): update spin model C/C++ test expected values and fix atom_virial size check Feb 25, 2026
Copilot AI requested a review from OutisLi February 25, 2026 06:04
Copy link
Copy Markdown
Owner

@OutisLi OutisLi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Co-authored-by: OutisLi <137472077+OutisLi@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented Feb 25, 2026

Test C++ / Test C++ (false, true, true, false) (pull_request)Failing after 16m

The CI failure was in the LAMMPS spin tests (test_lammps_spin_pt.py and test_lammps_spin_nopbc_pt.py) which had stale expected values for the PT model (deeppot_dpa_spin.pth). These tests were previously masked by the C++ test failures that ran first. Fixed in 17e6adf by regenerating expected energy, force, force_mag, and virial values from the actual model output via the C API.

Copilot AI changed the title fix(test): update spin model C/C++ test expected values and fix atom_virial size check fix(test): update spin model C/C++ and LAMMPS test expected values and fix atom_virial size check Feb 25, 2026
Copilot AI requested a review from OutisLi February 25, 2026 06:59
Copilot AI changed the title fix(test): update spin model C/C++ and LAMMPS test expected values and fix atom_virial size check fix(test): update stale expected values in spin model C++ and LAMMPS tests Feb 25, 2026
@OutisLi OutisLi marked this pull request as ready for review February 25, 2026 07:39
@OutisLi OutisLi merged commit 7415f62 into pr-4545 Feb 25, 2026
57 of 59 checks passed
@OutisLi OutisLi deleted the copilot/fix-pr-4545-unit-tests-another-one branch March 10, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants