Tests cover failures at the first upload, the step-group sync, the no_donor
check, the hold-record upload and its asynchronous sync: before the commit
point the target stays pending, after it applied matches the moved device;
in every case run and direct stepper reuse are refused.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MovingCircleCells reclassifies swept-band cells from immutable old/new FP64
predicates: covered cells add their raw momentum and mass to diagnostics and
become solid; uncovered cells are refilled in all nine slots from donors
fluid in both geometries (mean density, NEQ from the best-aligned donor,
wall velocity at the cell), counting eq_only and no_donor. MovingCircleLinks
adds the translation velocity to the wall velocity. Simulation.run(1)
uploads the motion record, runs M1 then M2, synchronizes, rejects a nonzero
no_donor count and only then commits the target and uploads the hold
record; any failure marks the Simulation failed. Targets block direct
stepper calls and multi-step runs. get_flags reads device flags back when
translating circles exist. Contract section 10b.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
moving_diagnostics is context_bound, so stream synchronization and the
DTOH copy run inside one owner activation. Tests: owner stays active
through sync and download; launch order moving -> static curved -> OneStep
with a real static link count and the buffer swap between steps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MovingCircleLinks computes the cut links of each translating circle from an
FP64 {cx, cy, r} table over its swept band (same q/hit/clamp/fallback order
as build_cut_links, explicit _rn operations) and applies the unchanged
apply_bouzidi_link with spin wall velocity. obs keeps its contract; a
separate per-body diagnostics buffer records CME, the Wen term u_w*dm,
link_dm and the link count. Moving tables are built at initialize and
attached to the stepper, which then launches the kernel before the static
curved kernel; until then direct and run steps stay blocked. Displacement
is disabled: set_body offset/vx/vy on a translating circle raises before
mutation. Contract section 10a documents S2a and the S3 pending rule.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test_failed_moving_step_marks_simulation_failed uses an owner double that
refuses activation after close like CudaContext and expects 'CUDA context
is closed'; test_passive_overlap_failure_keeps_live_state binds the real
moving-body validation methods and a stepper double.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No reachable path leaves a stale latch (Grok review): initialize and
_recompile recompute it, and post-init removal of a translating circle
cannot commit. simulation.py is back to b448bc3f; the latch-only test is
dropped. The recompile, close-retry and tightened after-close tests stay.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps the stationary add/remove path unchanged (test_surface_actuation builds
a Simulation without a stepper).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One helper sets stepper.blocked from _moving_bodies() after add_body,
pre-init remove_body, initialize and stepper recreation, so the latch never
disagrees with motion ownership. Tests: latch follows add/remove; the
after-close assertion checks the actual refusal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LBMStepper.step raises before any launch or buffer swap when the owner has
set 'blocked'; Simulation sets it when a translating circle is declared, at
initialize and after stepper recreation. Tests: direct-stepper guard (zero
launches, no swap, unchanged step count), spin/multi-step/checkpoint run
variants, run(0) keeps the pending target, static runs proceed, mixed
moving/static packing parity with the moving id absent, failure refusal of
checkpoint calls, no retry and no re-entry after close.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed MovingCircle.advance now calls the owner hook, so the Simulation
is marked failed (Jet lifecycle) and refuses run/step/sync until close().
Adds host tests for set_body routing on real objects, initialize band and
mode rejections before mutation, exclusion from static link packing, and
the Simulation failure lifecycle. Contract status line updated for S1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MovingCircle keeps the applied offset and an optional pending target apart,
validates targets against the applied offset (box, Euclidean 0.5-cell step,
speed, no sliding hold) and commits only after upload, step and sync succeed;
any failure after the upload attempt is fail-closed. Simulation.add_body
(translation=...) declares one; moving circles are excluded from the packed
static links, unsupported modes and swept-band placement are rejected at
initialize, and every positive-step run raises before any device write until
the moving kernels exist. Host tests include a refill-donor enumeration.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Carries the reviewed S0 draft into the S1 branch and fixes: applied stores
only the offset, explicit 'pending is not None', reject a hold target with
nonzero translational velocity, single Euclidean 0.5-cell bound.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stage history and verification, historical label on the migration map,
host-preparation/device order, pair accessors, per-level state split into
fixed plan structure / mutable boundary data / runtime _Level, the two
block_collide families, and the deferred items with their evidence needs.
Doc-only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Final private names (_device_boundaries/_level_jets/_exchange_*/_level_blocks
-> _boundaries record fields / layout.block), public boundaries = host view,
and the plan-versus-device (_Level) lifecycle. Doc-only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- _exchange_spacing/_exchange_centers (two more per-level lists, only read
for levels that have a boundary) become _BlockedBoundary.spacing/centers.
- _level_blocks dropped: remap_finest reads each layout's own .block.
- _device_boundaries -> _boundaries: the record holds host geometry, tables,
Jets and device handles, so 'device' was misleading (the old host-only
_boundaries list no longer exists). Tests migrated mechanically.
Remaining per-level lists (_layouts, _level_cfgs, _leaf, _state, _boundaries)
are the immutable construction plan, built before the memory preflight and
kept after close; _levels holds device handles only and is cleared on close.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The block_collision.cuh header comment names the absent d_params.fx/fy
read, which tripped the source-text assertion. Strip // comments first
and also require the real d_params.omega read. Test-only; no kernel source
change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The blocked collision had three arms (MRT wrapper, channel SRT, level SRT)
and a one-caller MRT wrapper in collision_mrt.cuh. Now block_collide computes
rho/u once and has two compile-time families:
- uniform-equivalent (MRT any level, SRT channel root): collide_dispatch
arithmetic with zero force, no LES: one clamped omega, collide_mrt_no_force
or collide_srt with its zero Guo term (unchanged);
- level SRT (BLOCK_ROOT_BC 0/1): unclamped, collide_srt_no_force, shifted
momentum feq exception kept visible.
No runtime d_params.fx/fy is read. Uniform kernels unchanged (only the
unused inline wrapper is removed from collision_mrt.cuh). Source-text test
updated to the new single call sites.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The removed _boundaries list made the two body-reject patches no-ops.
Inject them via _device_boundaries (level-2 record with foreign host
geometry; non-None level-1 record). set_jet_amplitude docstring names
the public jets view.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jet_scenario=none host tests run against the current checkout (no
blocked_base_tables), while historical runs import the pinned source (no
blocked_coarse_tables). Select whichever single name the source defines;
fail if neither or both. No src alias; pins and manifests unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts (6 files): tests took the caller-migration side, then the
358bed1 renames (_level_boundaries -> _device_boundaries); run_refined_dfg.py
kept ae53fad (same jet_interval level= repair plus blocked_coarse_tables on the
current-checkout path). Follow-up renames in 5 auto-merged tests;
blocked_fine_tables imported from refinement_tables. Frozen drivers untouched
(run_jet_circle_cv.py, check_projected_pairs.py remap_child, historical DFG path).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- No NODE<->EDGE input conversion still leaves the root-edge -> fine-local
half-cell projection (prepare_fine_boundary, fine_hits_to_edge_frame); say so.
- run_refined_dfg.py (jet_scenario != none, current checkout only): pass
level=1 to FixedPatchStepper.set_jet_amplitude on reversal; use
blocked_coarse_tables there. jet_scenario=none keeps the pinned source's
blocked_base_tables; manifests and results unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Coarse/fine name the two members of any pair (Hierarchy docstring); only the
misleading blocked_base_tables -> blocked_coarse_tables. prepare_fine_boundary
and blocked_fine_tables keep their pair-relative names.
- Depth-1 static circles use the integer-NODE frame (unchanged behavior); the
root EDGE frame applies to refined levels only. Contract text corrected.
- _kernel_configs documents why it stays distinct from Hierarchy.configs.
- Drop the stale re-export comment; two tests import table builders from
refinement_tables. Mechanical caller renames for this delta only.
No numerical code or config derivation changed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SRT keeps its two explicit arithmetic variants (level: unclamped no-force,
shifted direct-momentum feq; channel: uniform OneStep arithmetic), selected
at compile time by BLOCK_ROOT_BC; text moved verbatim, PTX parity pending.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A set_jet_amplitude failure while creating the internal stream marked the
Simulation failed, but the public stream property still retried
cuda.Stream(). Guard it like the other device-touching methods and add a
regression test (no retry, close still retryable). Lifecycle wording now
names the guarded device-touching methods; cached readers and host staging
stay callable. compatibility.md records the caller-visible fail-closed change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Simulation.set_jet_amplitude validated before upload and committed host
state after it, but after an uncertain device write nothing stopped reuse.
Record the failure in Simulation._failed and refuse every public device
call except close() (FixedPatchStepper already uses status 'failed').
Invalid input stays side-effect free and retryable. Adds host fault tests
for both owners and states the rule in docs/lifecycle.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deleted: kernels/refinement.cu and step/patch_step.cu (PatchExplode,
PatchFineStep, PatchCoarseStep, the CELERIS_REFINEMENT_AUDIT counters);
in FixedPatchStepper the dense branches of _build_level/_build_pair/_hop,
_apply_fine_boundary, the fine-level CurvedLinkSoA wiring (_fine_curved,
_fine_flags, _curved, _link_tables, its set_jet_amplitude/initialize/close
paths) and the now-vacuous 'requires all-blocked' guards (shifted,
projected, channel, raw exchange, several L1 rectangles, depth >= 3).
level_blocks is required: one tile (by, bx) of positive integers per level,
else ValueError before any device work naming the whole-level tile
((ny, nx) at the root, the fine window shape for one rectangle) as always
valid. No automatic tile choice. Removed route: None in level_blocks
(dense or mixed dense/blocked storage); parity of D/D, D/B and B/B is
recorded at 1573942 and 2469af7.
Kept: the uniform-grid solver (uniform.cu, Simulation, CurvedLinkSoA,
CurvedBoundaryKernel), FixedPatch2D, pinned historical runners.
Docs: compiler entries, BlockExplode comment, lifecycle, supported_settings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- test_exchange_window and test_raw_exchange_gpu fine(): dense root becomes
a (12, 8) blocked root (fine(None) stays only for the dense reference test
that D2 retires);
- jets: G1/G3 compare blocked layouts against the FINE_BLOCKS[0] reference
(blocked root); the dense run is a separate leg D2 removes; G2 legacy
actuation vs Jet on the blocked reference; CPU fixtures use a blocked root;
- test_refinement_blocked_fine.raw reads every level through its layout;
- test_fine_surface_gpu: new test_fine_surface_blocked_matches_uniform_four_hops
(fine ROI after each of four hops vs the uniform 48^2 solver with the same
tolerances, blowing/suction mass sign from raw exchange, zero actuation ==
passive bit for bit); the cross-interface donor rejection passes tiles.
The dense hook/ledger/audit probes in test_fine_surface_four_hops and the
dense SoA fault tests stay until D2 retires them by name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- actual-TG-rate case: the unshifted leg uses [(16, 16), (24, 24)];
- partial-advance: blocked storage, fine owner storage read through the layout;
- new test_bounded_equivalence_blocked: the same eight-step scalar-reference
checks (rest + seeded nonequilibrium, synchronization, leaf drift/moments,
hop-2 validity mask, coalesce sources, 8 corner packets) and launch-failure
publication guard on blocked tiles, via the shared eight_steps helper.
The dense audit build (CELERIS_REFINEMENT_AUDIT counters) stays in
test_bounded_equivalence_and_ownership until D2 retires it with the dense
kernels.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every FixedPatchStepper in test_refinement_followup passes explicit tiles
(whole-level tiles on the GPU cases, (1, 1) in the pre-CUDA margin
contract). Assertions kept; dense-specific probes rewritten:
- fault fakes use a blocked BlockLayout2D instead of _layouts [None, None];
- slot/reservoir: the fine module sees its tile window incl. halo
(fx+2, fy+2) with slot fields zeroed; the root's walls are
block_root_bc 1 (fine 0) instead of dense Y_WALL_BC/TOP_WALL_BC macros;
- raw owner storage is read through each level's layout (to_dense);
- the off-centre allocation bound counts blocked buffers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Extends DenseBlockedRouteParity (test-only, on 1573942) with the residual
dense-supported combinations named before any dense-route deletion:
- test_mrt_bodies: MRT on a periodic root with a passive circle, an
actuated circle (+/-) and a velocity Jet with an amplitude switch
(MRT slot/reservoir is rejected on every route: on_site_velocity is
SRT-only);
- test_two_bodies: two circles on a wider patch (4, 4, 28, 20), periodic
and slot/reservoir, Jet on one + passive other, and two actuated (+/-);
routes D/D, D/B [None, (8, 8)], B/B [(12, 8), (8, 8)].
Same gate: exact FP32 bits and NaN masks at 0, 1, 2, 8 and after
re-initialize; D/B vs B/B raw-exchange ledgers equal for every body.
Docstring table updated; no tolerance, no src change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both public examples move off the dense refinement route, inside the scope
proven by the dense/blocked parity gate (1573942: two-level unshifted SRT,
periodic or slot/reservoir root, one circle/actuation or body-free):
- fixed_patch_jet: LEVEL_BLOCKS = [(12, 8), (8, 8)] (48x48 root, 56x40
fine window), recorded in its report config;
- fixed_patch_circle: --base-block (default 12 8) and --fine-block
(default 16 20); the dense 'omit --fine-block' option is gone.
Host test test_example_tiles: each example's tiles (read from the example
source without importing it) build every layout and table up to the first
CUDA call, for the circle in both coarse boundary modes.
No src change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
same_summary applied np.array_equal(equal_nan=True) to string metadata
('last_base_step'), a TypeError on the first D/B vs B/B ledger compare.
Numbers (bool/int/float/complex) still compare exactly with equal shapes
and NaN-equality; other values (window labels) compare by dtype and value.
New host test: a summary with string metadata equals itself, and changing
the window label, an integer, a nested float, a scalar or a NaN-bearing
array is detected in both directions. No assertion removed, no tolerance.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>