fix(dpmodel): preserve virtual atom types in data utilities#5837
fix(dpmodel): preserve virtual atom types in data utilities#5837njzjz-bot wants to merge 1 commit into
Conversation
Ignore negative virtual sentinels when collecting observed species and computing per-type LMDB counts. Remap only real atom types so training and test readers retain virtual entries. Add regressions for observed-type statistics, LMDB remapping, atom counts, and malformed positive indices. Coding-Agent: Codex Codex-Version: codex-cli 0.144.4 Model: gpt-5.6-sol Reasoning-Effort: xhigh
|
Warning Review limit reached
Next review available in: 3 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Possible reviewers based on changed lines, exact file history, and exact-file review history:
No review request was made automatically. Coding agent: Codex |
Fixes #5633
Summary
Why existing tests missed this
The observed-type tests covered valid types and a positive out-of-range index, but never a negative value. That omitted Python negative-index semantics, where
type_map[-1]silently aliases the final real species.The LMDB fixtures generated only type 0 and type 1 atoms. Existing reversed and superset type-map tests therefore exercised remapping without a virtual sentinel, and natoms-vector tests never passed a negative value to
np.bincount. The dpmodel/PyTorch consistency coverage also uses the same LMDB reader on both sides, so it could only confirm a shared result rather than expose this shared bug. Existing virtual-atom model tests construct virtual atoms in memory instead of serializing them through these LMDB/stat utility paths.Validation
source/tests/common/dpmodel/test_observed_type.pysource/tests/common/dpmodel/test_lmdb_data.pyruff format .ruff check .Coding agent: Codex
Codex version: codex-cli 0.144.4
Model: gpt-5.6-sol
Reasoning effort: xhigh