Skip to content

Remove redundant size casts from MD vector subscripts - #8335

Open
19hello wants to merge 4 commits into
deepmodeling:developfrom
19hello:cleanup/redundant-size-casts
Open

19hello wants to merge 4 commits into
deepmodeling:developfrom
19hello:cleanup/redundant-size-casts

Conversation

@19hello

@19hello 19hello commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Remove redundant static_cast<std::size_t> wrappers from standard-container subscript expressions in the current code derived from previously merged PRs by 19hello.
  • Keep conversions used for size comparisons, bounds checks, allocation sizes, and non-index arithmetic. The DP inference implementation being replaced by Distribute DeePMD inference through MDCell for UnitCell workflows #8330 is excluded; its new path is cleaned in that PR.
  • No numerical algorithm, INPUT behavior, or user-facing output changes. No documentation or new tests are needed for this syntax-only cleanup.

Verification

  • source /home/fy19/abacus-develop/toolchain/install/setup && cmake -S /tmp/abacus-size-cast-cleanup -B /tmp/abacus-size-cast-build -DENABLE_MPI=ON -DENABLE_LCAO=OFF -DBUILD_TESTING=ON -DDeePMD_DIR=/home/fy19/00_software/deepmd-kit-c -DCMAKE_BUILD_TYPE=Release — passed.
  • source /home/fy19/abacus-develop/toolchain/install/setup && cmake --build /tmp/abacus-size-cast-build --target abacus_pw_para -j 12 — passed after the source changes and again after the final DP-file exclusion.
  • Relevant domain-decomposition, SNAP, and NEP unit tests: 6/6 passed. The updated neighbor-search, domain-decomposition, SNAP-calculator, LJ, FIRE, Verlet, NHC, MSST, and Langevin tests: 10/10 passed. The final nested-index edit rebuilt the executable and MODULE_MD_verlet; its test passed 1/1.
  • python3 tools/03_code_analysis/agent_governance_check.py --base origin/develop --head HEAD --format text — no blockers; documentation review warning only, addressed by the no-behavior-change rationale above.
  • git diff --check origin/develop...HEAD — passed.

Limits

  • The two CUDA .cu files were not compiled locally because nvcc is unavailable. Their edits only remove explicit conversion before standard-container indexing; the implicit conversion has the same type and value.
  • Historical PRs that closed without merging have no code to change on develop.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant