linkcell 0.3.6__tar.gz → 0.3.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. {linkcell-0.3.6 → linkcell-0.3.7}/CHANGELOG.md +6 -0
  2. {linkcell-0.3.6 → linkcell-0.3.7}/Cargo.lock +2 -2
  3. {linkcell-0.3.6 → linkcell-0.3.7}/Cargo.toml +1 -1
  4. {linkcell-0.3.6 → linkcell-0.3.7}/PKG-INFO +2 -2
  5. {linkcell-0.3.6 → linkcell-0.3.7}/README.md +1 -1
  6. {linkcell-0.3.6 → linkcell-0.3.7}/docs/how-to/embed-c.md +1 -1
  7. {linkcell-0.3.6 → linkcell-0.3.7}/meson.build +1 -1
  8. {linkcell-0.3.6 → linkcell-0.3.7}/pyproject.toml +1 -1
  9. {linkcell-0.3.6 → linkcell-0.3.7}/python/Cargo.toml +1 -1
  10. {linkcell-0.3.6 → linkcell-0.3.7}/src/pairs.rs +64 -2
  11. {linkcell-0.3.6 → linkcell-0.3.7}/tests/python/test_knearest.py +1 -1
  12. {linkcell-0.3.6 → linkcell-0.3.7}/.github/scripts/setup-msvc.ps1 +0 -0
  13. {linkcell-0.3.6 → linkcell-0.3.7}/.github/workflows/ci.yml +0 -0
  14. {linkcell-0.3.6 → linkcell-0.3.7}/.github/workflows/publish.yml +0 -0
  15. {linkcell-0.3.6 → linkcell-0.3.7}/.github/workflows/wheels.yml +0 -0
  16. {linkcell-0.3.6 → linkcell-0.3.7}/.gitignore +0 -0
  17. {linkcell-0.3.6 → linkcell-0.3.7}/CITATION.cff +0 -0
  18. {linkcell-0.3.6 → linkcell-0.3.7}/CMakeLists.txt +0 -0
  19. {linkcell-0.3.6 → linkcell-0.3.7}/LICENSE +0 -0
  20. {linkcell-0.3.6 → linkcell-0.3.7}/assets/branding/README.md +0 -0
  21. {linkcell-0.3.6 → linkcell-0.3.7}/assets/branding/linkcell-icon.svg +0 -0
  22. {linkcell-0.3.6 → linkcell-0.3.7}/assets/branding/linkcell-logo-dark.svg +0 -0
  23. {linkcell-0.3.6 → linkcell-0.3.7}/assets/branding/linkcell-logo-light.svg +0 -0
  24. {linkcell-0.3.6 → linkcell-0.3.7}/assets/branding/linkcell-mark.jpg +0 -0
  25. {linkcell-0.3.6 → linkcell-0.3.7}/build.rs +0 -0
  26. {linkcell-0.3.6 → linkcell-0.3.7}/cbindgen.toml +0 -0
  27. {linkcell-0.3.6 → linkcell-0.3.7}/changelog.d/.gitkeep +0 -0
  28. {linkcell-0.3.6 → linkcell-0.3.7}/changelog.d/README.md +0 -0
  29. {linkcell-0.3.6 → linkcell-0.3.7}/cmake/linkcell-gpu.pc.in +0 -0
  30. {linkcell-0.3.6 → linkcell-0.3.7}/cmake/linkcell.pc.in +0 -0
  31. {linkcell-0.3.6 → linkcell-0.3.7}/cmake/linkcellConfig.cmake.in +0 -0
  32. {linkcell-0.3.6 → linkcell-0.3.7}/docs/explanation/mic-and-cells.md +0 -0
  33. {linkcell-0.3.6 → linkcell-0.3.7}/docs/how-to/embed-cpp.md +0 -0
  34. {linkcell-0.3.6 → linkcell-0.3.7}/docs/how-to/embed-python.md +0 -0
  35. {linkcell-0.3.6 → linkcell-0.3.7}/docs/how-to/pkg-config.md +0 -0
  36. {linkcell-0.3.6 → linkcell-0.3.7}/docs/index.md +0 -0
  37. {linkcell-0.3.6 → linkcell-0.3.7}/docs/reference/algorithm.md +0 -0
  38. {linkcell-0.3.6 → linkcell-0.3.7}/docs/reference/c-api.md +0 -0
  39. {linkcell-0.3.6 → linkcell-0.3.7}/docs/tutorials/two-points.md +0 -0
  40. {linkcell-0.3.6 → linkcell-0.3.7}/examples/knn_hot.rs +0 -0
  41. {linkcell-0.3.6 → linkcell-0.3.7}/examples/knn_scale.rs +0 -0
  42. {linkcell-0.3.6 → linkcell-0.3.7}/examples/meson.build +0 -0
  43. {linkcell-0.3.6 → linkcell-0.3.7}/examples/pairs_scale.rs +0 -0
  44. {linkcell-0.3.6 → linkcell-0.3.7}/examples/two_points.c +0 -0
  45. {linkcell-0.3.6 → linkcell-0.3.7}/examples/two_points.cpp +0 -0
  46. {linkcell-0.3.6 → linkcell-0.3.7}/include/linkcell.h +0 -0
  47. {linkcell-0.3.6 → linkcell-0.3.7}/include/linkcell.hpp +0 -0
  48. {linkcell-0.3.6 → linkcell-0.3.7}/include/linkcell_gpu.h +0 -0
  49. {linkcell-0.3.6 → linkcell-0.3.7}/include/linkcell_gpu.hpp +0 -0
  50. {linkcell-0.3.6 → linkcell-0.3.7}/linkcell/__init__.py +0 -0
  51. {linkcell-0.3.6 → linkcell-0.3.7}/meson_options.txt +0 -0
  52. {linkcell-0.3.6 → linkcell-0.3.7}/python/build.rs +0 -0
  53. {linkcell-0.3.6 → linkcell-0.3.7}/python/src/gpu.rs +0 -0
  54. {linkcell-0.3.6 → linkcell-0.3.7}/python/src/lib.rs +0 -0
  55. {linkcell-0.3.6 → linkcell-0.3.7}/scripts/bench-kokkos.sh +0 -0
  56. {linkcell-0.3.6 → linkcell-0.3.7}/scripts/bench-pairs.sh +0 -0
  57. {linkcell-0.3.6 → linkcell-0.3.7}/scripts/bench-strong.sh +0 -0
  58. {linkcell-0.3.6 → linkcell-0.3.7}/scripts/check-install.sh +0 -0
  59. {linkcell-0.3.6 → linkcell-0.3.7}/scripts/copy-cargo-artifacts.py +0 -0
  60. {linkcell-0.3.6 → linkcell-0.3.7}/scripts/cutoff_work.py +0 -0
  61. {linkcell-0.3.6 → linkcell-0.3.7}/scripts/pop-report.py +0 -0
  62. {linkcell-0.3.6 → linkcell-0.3.7}/scripts/regen-capi-headers.sh +0 -0
  63. {linkcell-0.3.6 → linkcell-0.3.7}/src/bins.rs +0 -0
  64. {linkcell-0.3.6 → linkcell-0.3.7}/src/capi.rs +0 -0
  65. {linkcell-0.3.6 → linkcell-0.3.7}/src/cell.rs +0 -0
  66. {linkcell-0.3.6 → linkcell-0.3.7}/src/error.rs +0 -0
  67. {linkcell-0.3.6 → linkcell-0.3.7}/src/gpu/capi.cpp +0 -0
  68. {linkcell-0.3.6 → linkcell-0.3.7}/src/gpu/gpulite_compat.hpp +0 -0
  69. {linkcell-0.3.6 → linkcell-0.3.7}/src/gpu/knearest.cpp +0 -0
  70. {linkcell-0.3.6 → linkcell-0.3.7}/src/knearest.rs +0 -0
  71. {linkcell-0.3.6 → linkcell-0.3.7}/src/kokkos/CMakeLists.txt +0 -0
  72. {linkcell-0.3.6 → linkcell-0.3.7}/src/kokkos/bench.cpp +0 -0
  73. {linkcell-0.3.6 → linkcell-0.3.7}/src/kokkos/knearest.cpp +0 -0
  74. {linkcell-0.3.6 → linkcell-0.3.7}/src/kokkos/knearest.hpp +0 -0
  75. {linkcell-0.3.6 → linkcell-0.3.7}/src/lib.rs +0 -0
  76. {linkcell-0.3.6 → linkcell-0.3.7}/src/pop.rs +0 -0
  77. {linkcell-0.3.6 → linkcell-0.3.7}/subprojects/gpulite.wrap +0 -0
  78. {linkcell-0.3.6 → linkcell-0.3.7}/subprojects/packagefiles/gpulite/meson.build +0 -0
  79. {linkcell-0.3.6 → linkcell-0.3.7}/tests/abi.rs +0 -0
  80. {linkcell-0.3.6 → linkcell-0.3.7}/tests/agree.rs +0 -0
  81. {linkcell-0.3.6 → linkcell-0.3.7}/tests/cmake-consumer/CMakeLists.txt +0 -0
  82. {linkcell-0.3.6 → linkcell-0.3.7}/tests/cmake-consumer/gpu.cpp +0 -0
  83. {linkcell-0.3.6 → linkcell-0.3.7}/tests/gpu_agree.cpp +0 -0
  84. {linkcell-0.3.6 → linkcell-0.3.7}/tests/python/test_agree_vesin.py +0 -0
  85. {linkcell-0.3.6 → linkcell-0.3.7}/tests/python/test_knearest_cuda.py +0 -0
  86. {linkcell-0.3.6 → linkcell-0.3.7}/tests/python/test_pairs.py +0 -0
  87. {linkcell-0.3.6 → linkcell-0.3.7}/third_party/gpulite/LICENSE +0 -0
  88. {linkcell-0.3.6 → linkcell-0.3.7}/third_party/gpulite/README.md +0 -0
  89. {linkcell-0.3.6 → linkcell-0.3.7}/third_party/gpulite/gpulite/gpulite.hpp +0 -0
  90. {linkcell-0.3.6 → linkcell-0.3.7}/towncrier.toml +0 -0
@@ -10,6 +10,12 @@ by [towncrier](https://towncrier.readthedocs.io/).
10
10
 
11
11
  <!-- towncrier release notes start -->
12
12
 
13
+ ## [0.3.7] - 2026-10-04
14
+
15
+ ### Fixed
16
+
17
+ - The cutoff list sizes its row buffer from the pairs it found. A shell denser than the ideal-gas estimate no longer writes past that buffer.
18
+
13
19
  ## [0.3.6] - 2026-10-04
14
20
 
15
21
  ### Changed
@@ -79,7 +79,7 @@ checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
79
79
 
80
80
  [[package]]
81
81
  name = "linkcell"
82
- version = "0.3.6"
82
+ version = "0.3.7"
83
83
  dependencies = [
84
84
  "minimage",
85
85
  "rayon",
@@ -87,7 +87,7 @@ dependencies = [
87
87
 
88
88
  [[package]]
89
89
  name = "linkcell-python"
90
- version = "0.3.6"
90
+ version = "0.3.7"
91
91
  dependencies = [
92
92
  "cc",
93
93
  "dlpk",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "linkcell"
3
- version = "0.3.6"
3
+ version = "0.3.7"
4
4
  edition = "2021"
5
5
  rust-version = "1.70"
6
6
  description = "Periodic linked-cell cutoff pairs and k-nearest neighbour search"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: linkcell
3
- Version: 0.3.6
3
+ Version: 0.3.7
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: Programming Language :: Python :: 3.12
@@ -96,7 +96,7 @@ As a wrap, Meson exposes `linkcell_dep`:
96
96
  ```
97
97
  [wrap-git]
98
98
  url = https://github.com/d-SEAMS/linkcell.git
99
- revision = v0.3.6
99
+ revision = v0.3.7
100
100
  depth = 1
101
101
 
102
102
  [provide]
@@ -74,7 +74,7 @@ As a wrap, Meson exposes `linkcell_dep`:
74
74
  ```
75
75
  [wrap-git]
76
76
  url = https://github.com/d-SEAMS/linkcell.git
77
- revision = v0.3.6
77
+ revision = v0.3.7
78
78
  depth = 1
79
79
 
80
80
  [provide]
@@ -20,7 +20,7 @@ the pointer.
20
20
  ```
21
21
  [wrap-git]
22
22
  url = https://github.com/d-SEAMS/linkcell.git
23
- revision = v0.3.6
23
+ revision = v0.3.7
24
24
  depth = 1
25
25
 
26
26
  [provide]
@@ -2,7 +2,7 @@ project(
2
2
  'linkcell',
3
3
  ['c', 'cpp'],
4
4
  # Keep in lockstep with Cargo.toml [package].version (source of truth).
5
- version: '0.3.6',
5
+ version: '0.3.7',
6
6
  meson_version: '>=1.2.0',
7
7
  license: 'MIT',
8
8
  default_options: [
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "linkcell"
7
- version = "0.3.6"
7
+ version = "0.3.7"
8
8
  description = "Periodic linked-cell cutoff pairs and k-nearest neighbour search"
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "linkcell-python"
3
- version = "0.3.6"
3
+ version = "0.3.7"
4
4
  edition = "2021"
5
5
  rust-version = "1.88"
6
6
  license = "MIT"
@@ -730,8 +730,9 @@ impl Walk<'_> {
730
730
  fn gather_into(&self, found: &mut Vec<Pair>, scratch: &mut Scratch, start: usize, end: usize) {
731
731
  let n_src = self.mesh.offsets[end] - self.mesh.offsets[start];
732
732
  let rows = self.guess_rows(n_src);
733
+ // reserve(n) makes capacity >= len + n.
733
734
  if found.capacity() < rows {
734
- found.reserve(rows - found.capacity());
735
+ found.reserve(rows - found.len());
735
736
  }
736
737
  self.fill_only(found, scratch, start, end);
737
738
  self.commit(found, scratch);
@@ -787,8 +788,10 @@ impl Walk<'_> {
787
788
  rows.push(n);
788
789
  total += n;
789
790
  }
791
+ // reserve(n) makes capacity >= len + n. The ideal-gas estimate
792
+ // may already hold a shorter buffer.
790
793
  if found.capacity() < total {
791
- found.reserve(total - found.capacity());
794
+ found.reserve(total - found.len());
792
795
  }
793
796
  let mut off = Vec::with_capacity(chunks.len() + 1);
794
797
  off.push(0usize);
@@ -1328,6 +1331,65 @@ mod tests {
1328
1331
  use super::*;
1329
1332
  use crate::Cell;
1330
1333
 
1334
+ #[test]
1335
+ fn tight_cluster_matches_brute_force() {
1336
+ // Every pair sits inside the cutoff, and the box is large, so the
1337
+ // ideal-gas row estimate is a handful. The walk still has to
1338
+ // return the full list. 520 is above the parallel split.
1339
+ let n = 520usize;
1340
+ let mut xyz = vec![[0.0f64; 3]; n];
1341
+ let g = 9i32;
1342
+ let mut k = 0usize;
1343
+ 'fill: for z in 0..g {
1344
+ for y in 0..g {
1345
+ for x in 0..g {
1346
+ if k >= n {
1347
+ break 'fill;
1348
+ }
1349
+ xyz[k] = [x as f64 * 0.05, y as f64 * 0.05, z as f64 * 0.05];
1350
+ k += 1;
1351
+ }
1352
+ }
1353
+ }
1354
+ let sim = Cell::ortho(80.0, 80.0, 80.0).unwrap();
1355
+ let cutoff = 2.0;
1356
+ let cut2 = cutoff * cutoff;
1357
+ let mut brute: Vec<(usize, usize, f64)> = Vec::new();
1358
+ for i in 0..n {
1359
+ for j in (i + 1)..n {
1360
+ let dx = xyz[j][0] - xyz[i][0];
1361
+ let dy = xyz[j][1] - xyz[i][1];
1362
+ let dz = xyz[j][2] - xyz[i][2];
1363
+ let d2 = dx * dx + dy * dy + dz * dz;
1364
+ if d2 < cut2 {
1365
+ brute.push((i, j, d2));
1366
+ brute.push((j, i, d2));
1367
+ }
1368
+ }
1369
+ }
1370
+ brute.sort_by(|a, b| (a.0, a.1).cmp(&(b.0, b.1)));
1371
+ let run = || pairs_within(&xyz, &sim, cutoff, None, None, false).unwrap();
1372
+ #[cfg(feature = "parallel")]
1373
+ let got = {
1374
+ let pool = rayon::ThreadPoolBuilder::new()
1375
+ .num_threads(4)
1376
+ .build()
1377
+ .unwrap();
1378
+ pool.install(run)
1379
+ };
1380
+ #[cfg(not(feature = "parallel"))]
1381
+ let got = run();
1382
+ let mut rows: Vec<(usize, usize, f64)> = got.iter().map(|p| (p.i, p.j, p.dist2)).collect();
1383
+ rows.sort_by(|a, b| (a.0, a.1).cmp(&(b.0, b.1)));
1384
+ assert_eq!(rows.len(), n * (n - 1));
1385
+ assert_eq!(rows.len(), brute.len());
1386
+ for (got_row, brute_row) in rows.iter().zip(brute.iter()) {
1387
+ assert_eq!(got_row.0, brute_row.0);
1388
+ assert_eq!(got_row.1, brute_row.1);
1389
+ assert!((got_row.2 - brute_row.2).abs() < 1e-9);
1390
+ }
1391
+ }
1392
+
1331
1393
  #[test]
1332
1394
  fn far_image_is_not_rewrapped() {
1333
1395
  let sim = Cell::ortho(10.0, 10.0, 10.0).unwrap();
@@ -10,7 +10,7 @@ def _pair(xyz, cell, k, **kwargs):
10
10
 
11
11
 
12
12
  def test_version():
13
- assert linkcell.__version__ == "0.3.6"
13
+ assert linkcell.__version__ == "0.3.7"
14
14
 
15
15
 
16
16
  def test_periodic_image():
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes