Skip to content

fix: count non-adjacent atom types#271

Open
galjos wants to merge 1 commit into
devfrom
fix/atom-type-counting
Open

fix: count non-adjacent atom types#271
galjos wants to merge 1 commit into
devfrom
fix/atom-type-counting

Conversation

@galjos

@galjos galjos commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add utilities::getUniqueElements for sorted unique vector values.
  • Use the helper in Molecule and MoleculeType atom-type counting.
  • Keep the non-adjacent duplicate regression and add direct helper coverage.

Root cause

std::ranges::unique only compacts consecutive equivalent elements. Without sorting first, non-adjacent duplicate atom types were counted as separate atom types.

Validation

  • ctest --test-dir build-pr271-static -R '^(testMolecule|testCollectionUtilities)$' --output-on-failure

Reference

@galjos galjos requested a review from 97gamjak June 12, 2026 12:53
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.26%. Comparing base (56d4cb3) to head (8d4720d).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #271   +/-   ##
=======================================
  Coverage   88.26%   88.26%           
=======================================
  Files         284      285    +1     
  Lines       10964    10966    +2     
  Branches     3416     3414    -2     
=======================================
+ Hits         9677     9679    +2     
  Misses       1247     1247           
  Partials       40       40           

☔ 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 Jun 12, 2026

Copy link
Copy Markdown

⚡ Performance (instruction count) — ✅ no regressions

per-benchmark breakdown
benchmark base Ir PR Ir Δ
bondedForces 41.46M 41.46M -0.00%
boxTransforms 10.67M 10.67M +0.00%
constraints 11.38M 11.38M -0.00%
coulombKernel 5.80M 5.80M +0.00%
forceKernel 15.33M 15.33M -0.00%
integrator 32.17M 32.17M -0.00%
kinetics 9.53M 9.53M +0.00%
linearAlgebra 2.08M 2.08M +0.00%
nonCoulombPairs 5.48M 5.48M -0.00%
shiftVector 5.81M 5.81M +0.00%
virial 11.63M 11.63M +0.00%

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

@galjos galjos added the bug Something isn't working label Jun 14, 2026
@97gamjak

Copy link
Copy Markdown
Collaborator

ibwould lile to have this generalized with a getuniqueelements or smth similar

@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 other comment

@galjos galjos force-pushed the fix/atom-type-counting branch from 070b4d9 to 8d4720d Compare June 23, 2026 07:25
@galjos galjos requested a review from 97gamjak June 23, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants