Skip to content

fix(dpmodel): support parameter shorthand in DeepEval - #5853

Open
njzjz-bot wants to merge 9 commits into
deepmodeling:masterfrom
njzjz-bot:fix/dpmodel-deepeval-param-shorthand-5662
Open

fix(dpmodel): support parameter shorthand in DeepEval#5853
njzjz-bot wants to merge 9 commits into
deepmodeling:masterfrom
njzjz-bot:fix/dpmodel-deepeval-param-shorthand-5662

Conversation

@njzjz-bot

@njzjz-bot njzjz-bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Closes #5662.

Depends on #5857, which provides the shared parameter-normalization helper and wires it into every backend. This PR is intentionally stacked on that branch and adds only dpmodel-specific regression coverage; after #5857 merges, the shared implementation commits will disappear from this PR's diff.

Summary

  • remove the dpmodel-only copy of the shorthand normalization ladder
  • exercise the shared helper through the low-level dpmodel backend
  • use distinct coordinates, boxes, per-frame fparam rows, and per-frame aparam values
  • call shorthand inputs first on fresh batchers so GPU batch-size growth cannot hide the split
  • verify split and unsplit evaluation agree while distinct frames produce distinct energies

Validation

  • source/tests/infer/test_dpmodel_deep_eval_params.py: 9 passed
  • changed-file ruff check: passed
  • ruff format .: passed
  • git diff --check: passed

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

njzjz-bot and others added 2 commits July 17, 2026 09:56
Standardize frame and atomic parameter shorthand in the common wrapper and backend entry points before automatic batching. Preserve full per-frame and per-atom arrays while broadcasting documented shared forms consistently across TensorFlow 2, PyTorch, JAX, and Paddle.

Normalize PyTorch embedding extraction before split execution so eval_embedding, eval_descriptor, and eval_fitting_last_layer accept shared fparam, per-atom aparam, and scalar aparam forms. Cover two frames forced through one-frame backend batches.

Coding-Agent: Codex
Codex-Version: codex-cli 0.144.4
Model: gpt-5.6-sol
Reasoning-Effort: xhigh
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.43590% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.24%. Comparing base (cc908a8) to head (e7505f2).
⚠️ Report is 29 commits behind head on master.

Files with missing lines Patch % Lines
deepmd/pt_expt/infer/deep_eval.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5853      +/-   ##
==========================================
+ Coverage   79.03%   79.24%   +0.21%     
==========================================
  Files        1055     1072      +17     
  Lines      122233   125055    +2822     
  Branches     4401     4541     +140     
==========================================
+ Hits        96607    99103    +2496     
- Misses      24061    24325     +264     
- Partials     1565     1627      +62     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@njzjz

njzjz commented Jul 18, 2026

Copy link
Copy Markdown
Member

Possible reviewers based on changed lines, exact file history, and exact-file review history:

  • @wanghan-iapcm — 5 commits on changed files; 26 reviews on exact changed files (deepmd/dpmodel/infer/deep_eval.py).
  • @iProzd — 3 commits on changed files (deepmd/dpmodel/infer/deep_eval.py).

No review request was made automatically.

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

@njzjz
njzjz requested review from iProzd and wanghan-iapcm and removed request for iProzd and wanghan-iapcm July 18, 2026 07:26

@wanghan-iapcm wanghan-iapcm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retracted - posted prematurely. Please disregard; review pending.

@wanghan-iapcm wanghan-iapcm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix is correct. AutoBatchSize.execute_all slices only ndim > 1 args along axis 0, so a (natoms, dim_aparam) shorthand really was being sliced on its atom axis - canonicalizing before the batcher is the right place. I checked the size-dispatch for ambiguity: collisions occur only at n == 1 or natoms == 1, and in each the two branches produce the identical array, so the check order is safe. Predicate order matches _standard_input, so the public path stays idempotent with no double-tiling. All 8 new tests fail pre-fix, verified against an unpatched tree.

Two comments inline.

Merge ordering with #5852. It inserts at this same anchor and rewrites the out = self._eval_func(...) call this diff carries as context; git merge-tree confirms a real conflict, not just adjacency. Both PRs exist for the same reason - AutoBatchSize slices only frame-axis arrays - and spin is likewise unnormalized in _standard_input. Canonicalizing in the shared layer would cover spin, fparam and aparam together and collapse both PRs into one change.

Minor:

  1. _standard_input emits aparam as 2-D (nframes, natoms * dim_aparam); this returns 3-D. _eval_model reshapes either way, but it changes the internal boundary #4285 established without documenting it.

  2. AutoBatchSize.__init__ takes current_batch_size from DP_INFER_BATCH_SIZE when set, overriding the constructor argument. Under that env var the auto_batch_size=6 case stops splitting and silently becomes a duplicate of False, so the only batching coverage disappears with no failure. monkeypatch.delenv("DP_INFER_BATCH_SIZE", raising=False) plus an assertion on the _eval_model call count would pin it.

  3. Validation is size-only, so a transposed (dim_fparam, nframes) array passes and is reinterpreted row-major. Matches _standard_input, so not a regression, but it sits against the stated goal of explicit shape errors.

Comment thread deepmd/dpmodel/infer/deep_eval.py Outdated
natoms, numb_test = self._get_natoms_and_nframes(
coords, atom_types, len(atom_types.shape) > 1
)
# Canonicalize documented shorthand before AutoBatchSize sees it.

@wanghan-iapcm wanghan-iapcm Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ladder already exists in DeepEval._standard_input (deepmd/infer/deep_eval.py) - same three-way dispatch, same tiling, same wording. That placement was deliberate: #3213 put canonicalization in _standard_input, #3356 added this ladder there for every backend, and #4285 gave this adapter only the bare reshape because it consumes already-rectangular arrays.

The gap isn't dpmodel-specific. All three siblings reshape without tiling:

  • deepmd/pt/infer/deep_eval.py:695
  • deepmd/jax/infer/deep_eval.py:411
  • deepmd/pd/infer/deep_eval.py:544

while DeepEvalBackend.eval's docstring - the contract all of them implement - documents all three shorthands. So after this PR deep_eval.eval(fparam=<1-D>) succeeds on .dp and raises on .pth.

I'd rather see this fixed once in the shared layer than per backend: a DeepEvalBackend._canonicalize_params(fparam, aparam, nframes, natoms) called from each backend's eval covers all five at once. As written this is the third copy, and the copies already disagree - _standard_input says "frame param" where this says "atomic param", so the same bad input reports differently depending on entry point.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by stacking this PR on #5857 and force-updating the branch to f340567. The dpmodel adapter now uses the single shared _standardize_fparam_aparam helper from #5857; the duplicated inline ladder has been removed. This PR now contains only the focused dpmodel regression on top of the shared backend fix.

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

).reshape(len(ATOM_TYPES), 3)
BOX = np.diag([13.0, 13.0, 13.0])
NFRAMES = 2
COORDS = np.tile(COORD, (NFRAMES, 1, 1))

@wanghan-iapcm wanghan-iapcm Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

COORDS = np.tile(COORD, (NFRAMES, 1, 1)) makes both frames byte-identical, and every test's parameters are frame-invariant, so nothing here distinguishes correct frame-major handling from "use frame 0's parameters everywhere".

The tests do fail pre-fix, but as a crash (cannot reshape array of size 2 into shape (1,6,2)), not as a wrong number - a regression that kept the shapes right while losing per-frame variation would pass all 8.

One case closes it: fparam (NFRAMES, dim) with distinct rows and aparam (NFRAMES, natoms, dim) with distinct frames, split vs unsplit, asserting both that the two agree and that the per-frame energies differ. The second assertion is what makes the first meaningful.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f340567. The fixtures now use distinct coordinates and boxes, and a dedicated case supplies distinct fparam and aparam rows per frame. It evaluates the split path first on a fresh batcher, compares against an unsplit evaluator, and asserts the two frame energies differ.

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

njzjz-bot added 2 commits July 27, 2026 14:49
deserialize_to_file only writes .json, serialize_from_file raises
NotImplementedError, and the .json reader rejects fparam/aparam, so the
paddle entry could not complete the round trip. Its normalization stays
covered by test_deep_eval_parameter_shorthand.py.
Normalize parameter shorthand in the remaining dpmodel, pt_expt, and TensorFlow adapters before automatic batching. Strengthen the regressions with distinct frames and parameters, fresh batchers, and direct Paddle and pt_expt adapter coverage.

Coding-Agent: Codex
Codex-Version: codex-cli 0.144.6
Model: gpt-5.6-sol
Reasoning-Effort: xhigh
@njzjz
njzjz force-pushed the fix/dpmodel-deepeval-param-shorthand-5662 branch from 1eb3feb to f340567 Compare August 1, 2026 15:56
@njzjz
njzjz requested a review from wanghan-iapcm August 1, 2026 15:57
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@njzjz, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ef675571-27b0-43f0-9c32-240999627136

📥 Commits

Reviewing files that changed from the base of the PR and between f340567 and 692789d.

📒 Files selected for processing (6)
  • deepmd/pt_expt/infer/deep_eval.py
  • deepmd/tf/infer/deep_eval.py
  • source/tests/consistent/io/test_io.py
  • source/tests/infer/test_dpmodel_deep_eval_params.py
  • source/tests/pt_expt/infer/test_parameter_shorthand.py
  • source/tests/tf/test_deep_eval_parameter_shorthand.py
📝 Walkthrough

Walkthrough

DeepEval now normalizes shared and full fparam and aparam forms before evaluation across supported backends. It validates invalid sizes, preserves frame ordering during batching, and adds cross-backend regression tests.

Changes

Parameter shorthand support

Layer / File(s) Summary
Shared parameter normalization
deepmd/infer/deep_eval.py
Adds centralized validation and expansion for shared frame and atomic parameter forms, then flattens normalized atomic parameters for the backend ABI.
Backend evaluation integration
deepmd/*/infer/deep_eval.py
Applies normalization before evaluation across dpmodel, JAX, Paddle, PyTorch, pt_expt, TensorFlow, and TensorFlow 2. PyTorch embedding paths use the same handling.
Cross-backend regression coverage
source/tests/common/*, source/tests/consistent/io/*, source/tests/infer/*, source/tests/pd/*, source/tests/pt/*, source/tests/pt_expt/*
Tests shorthand expansion, invalid sizes, auto-batching, frame ordering, backend dispatch shapes, and embedding evaluations.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DeepEval
  participant StandardizeFparamAparam
  participant ModelEvaluator
  DeepEval->>StandardizeFparamAparam: pass frame count, atom count, and parameter dimensions
  StandardizeFparamAparam-->>DeepEval: return normalized fparam and aparam
  DeepEval->>ModelEvaluator: evaluate with normalized parameters
Loading

Possibly related issues

  • deepmodeling/deepmd-kit#5666 — Directly covers shared fparam and aparam normalization across the same backends and tests.

Possibly related PRs

Suggested labels: bug

Suggested reviewers: njzjz

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR extends normalization to non-dpmodel adapters and adds broader backend coverage beyond issue #5662's dpmodel-specific scope. Limit production changes and tests to dpmodel DeepEval, or link issues that require cross-backend adapter support.
Docstring Coverage ⚠️ Warning Docstring coverage is 68.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the dpmodel DeepEval parameter shorthand fix.
Linked Issues check ✅ Passed The dpmodel DeepEval now normalizes documented fparam/aparam shorthand, rejects invalid sizes, and adds multi-frame regression coverage for issue #5662.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
deepmd/infer/deep_eval.py (1)

992-1032: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the _standard_input return type hint to match its actual 7-value return.

The declared return type is a 5-element tuple, but the function returns coords, cells, atom_types, fparam, aparam, nframes, natoms — 7 values. Callers such as eval_descriptor already unpack all 7 values, so the annotation is stale. Add int, int for nframes and natoms to the return type.

🔧 Proposed fix for the return type hint
     def _standard_input(
         self,
         coords: np.ndarray | list,
         cells: np.ndarray | list | None,
         atom_types: np.ndarray | list,
         fparam: np.ndarray | list | None,
         aparam: np.ndarray | list | None,
         mixed_type: bool,
     ) -> tuple[
         np.ndarray,
         np.ndarray | None,
         np.ndarray,
         np.ndarray | None,
         np.ndarray | None,
+        int,
+        int,
     ]:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@deepmd/infer/deep_eval.py` around lines 992 - 1032, Update the return type
annotation of _standard_input to include the two trailing int values for nframes
and natoms, matching its seven-value return tuple and existing caller unpacking.
🧹 Nitpick comments (1)
source/tests/pd/test_deep_eval_parameter_shorthand.py (1)

21-55: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider extracting the shared dispatch-normalization test.

This test duplicates test_eval_standardizes_parameter_shorthand_before_dispatch from source/tests/pt_expt/infer/test_parameter_shorthand.py almost line for line, differing only in the imported DeepEval module. Extract a shared, backend-parametrized helper (for example, a small factory that accepts the module path or the class) to avoid copy-paste drift as more backends adopt this dispatch check.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@source/tests/pd/test_deep_eval_parameter_shorthand.py` around lines 21 - 55,
Extract the duplicated setup and assertions from
test_eval_standardizes_parameter_shorthand_before_dispatch into a shared
backend-parameterized helper or factory that accepts the relevant DeepEval
class/module. Update both this test and the corresponding
test_parameter_shorthand.py test to invoke the shared helper while preserving
each backend’s existing evaluator behavior and assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@deepmd/tf/infer/deep_eval.py`:
- Around line 765-772: Move the _standardize_fparam_aparam call to the beginning
of eval_descriptor, before any auto-batching or _eval_func dispatch. Normalize
shorthand and shared fparam/aparam forms once using the existing frame,
atom-count, and dimension arguments, ensuring shared (natoms, dim_aparam)
parameters are not split along the frame axis.

---

Outside diff comments:
In `@deepmd/infer/deep_eval.py`:
- Around line 992-1032: Update the return type annotation of _standard_input to
include the two trailing int values for nframes and natoms, matching its
seven-value return tuple and existing caller unpacking.

---

Nitpick comments:
In `@source/tests/pd/test_deep_eval_parameter_shorthand.py`:
- Around line 21-55: Extract the duplicated setup and assertions from
test_eval_standardizes_parameter_shorthand_before_dispatch into a shared
backend-parameterized helper or factory that accepts the relevant DeepEval
class/module. Update both this test and the corresponding
test_parameter_shorthand.py test to invoke the shared helper while preserving
each backend’s existing evaluator behavior and assertions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 618e92dd-e067-4b32-a679-b13869cc5abb

📥 Commits

Reviewing files that changed from the base of the PR and between f573ca0 and f340567.

📒 Files selected for processing (14)
  • deepmd/dpmodel/infer/deep_eval.py
  • deepmd/infer/deep_eval.py
  • deepmd/jax/infer/deep_eval.py
  • deepmd/pd/infer/deep_eval.py
  • deepmd/pt/infer/deep_eval.py
  • deepmd/pt_expt/infer/deep_eval.py
  • deepmd/tf/infer/deep_eval.py
  • deepmd/tf2/infer/deep_eval.py
  • source/tests/common/test_deep_eval_parameter_shorthand.py
  • source/tests/consistent/io/test_io.py
  • source/tests/infer/test_dpmodel_deep_eval_params.py
  • source/tests/pd/test_deep_eval_parameter_shorthand.py
  • source/tests/pt/model/test_embedding.py
  • source/tests/pt_expt/infer/test_parameter_shorthand.py

Comment thread deepmd/tf/infer/deep_eval.py
Coding-Agent: Codex\nCodex-Version: codex-cli 0.144.6\nModel: gpt-5.6-sol\nReasoning-Effort: xhigh
@njzjz-bot
njzjz-bot force-pushed the fix/dpmodel-deepeval-param-shorthand-5662 branch from f340567 to e7505f2 Compare August 1, 2026 16:57
@njzjz
njzjz requested review from wanghan-iapcm and removed request for wanghan-iapcm August 1, 2026 17:01

@wanghan-iapcm wanghan-iapcm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both of my earlier points are resolved, and the first one in the better way -- rather than adding a third copy of the ladder, the branch is now stacked on #5857 so the dpmodel adapter calls the single shared _standardize_fparam_aparam. That also removes the message divergence I complained about: master's dpmodel copy reported "wrong size of frame param" for an aparam error, and the shared helper gets that right.

On the second point, the fixtures now vary: COORDS = np.stack((COORD, COORD + 0.125)), BOXES[1, 0, 0] += 0.25, and test_distinct_full_parameters_preserve_frame_order_when_split supplies distinct fparam and aparam rows per frame and asserts the two frame energies differ. That last assertion is the one that makes the comparison meaningful, and it is here.

I ran the file against pre-fix source rather than reading it: 8 of its 9 cases fail, with real diagnostics (cannot reshape array of size 2 into shape (2,6,2) at deepmd/dpmodel/infer/deep_eval.py:366, and both error-message cases failing because master raises a bare ValueError instead of the worded RuntimeError). The 9th is test_distinct_full_parameters_preserve_frame_order_when_split, which passes pre-fix -- correctly so, since it feeds full frame-major arrays that never needed tiling. Its value is as a guard against a future change that keeps the shapes right while losing per-frame variation, which is exactly what I asked for, so I want to be clear I am not counting it against the PR.

Approving. Two notes, neither blocking.

Merge order. This branch carries #5857's commits, so landing it first would merge that PR's contents too. I have an open point on #5857 about eval_descriptor / eval_fitting_last_layer in the pt_expt adapter still bypassing the shared helper; that is worth settling before either lands, since merging this one silently decides it.

Worth promoting upward. Three things this file does that #5857's shared _assert_backend_parameter_shorthand does not, called out inline -- they would help every backend rather than dpmodel alone.

)

_assert_outputs_equal(split, unsplit)
assert not np.allclose(split["energy_redu"][0], split["energy_redu"][1])

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assertion is the most valuable line in the file, and it exists only here.

_assert_backend_parameter_shorthand in #5857 compares shorthand against a full frame-major reference for tensorflow, pytorch and dpmodel, but never asserts that the two frames actually differ -- so a degenerate result where both frames came out identical would satisfy it. That is the same gap I originally raised against this file, now surviving in the shared helper that covers more backends.

Two smaller ones in the same direction:

  • This file parametrizes auto_batch_size over [False, len(ATOM_TYPES)], exercising both the split and unsplit paths. The shared helper only ever runs the split path.
  • test_invalid_parameter_size_has_clear_error asserts the RuntimeError propagates out of a real DeepEval.eval call. fix(infer): normalize parameter shorthand before batching #5857 tests the error branches only by calling _standardize_fparam_aparam directly in source/tests/common/test_deep_eval_parameter_shorthand.py, so nothing there proves the exception survives the adapter and the batcher.

None of this needs changing in this PR -- the coverage is correct as written. But when #5857 merges and this rebases down to just this file, folding these three into the shared helper would give every backend what dpmodel gets here, instead of leaving dpmodel with the stronger suite by accident.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed — this assertion stays here, and the same gap is now closed in the shared helper. _assert_backend_parameter_shorthand in #5857's source/tests/consistent/io/test_io.py now asserts that the two input frames produce different per-frame energy values on every shorthand case (commit 1709902 on #5857), so a degenerate expansion that reuses frame 0's parameters everywhere can no longer satisfy the comparison by also making the reference degenerate. This PR was rebased onto the updated #5857 (692789d); its own test still passes (9 tests).

Coding agent: opencode
opencode version: 1.18.9
Model: ustc/deepseek-v4-flash
Reasoning effort: max

njzjz-bot and others added 3 commits August 2, 2026 22:06
…r routes

Wire _standardize_fparam_aparam into eval_descriptor and
eval_fitting_last_layer so shared per-atom shorthand cannot be mistaken
for a frame axis before _prepare_nlist_inputs reshapes it. Extend the
pt_expt adapter regressions to cover both routes.

Coding-Agent: opencode
opencode-Version: 1.18.9
Model: ustc/deepseek-v4-flash
Reasoning-Effort: max
The backend-direct shorthand comparison never checked that the two input
frames actually differ, so a degenerate expansion that reuses one frame's
parameters for every frame would also make the frame-major reference
degenerate and slip past the allclose comparison. Assert the per-frame
energy values differ on every shorthand case.

Coding-Agent: opencode
opencode-Version: 1.18.9
Model: ustc/deepseek-v4-flash
Reasoning-Effort: max
Stack the dpmodel-specific regression on the shared backend normalization from deepmodeling#5857. Use distinct coordinates and frame-major parameters, run shorthand inputs on fresh batchers, and verify split evaluation preserves frame order and distinct energies.

Coding-Agent: Codex
Codex-Version: codex-cli 0.144.6
Model: gpt-5.6-sol
Reasoning-Effort: xhigh
@njzjz
njzjz force-pushed the fix/dpmodel-deepeval-param-shorthand-5662 branch from e7505f2 to 692789d Compare August 2, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Code scan] Honor documented fparam/aparam shorthand in dpmodel DeepEval

3 participants