fix(dpmodel): preserve virtual spin atom types#5854
Open
njzjz-bot wants to merge 2 commits into
Open
Conversation
Keep negative placeholder types and their spin partners virtual through dense and lower input expansion. Mask type-dependent spin scales and outputs for placeholders, with NumPy and Array API regression coverage. Coding-Agent: Codex Codex-Version: codex-cli 0.144.4 Model: gpt-5.6-sol Reasoning-Effort: xhigh
for more information, see https://pre-commit.ci
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5854 +/- ##
==========================================
- Coverage 78.58% 78.31% -0.27%
==========================================
Files 1050 1050
Lines 120637 120641 +4
Branches 4356 4354 -2
==========================================
- Hits 94801 94482 -319
- Misses 24278 24592 +314
- Partials 1558 1567 +9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
Possible reviewers based on changed lines, exact file history, and exact-file review history:
No review request was made automatically. Coding agent: Codex |
njzjz
requested review from
iProzd and
wanghan-iapcm
and removed request for
iProzd and
wanghan-iapcm
July 18, 2026 07:26
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.
Closes #5663.
Summary
Why existing tests missed this
Existing spin consistency tests use only nonnegative real atom types, including their lower-interface ghost atoms. Negative-type tests cover base atomic models and neighbor-list builders, where masking happens before type-dependent work, but not
SpinModelpreprocessing, which runs earlier. Cross-backend spin tests therefore never supplied a nonzero padded spin or asserted that both the real placeholder and its generated spin partner remained negative.Validation
pytest source/tests/common/dpmodel/test_spin_model_virtual_types.py source/tests/common/dpmodel/test_finetune_spin.py source/tests/common/dpmodel/test_spin_model_legacy_routing.py -q(12 passed)ruff format .(1664 files unchanged on final pass)ruff check .(passed)git diff --check(passed)Coding agent: Codex
Codex version: codex-cli 0.144.4
Model: gpt-5.6-sol
Reasoning effort: xhigh