Skip to content

feat(octree near): occupancy-bucketed compact W-tile near-field builder#40

Merged
TobiBu merged 2 commits into
mainfrom
feat/octree-compact-nearfield
Jul 16, 2026
Merged

feat(octree near): occupancy-bucketed compact W-tile near-field builder#40
TobiBu merged 2 commits into
mainfrom
feat/octree-compact-nearfield

Conversation

@TobiBu

@TobiBu TobiBu commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

Adds octree_nearfield_tiles.build_octree_nearfield_tiles — a static-shape builder that turns an adaptive octree's occupancy-bounded near CSR into occupancy-bucketed, padding-free W-tiles for the near-field P2P.

Each adaptive cell is re-packed into full uniform width-W tiles (cell-respecting, so tile-pairs map 1:1 onto cell-pairs — no cross-cell masking, no double-counting), and each tile's source-tile list is densely compacted to a capacity sized by the actual near work rather than the (1 + u_capacity) * ceil(max_leaf/W) worst case. Shapes depend only on (num_tiles_cap, W, max_source_tiles), so it compiles once and is reused across timesteps; overflow is a single eager-checked boolean.

Consumed by jaccpot's octree near field as the near_mode="compact_wtile" structure (separate jaccpot PR).

Validation (tests/unit/test_octree_nearfield_tiles.py, 100% module coverage)

  • Coverage / cell-respecting: every particle in exactly one tile; every tile confined to a single leaf cell.
  • Source-tile completeness: each target tile's compacted source set == the reference leaf-near expansion (own cell's other tiles + U-neighbour cells' tiles), self-excluded.
  • Overflow flag trips exactly when a cap is under-sized.

🤖 Generated with Claude Code

TobiBu and others added 2 commits July 16, 2026 15:33
Adds `octree_nearfield_tiles.build_octree_nearfield_tiles`: re-packs an adaptive
octree's occupancy-bounded near CSR into full uniform W-tiles (cell-respecting, so
tile-pairs map 1:1 onto cell-pairs) with a per-tile source-tile list densely
compacted to a capacity sized by actual near work (not the (1+u_cap)*mbpl worst
case). Static-shape (compiles once, reused across steps); overflow surfaced as a
single eager-checked boolean. Drops into jaccpot's octree near field as the
`near_mode="compact_wtile"` structure.

Tests (tests/unit/test_octree_nearfield_tiles.py, 100% module coverage): tile
coverage / cell-respecting partition, source-tile completeness vs the reference
leaf-near expansion, and overflow-flag correctness.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@TobiBu
TobiBu merged commit 98e4abe into main Jul 16, 2026
5 of 6 checks passed
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