Skip to content

fix: reject aliased cell-list layouts#274

Merged
galjos merged 5 commits into
devfrom
fix/cell-list-alias-guard
Jul 23, 2026
Merged

fix: reject aliased cell-list layouts#274
galjos merged 5 commits into
devfrom
fix/cell-list-alias-guard

Conversation

@galjos

@galjos galjos commented Jun 12, 2026

Copy link
Copy Markdown
Member

Summary

  • Add a runtime guard that rejects cell-list configurations where periodic neighbor offsets can alias the same cell.
  • Add a regression test for the invalid 2-cell layout.
  • Update the cell-list setup fixture to use a valid box/cutoff/cell-count combination.

Root cause

The half-neighbor cell-list stencil assumes enough cells per dimension to represent each neighbor offset without wrapping onto already represented cells. If nCells < 2 * nNeighbourCells + 1, periodic wrapping can alias offsets and make the neighbor list mathematically invalid.

Validation

  • cmake --build build-stochastic-rescale-ci --target testCelllist testCelllistSetup --parallel 4
  • ctest --test-dir build-stochastic-rescale-ci -R '^(testCelllist|testCelllistSetup)$' --output-on-failure

Reference

@galjos
galjos requested a review from 97gamjak June 12, 2026 12:57
@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 89.24%. Comparing base (d0069f7) to head (eddea27).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #274   +/-   ##
=======================================
  Coverage   89.23%   89.24%           
=======================================
  Files         286      286           
  Lines       11025    11033    +8     
  Branches     3432     3437    +5     
=======================================
+ Hits         9838     9846    +8     
  Misses       1147     1147           
  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
Comment thread src/simulationBox/celllist.cpp Outdated
@galjos
galjos requested a review from ape33 June 29, 2026 06:43
Comment thread src/simulationBox/celllist.cpp
@galjos
galjos requested a review from 97gamjak July 10, 2026 16:38
@galjos
galjos dismissed 97gamjak’s stale review July 21, 2026 12:03

Requested change addressed in eddea27; review re-requested.

@galjos
galjos merged commit c9e2f2d into dev Jul 23, 2026
9 checks passed
@galjos
galjos deleted the fix/cell-list-alias-guard branch July 23, 2026 19:39
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.

3 participants