Commit Graph
9 Commits
Author SHA1 Message Date
ClaudeandClaude Opus 5.5 93d1cddd27 BlockLayout2D.build: check capacity before generating regular origins
c397e08 moved the 64-bit capacity check after np.arange(nby*nbx), so an
over-limit regular layout allocated before rejecting. Check arithmetic
block count (regular) or validated selected count (sparse) first; mock
regression asserts no np.arange before the ValueError.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 03:27:13 +00:00
ClaudeandClaude Opus 5.5 cc64abcafe BlockLayout2D.to_dense: require floats when the layout has holes
Holes are filled with NaN, which bool/str silently mangled and integers
rejected with a conversion error. Sparse layouts now raise a clear
ValueError for non-floating arrays; full layouts keep any dtype.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 03:16:52 +00:00
ClaudeandClaude Opus 5.5 aecee19c19 BlockLayout2D: copy caller-supplied origins
An int64 C-contiguous origins array was kept by reference (and frozen in
the caller's hands), so mutating it later changed layout.origins and
block_cell without changing owner/halos. Copy before marking read-only;
regression checks origins, owner and block_cell invariance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 03:15:37 +00:00
ClaudeandClaude Opus 5.5 fa7fd9097a Test: map the q<.5 variant of a sparse cut link separately
The fixture listed (fluid_idx=13, dir=3) twice with different q, so the
existing repeated-link rejection fired before the sparse checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 03:14:55 +00:00
ClaudeandClaude Opus 5.5 c397e08565 BlockLayout2D: explicit selected block origins with hole owners
build(..., origins=None|[(y0, x0), ...]) stores only grid-aligned selected
blocks (unique, strictly row-major, no silent reordering). Cells of absent
blocks own layout.hole (= nblocks*L, one past the last block cell) so an
unguarded index fails rather than wrapping like -1; layout.owned is the
dense mask. Halo pairs never read holes, to_blocked ignores hole values,
to_dense returns NaN there, map_cut_links rejects receivers, solid
neighbors or q<.5 donors in absent blocks, blocked_link_tables stores
owned flags only. origins=None or every origin reproduces the regular
layout exactly. Storage only: no CUDA or stepper changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 03:09:15 +00:00
ClaudeandClaude Opus 5.5 118635aebd Reject non-integral, bool and out-of-range block-layout indices
One _index helper guards block_cell (block, y, x), slot (block_cell, q)
and map_cut_links (fluid_idx, dir) before addressing; previously e.g.
block_cell(-1, 0, 0) returned -49 and fractional values were truncated.
Adds focused rejection tests and Astra's one-block seam reproducer
(build(4,8,4,8), receiver (2,0), dir 2 -> west-halo slot 90).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 02:39:15 +00:00
ClaudeandClaude Opus 5.5 2a68d7e7c7 Fix periodic-seam cut-link addressing in map_cut_links
Source (write) and reverse-donor addresses are now the receiver's local
core address +/- (ey*local_nx + ex), i.e. the window image the next local
pull reads. block_cell preferred the in-window core image on a one-block
periodic axis, so BFL wrote a copy the pull never reads. Physical
neighbors are still formed only to reject non-periodic exteriors.
block_cell semantics unchanged; docstring notes the image ambiguity.
Adds an end-to-end synthetic seam test (x=0/x=nx-1/corner wraps) on
one-block-x, one-block-y and 1x1 periodic layouts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 02:38:13 +00:00
ClaudeandClaude Opus 5.5 2aadffe183 Add receiver-local static cut-link mapping to BlockLayout2D
Each physical link belongs once to the block owning its fluid receiver
core; the reflected source population is written into that block's own
core/halo copy (no halo copy between BFL and pull). Rejects repeated
links and repeated local writers; one row per link so force counts once.
Documents stale remote solid-core slots vs unique core ownership, and
that the 4-cell refinement halo is separate. Static geometry only.
Tests: address equivalence incl. cross-block q<.5 donors, and static
BFL+pull bit-equal to the dense operator on fluid cells.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 02:33:00 +00:00
ClaudeandClaude Opus 5.5 a64af5bece Add CPU BlockLayout2D: core ownership, halo pairs, blocked packing
Fixed-size 2D blocks, block-contiguous Q-major storage, explicit per-axis
periodicity; non-periodic exterior halo cells stay unpaired (NaN).
Provides owner/halo tables for a later periodic GPU consumer. Cut-link
mapping deliberately omitted until the BFL write policy is settled.
Tests: ownership, pair invariants, pack round trip, tagged pull vs dense.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 02:30:40 +00:00