Summary
The DeepMD LAMMPS pair styles accept comm_style tiled but unconditionally cast the active communicator to a CommBrick-derived helper and read brick-only protected fields. CommTiled stores the same concepts with different pointer ranks and layout, so the model receives invalid communication metadata.
This is present on origin/master at 8cfd46e37448.
Evidence
Examples of the unchecked casts are:
commdata_ = (CommBrickDeepMD*)comm;
commdata_ = (CommBrickDPA4Spin*)comm;
in source/lmp/pair_deepmd.cpp and source/lmp/pair_dpa4spin.cpp. The Kokkos message-passing path reaches the same data through PairDeepMD::make_comm_nlist().
CommBrick exposes one-dimensional swap arrays such as int *sendnum, int *recvnum, int *firstrecv, and int **sendlist. CommTiled instead stores per-swap/per-peer layouts such as int **sendnum, int **recvnum, int **firstrecv, and int ***sendlist. Reinterpreting a CommTiled object as CommBrick therefore yields garbage pointers rather than equivalent metadata.
Trigger and impact
Use two or more ranks with:
comm_style tiled
pair_style deepmd/kk <message-passing edge-input .pt2>
The with-communication artifact receives invalid send/receive lists. Host deepmd, deepspin, and dpa4spin also use the brick-only cast when constructing their neighbor-list communication metadata.
This can crash, fail inside the backend, or communicate incorrect features depending on the interpreted pointer values.
Expected behavior
Until tiled metadata is explicitly flattened into the backend's InputNlist representation, these pair styles should detect and reject non-brick communication in init_style() with a clear error. A multi-rank regression should cover comm_style tiled.
Coding agent: Codex
Codex version: codex-cli 0.149.0
Model: gpt-5.6-sol
Reasoning effort: xhigh
Summary
The DeepMD LAMMPS pair styles accept
comm_style tiledbut unconditionally cast the active communicator to aCommBrick-derived helper and read brick-only protected fields.CommTiledstores the same concepts with different pointer ranks and layout, so the model receives invalid communication metadata.This is present on
origin/masterat8cfd46e37448.Evidence
Examples of the unchecked casts are:
in
source/lmp/pair_deepmd.cppandsource/lmp/pair_dpa4spin.cpp. The Kokkos message-passing path reaches the same data throughPairDeepMD::make_comm_nlist().CommBrickexposes one-dimensional swap arrays such asint *sendnum,int *recvnum,int *firstrecv, andint **sendlist.CommTiledinstead stores per-swap/per-peer layouts such asint **sendnum,int **recvnum,int **firstrecv, andint ***sendlist. Reinterpreting aCommTiledobject asCommBricktherefore yields garbage pointers rather than equivalent metadata.Trigger and impact
Use two or more ranks with:
The with-communication artifact receives invalid send/receive lists. Host
deepmd,deepspin, anddpa4spinalso use the brick-only cast when constructing their neighbor-list communication metadata.This can crash, fail inside the backend, or communicate incorrect features depending on the interpreted pointer values.
Expected behavior
Until tiled metadata is explicitly flattened into the backend's
InputNlistrepresentation, these pair styles should detect and reject non-brick communication ininit_style()with a clear error. A multi-rank regression should covercomm_style tiled.Coding agent: Codex
Codex version: codex-cli 0.149.0
Model: gpt-5.6-sol
Reasoning effort: xhigh