Skip to content

Scaling improves - #179

Merged
lmiq merged 9 commits into
mainfrom
scaling_improves
Aug 18, 2026
Merged

Scaling improves#179
lmiq merged 9 commits into
mainfrom
scaling_improves

Conversation

@lmiq

@lmiq lmiq commented Aug 13, 2026

Copy link
Copy Markdown
Member

No description provided.

lmiq added 9 commits August 10, 2026 09:45
…ered over a huge address range (3.4 GB span for 40 MB of real data at n=1M).

cl.cells itself was visited via cell_indices_real in particle-arrival order (effectively random for the serial build path), not spatial order — this turned out to be the bigger contributor.
Fix: a single _compact_particles! post-processing pass, run once at the end of every cell-list build (regardless of which of the four build paths produced it), that:

copies each cell's particles into one flat, contiguous cl.particles buffer, and
reorders cl.cells itself into linear cell-index (spatial) order, remapping cell_indices/cell_indices_real to match.
…th a stride equal to the batch count — actively fights the earlier cache-locality fix as batch count grows) to Consecutive() (keeps each chunk spatially contiguous, matching the cell ordering from _compact_particles!).

Replaced the static "one fixed chunk per thread" scheme with a work-queue: cells are split into 16 × nbatches small chunks, and a fixed pool of nbatches worker tasks pulls chunks on demand from a shared atomic counter. Faster cores (P-cores) naturally claim more chunks; slower cores (E-cores) do fewer — this is the "distribute to free processors on demand" behavior you asked about.
Memory stays exactly what it was: output_threaded is still sized to nbatches (not to chunk count), so there's no regression for large vector-valued outputs like the ones you flagged as a concern.
@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.48485% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.65%. Comparing base (b63a475) to head (45344ac).

Files with missing lines Patch % Lines
src/internals/CellLists.jl 97.60% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #179      +/-   ##
==========================================
- Coverage   98.87%   98.65%   -0.23%     
==========================================
  Files          21       21              
  Lines        1515     1631     +116     
==========================================
+ Hits         1498     1609     +111     
- Misses         17       22       +5     

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

@lmiq
lmiq merged commit 106c5f3 into main Aug 18, 2026
18 of 20 checks passed
@lmiq
lmiq deleted the scaling_improves branch August 18, 2026 11:38
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.

1 participant