Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[BUG] deepmd/kk silently ignores spin atoms instead of rejecting them

オープン
#5,996 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 4 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
cpp
領域
backend, testing

調査の方向性

PairDeepMDKokkos::init_style() と compute() から始め、次にそれらの動作を PairDeepMD::compute() と比較します。特に atom->sp_flag guard に注目してください。atom_style spin/kk と通常の .pt2 モデルを使って問題を再現し、deepmd と deepmd/kk を比較するリグレッションを追加します。deepmd/kk が磁気状態を暗黙に無視するのではなく、spin 原子を拒否すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug
Summary

The host deepmd pair style rejects spin atoms and tells the user to select a spin-aware pair style. The deepmd/kk compute override omits that guard, so an ordinary model can run with atom_style spin/kk while silently ignoring every atom's spin state.

This is present on origin/master at 8cfd46e37448.

Evidence

PairDeepMD::compute() contains:

if (atom->sp_flag) {
  error->all(FLERR,
             "Pair style 'deepmd' does not support spin atoms, please use "
             "pair style 'deepspin' instead.");
}

PairDeepMDKokkos::compute() overrides the entire host compute path and never performs this check. Its device graph is built only from coordinates and atom types; it neither consumes atom->sp nor produces atom->fm.

Trigger and impact

Run an ordinary edge-, graph-, or canonical-input .pt2 model with:

atom_style spin/kk
pair_style deepmd/kk <ordinary-model.pt2>

Unlike pair_style deepmd, initialization and compute proceed. Changing magnetic moments has no effect, and no magnetic force is produced, which can silently yield invalid spin dynamics.

Expected behavior

PairDeepMDKokkos::init_style() or compute() should apply the same atom->sp_flag rejection as the host path. A regression should compare deepmd and deepmd/kk behavior for a spin atom style.


Coding agent: Codex
Codex version: codex-cli 0.149.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

主要言語
Python
スター
2.1k
フォーク
654
平均マージ
3日 10時間
マージ済み PR(30日)
13

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

deepmodeling/deepmd-kit のほかの issue

deepmodeling/deepmd-kit の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。