Skip to content

fix: handle zero-temperature rescaling - #350

Open
galjos wants to merge 7 commits into
devfrom
fix/zero-temperature-rescaling
Open

fix: handle zero-temperature rescaling#350
galjos wants to merge 7 commits into
devfrom
fix/zero-temperature-rescaling

Conversation

@galjos

@galjos galjos commented Jul 28, 2026

Copy link
Copy Markdown
Member

Closes #345.

  • keep zero-to-zero velocity rescaling finite
  • reject positive targets from zero kinetic temperature
  • apply the same rule to hard reset, Berendsen, and velocity-rescaling paths

Tests:

  • testResetKinetics
  • testThermostat

@galjos
galjos requested review from 97gamjak and ape33 July 28, 2026 15:46
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.84%. Comparing base (109a355) to head (cc9ed25).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #350      +/-   ##
==========================================
+ Coverage   89.83%   89.84%   +0.01%     
==========================================
  Files         291      291              
  Lines       11535    11551      +16     
  Branches     3601     3609       +8     
==========================================
+ Hits        10362    10378      +16     
  Misses       1131     1131              
  Partials       42       42              

☔ 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.

@pq-perf-bot

pq-perf-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

⚡ Performance (instruction count) — ✅ no regressions

per-benchmark breakdown
benchmark base Ir PR Ir Δ
bondedForces 41.47M 41.47M -0.00%
boxTransforms 10.67M 10.67M +0.00%
constraints 11.41M 11.41M +0.00%
coulombKernel 5.80M 5.80M +0.00%
forceKernel 15.35M 15.35M +0.00%
integrator 32.19M 32.19M +0.00%
kinetics 9.53M 9.53M +0.00%
linearAlgebra 2.07M 2.07M +0.00%
nonCoulombPairs 5.48M 5.48M +0.00%
shiftVector 5.81M 5.81M +0.00%
virial 11.64M 11.64M -0.07%

Deterministic callgrind instruction counts vs the base branch; gated at ±2%. Not wall-clock.

@galjos galjos reopened this Jul 30, 2026
return;
}

if (isZero(_temperature))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what about updating this second if-statement condition to

if (isZero(_temperature) && !isZero(targetTemp))

then you could omit the first if all together

@97gamjak 97gamjak 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.

see ape comment

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.

3 participants