Same cycles and pairs as 8505a723, relabelled: proof pairs 3→4..5→6 give
K_case = 7, window K..K+2 with remain-settled pairs, last scored cycle 11.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Source facts with page provenance (motion, quarter-cycle start, stations,
Morison c_d/added-mass c_i definition, Table 1 as computed reference, no
recovered uncertainty); lab-frame kinematics with base at the right turning
point, interval-average wall velocity and force attribution, explicit cycle
indexing; T multiple of 360 steps; native-channel domain sensitivity order;
fluid-only interpolation; periodic gate with fixed-scale waveform/profile
settling, N=3, cap 30, common window; engineering criteria labelled as such.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
memcpy_htod_async needs page-locked host memory. MovingTables allocates one
pinned FP64 buffer at construction (manager.py action pattern) and rewrites
it only when the records change; every upload is followed by a stream sync
in Simulation._run_moving before the next one, so no copy is in flight when
it is reused. The advance test fixture now binds the real LBMStepper.step.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
Test-only, on c6d5dc1. DenseBlockedRouteParity runs the same configuration,
initial state, body/Jet schedule and tilings on D/D [None, None], D/B
[None, FINE_BLOCK] and B/B [(12, 8), FINE_BLOCK], periodic and
slot/reservoir, for body-free, passive circle, actuated circle (+/-) and a
velocity Jet with an amplitude switch: every public and owner array must
match in FP32 bits and NaN masks at steps 0, 1, 2, 8 and after
re-initialize, and the D/B and B/B raw-exchange ledgers (last base step and
last substep) must be equal. No tolerance.
test_route_capability_matrix checks before CUDA what the dense route
rejects (raw exchange on a dense body level, shifted, projected, channel,
several L1 rectangles, depth >= 3 dense). The module docstring holds the
supported/unsupported table and the parked cases (MRT covered elsewhere,
shifted and depth >= 3 have no dense route, several bodies later).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8e1feff set root.last_raw on the single-level reference, which also makes
FixedPatchStepper._hop accumulate a ledger the reference never allocated.
The adapter now substitutes the raw output pointer in the BlockCurvedBoundary
launch (argument 10, as the deleted adapter did) and leaves last_raw unset;
Jet column and force arms still come through the root level boundary.
Comparison unchanged; no production change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restores the PeriodicBlockStepper safeguard dropped in 8e1feff, for all
FixedPatchStepper levels: both G buffers, halo pairs and boundary columns
of every level are compared with cuda.mem_get_info() before the stream,
any module or any buffer exists, raising MemoryError('level buffers exceed
free device memory'). Transfer tables are not counted (lower bound).
Tests: the single-level MemoryError case is back beside the param-layout
check (no stream, no allocation); host test_single_level covers depth 1
and depth 2 (no stream, build or allocation) and the wait failure after a
good step (count stays 1). Driver-mocking fixtures report ample free memory.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The second owner of one blocked level goes. Its capability is the
zero-refinement FixedPatchStepper added in f764d68/985db14 (periodic SRT
level, stationary passive circles, shifted storage, NaN spare, single wait),
which matched it array for array on GPU at 1318fc2 (3 splits x +-circle x
shifted/unshifted) and passes the host lifecycle and fault contracts.
API change for callers:
PeriodicBlockStepper(cfg, BlockLayout2D.build(ny, nx, by, bx), context=c, objects=o)
-> FixedPatchStepper(cfg, context=c, refinements=[], level_blocks=[(by, bx)],
level_objects=[tuple(o)])
download() returns a 1-tuple; static-circle tables are
_level_boundaries[0].tables (was .boundary); no free-memory preflight.
- lbm/block_stepper.py deleted; MAX_GRID_DIM lives in refinement_stepper.
- tests/validation/multigrid/test_block_stepper.py: same frozen GPU gates
(split identity, FP64 oracle, circle across seams) and pre-CUDA rejection
cases on the single level; the old-vs-new bitwise test is retired with the
old class (its result is the 1318fc2 record).
- tests/unit/test_block_step_sync.py folded into test_single_level.py
(step(n) vs n x step(1) roles and one wait, step(0), mid-batch launch
failure), which also gains bad-state rejection before upload, download
failure and activation-failure retry on close.
- test_shifted_storage and test_raw_exchange_gpu use the single level; the
raw-exchange reference feeds the AMR Jet column and raw ledger through the
root level boundary instead of patching a private kernel field.
- Pinned historical runners (taylor_green/run_case.py, run_jet_circle_cv.py)
are unchanged: they only run on trees that still ship PeriodicBlockStepper.
No alias.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fault injection with the existing host fakes for FixedPatchStepper(
refinements=[]): an initialize upload failure, a BlockHaloCopy,
BlockCurvedBoundary or BlockStep launch failure, and a failing final
stream wait each raise, leave the instance failed (step/download refused)
and keep the completed step count; a failed launch never reaches the wait.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-ups for S1 (f764d68):
- a single level starts its spare buffer NaN, as PeriodicBlockStepper does,
so stale halos cannot hide (multilevel initialization unchanged);
- projected explosion is rejected for a single level;
- new tests/unit/test_single_level.py: NaN spare after initialize, per-step
launch order halo -> BFL (circles only) -> BlockStep with a null kind and
one wait per step(n), circle solids excluded from the state mask;
- the GPU bitwise comparison also covers shifted storage.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A zero-refinement FixedPatchStepper is the PeriodicBlockStepper capability:
one doubly periodic blocked SRT level (no LES, Jets or exchange
observation) whose level_objects[0] are stationary passive circles. The
circle tables come from the same checks, now blocks.static_circle_tables
(moved from block_stepper, pycuda-free); BFL, halo and BlockStep launches
are the shared helpers, with an all-ACTIVE (null) kind. Base-level bodies
stay rejected for depth >= 2. PeriodicBlockStepper and its callers are
unchanged (deleted only after S1's GPU result).
Tests: host contract rejections before CUDA for the single level; GPU
bitwise comparison against PeriodicBlockStepper for every split, with and
without the circle (the S2 gate).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
36ad523 made a manifest file missing from the checkout a 'Source mismatch',
which also broke the tests' manifest-selection helper: it reused
verify_source with hashing neutralised but still read the (renamed) files.
run_refined_dfg.source_manifest(collision, observation_mode) now owns the
frozen-manifest selection; verify_source uses it, then verifies the
checkout. The test helper calls source_manifest directly; source identity
stays owned by test_source_pin. Same errors, manifests and pins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes the regressions from the entry/compiler renames (2b3c2a7, d318911)
that Astra reproduced at d318911:
- run_refined_dfg.verify_source: a manifest file missing from the checkout
is a 'Source mismatch' (was FileNotFoundError); the current-checkout
(Jet scenario) capture hashes the manifest's harness files plus the
checkout's own 'git ls-files src', not historical src paths.
- time_window_dfg: candidate file list names kernels/blocked.cu.
- test_projected_pairs: the a135252-only harness's runtime_source is the
historical receipt value (historical_runtime_source) in the receipt
fixture and the two mocked run_case.main tests; runtime_source itself
stays tested against the a135252 package (historical_package).
Harness files, pins, manifests and thresholds are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The package already exposed it as CelerisLab.cuda.compiler; the module now
has that name and every tip caller, doc and current-tree test imports it
directly (no alias).
Historical-revision tooling is not edited: the Taylor-Green harness
(run_case.py, hash-pinned check_projected_pairs.py, assess receipts) only
runs against a135252, whose package has cuda/compiler_v2.py, and the J
campaign runners and dated docs describe past trees. Its two current-tree
tests now import that package from git (historical_package) instead of the
tip, and the kernel-root test first checks the accepted case.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PeriodicBlockStepper and FixedPatchStepper each built the blocked level's
kernel config (block window NX/NY, neutralized wall/slot/inlet fields,
omega/tau check) and each spelled out the raw BlockHaloCopy and
BlockCurvedBoundary argument lists. These now live once in lbm/blocks.py
(level_config, launch_halo_copy, launch_curved_boundary), so a kernel ABI
change has one host site. Both owners keep their own lifecycle; no new
class, no behaviour or default change. PeriodicBlockStepper now checks its
level config before any device work (same errors). Dense refinement levels
keep their own config check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kernel_v2.cu -> uniform.cu (whole-domain NX/NY, Simulation) and
blocks.cu -> blocked.cu (one block window, every blocked level), with
InitTubeFlow_v2 -> InitTubeFlow. All live callers, include comments,
CONFIG.md, lifecycle doc and current-tree tests move together; no alias.
refinement.cu keeps its name until the dense-route decision.
Historical-revision tooling that names the old files (LES source pins,
timing/J campaign runners, TG run_case, supported_settings citations at
888c8038, development notes) is unchanged on purpose.
No arithmetic change; the PTX symbol InitTubeFlow_v2 is renamed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
generate_config/compile_kernel/load_module also recorded the last build
directory and PTX in ContextVars so that bare compile_kernel() and
load_module() calls worked: a second, implicit interface beside the
explicit build_dir/ptx_path one used by every owner. compile_kernel now
requires build_dir= and load_module requires the PTX path.
Build contract tests use explicit paths; they still check per-build
header/output isolation, interleaved generation, path escapes, refusal of a
removed snapshot, and that a failed compile keeps the previous PTX and
leaves no partial output. No kernel, numerical or launch change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Simulation, PeriodicBlockStepper and FixedPatchStepper levels each repeated
generate_config -> compile_kernel -> load_module -> cleanup and the
d_params pack/upload. They now call compiler.build_module(cfg, entry,
arch=..., n_objects=..., block_root_bc=...) and compiler.set_params.
Simulation no longer keeps its build directory alive until close (nothing
read it after loading). Removes the unused compile_kernel_v2 alias.
Host fakes and lifecycle tests follow the new seam; the close-retry case
for build-directory cleanup goes with the removed cleanup step.
No kernel, numerical or launch change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Per-file class (keep conclusion / tested research code / patch snapshot /
generated pin / raw run output) with size and blob id for research/,
tests/validation/multigrid/*_evidence, output/ and BASELINE_JET_AMR.txt
at 0f8fdbc3. Draft for review; nothing removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d_params and the block wall/channel constants are per-module runtime
globals, immutable per stepper instance but not visible to the compiler.
Note that dense and blocked slot roots carry the wall slot as macros vs
d_block_wall respectively.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Describes current module/global, table, control and per-step state
ownership for Simulation, PeriodicBlockStepper and FixedPatchStepper,
and the window vs level-wide frame of single vs multi-rectangle levels.
No code change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The views and the PeriodicPatchStepper alias stay for the existing tests
and docs (about 130 references); the comment no longer says REMOVE AFTER.
No code change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The file:line citations pointed at c95a7ba and went stale after P1, the
compile-time root modes and the kernel entry/step split. Each guard is now
named by file plus function (or the kernel #error guard) at source
revision 888c8038. No claim, scope, observation or evidence revision
changed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
refinement.cu keeps its header, includes, the curved_double.cu entry
block, the #error guard and the optional CELERIS_REFINEMENT_AUDIT
counters, then includes step/patch_step.cu, which holds patch_collide,
PatchExplode, PatchFineStep and PatchCoarseStep moved verbatim (checked
against the previous refinement.cu) in the same order.
test_refinement_mrt reads refinement.cu + step/patch_step.cu; its
assertions are unchanged. The audit-build tests include refinement.cu
from the build root, so step/patch_step.cu still resolves.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
blocks.cu keeps its header, includes and #error guards and then includes
the kernels, as kernel_v2.cu does:
- step/block_transfer.cu: BlockHaloCopy, BlockExplode,
BlockExplodeProjected, BlockCoalesce
- step/block_boundary.cu: BlockCurvedBoundary, BlockAccumulateExchange
- step/block_step.cu: BlockStep (rejects BLOCK_ROOT_BC == 2)
- step/block_channel.cu: unchanged (mode 2 only)
Kernel text moved verbatim (checked against the previous blocks.cu) and in
the same definition order, so the translation unit is the same sequence of
kernels. The two source-reading tests follow the move:
test_projected_explosion reads step/block_transfer.cu, test_refinement_mrt
reads blocks.cu + step/block_step.cu; their assertions are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Horsea's gates showed block_ddf/block_slot change real PTX in
BlockHaloCopy, BlockExplode and BlockExplodeProjected (6/10 modules;
BlockExplodeProjected 38 -> 40 registers) although the results stayed
exact. The stack's bar is byte-identical PTX for naming-only steps, so
those three kernels return to their K3 expressions, the helpers leave
core/layout.cuh, and test_projected_explosion goes back to its K3 form.
fill_invalid stays (its kernels were byte-identical). K4 vs K3 is now
only the NaN-fill helper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
K4 made BlockExplodeProjected address storage through block_ddf and
block_slot (core/layout.cuh). This host test compiles the kernel text
extracted from blocks.cu, so it now also extracts those two helper
definitions from core/layout.cuh (device qualifiers -> inline) instead of
failing to compile. Assertions and tolerances unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
operators/helpers.cuh already had bounce_back_swap (the uniform steps use
it). It moves verbatim, #pragma unroll included, into its own
operators/bounce_back_swap.cuh, which helpers.cuh includes; the channel
root includes that header and calls it. bounce_back_swap_d2q9 from the
previous commit is removed. bounce_back.cuh keeps only the half-way rows
helper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- boundary/bounce_back.cuh: apply_wall_bb_d2q9_rows(y, top_row, ...) is
the existing half-way y-wall correction with an explicit top row;
apply_wall_bb_d2q9_y_pull keeps its signature and calls it with NY - 2.
bounce_back_swap_d2q9(f) names the full opposite-pair swap.
- streaming/pull_double_buffer.cuh: load_node(fi, n, f) loads one node's
stored populations.
- step/block_channel.cu uses all three instead of its inline copies: the
wall swap, the outlet donor gather, and rows 1 / ny-2 (now one call with
the physical top row; same y == 1 / y == top_row order and loads).
Same statements, branch order, indices and arithmetic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- core/layout.cuh: block_ddf(f, block_cell[, cells]) returns the start of a
block's populations and block_slot(block_cell, cells, q) the offset of one
population; BlockHaloCopy, BlockExplode and BlockExplodeProjected use them
instead of repeating (c / cells) * NQ * cells [+ q * cells + c % cells].
BlockExplode keeps its loop-hoisted parent base; types stay uint64_t /
unsigned long; the expressions are the same ones, now named.
- core/cell_kind.cuh: fill_invalid(f) writes the NaN marker; BlockStep,
BlockChannelStep and PatchFineStep call it instead of three copies of the
loop.
No change to operation order, types, launches or arithmetic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- core/cell_kind.cuh holds KIND_ACTIVE/INNER/OUTER (was a constexpr in
blocks.cu that step/block_channel.cu and the channel_root.cpp shim
relied on or redefined); blocks.cu, block_channel.cu and the shim now
include it.
- blocks.cu checks the lattice/model #error guard before the
BLOCK_ROOT_BC guard and mode includes, so an unsupported build reports
the real reason first.
- operators/block_collision.cuh includes what it uses (params, macro,
SRT/MRT collision) instead of relying on blocks.cu's include order.
Preprocessor-only: same kernels, same statements, same arithmetic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Names the exact SRT/MRT parity tests and their sub-case scope (SRT: one
of 18 sub-cases, unidentified; MRT: 12 sub-cases, default outlet settings,
with the runs that recorded the pass), cites blocks.py:134 for tile
divisibility, labels refinement.py:457 as the fine-boundary re-check, and
says 'measured at 36ffc8b1' for the Taylor-Green observation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Test-side only; no production, manifest or pin change. Group A identity
checks (test_source_pin and the jets.py pins) are unchanged and stay
failing as recorded.
B test_refined_dfg: receipt/plan fixtures load the frozen manifest JSON
that verify_source returns for a matching tree (frozen_manifest), and
the two manifest-selection assertions call verify_source with only its
working-tree hash comparison neutralised (selected_manifest), so the
malformed/collision/observation-mode/checkout receipt checks run again.
test_source_pin remains the single identity check.
C test_channel_root: int(owner)-1 (uint64-int became float on NumPy 1);
test_shifted_storage: FP32 NaN fill so the arrays stay FP32. Both reach
the intended immutable/representation/FP32/density checks.
D test_block_stepper fake gets _ddf_shifting; test_fine_surface_gpu sets
_boundary_hosts/_level_jets instead of the read-only fine_boundary view;
test_refinement_followup fake_backend sets _layouts/_ddf_shifting/
_level_cfgs instead of the read-only fine_layout view (as reviewed in
32da2d73).
E test_kernel_contracts_reject_before_upload: an inconsistent pair tau is
now first rejected by the hierarchy chain check; the test asserts that
rejection, then bypasses _check_chain to prove the per-level omega/tau
guard still rejects, and asserts no mem_alloc/memcpy_htod in either case.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One page listing supported settings, each with the guard enforcing it
(file:line at c95a7ba) and the existing tests exercising it. Measured
observations are labelled by their exact tested case (SRT strict-parity
1/4320 values ~2 ULP with unresolved cause; V3 TG constant explosion
aggregate; curved-wall r1 pilot; V4 NOT_STEADY), not stated as general
bounds. Documentation only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pinned BUILD_SOURCES are the a135252 qualification build inputs.
generate_config hashes the whole kernel snapshot, so after K1/K2 the
working-tree kernels (legitimately) no longer reproduce them. The test
now archives src/CelerisLab/lbm/kernels at NUMERICAL_REVISION and points
compiler_v2._KERNEL_DIR there; config headers are still rendered by
today's compiler. BUILD_SOURCES and the equality assertion are unchanged;
each size is a subTest; a missing NUMERICAL_REVISION fails (no skip).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
surface_link_velocity already runs jet_link_shapes; CurvedLinkSoA.
assign_surface and _prepare_blocked_boundary then ran it again with the
same jets and hits to fill the host jet cache. A private _surface_links
returns (velocity, aperture, shape, jet_id) from the one call; both
callers use it. surface_link_velocity keeps its two-value public
contract (now a thin wrapper). Same values, same validation order, same
cache contents; host geometry preparation only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Removes the legacy entry points now that every caller is migrated:
FixedPatchStepper(cfg, *, context, refinements, coarse_boundary,
level_blocks, level_objects, level_jets, observe_*, explosion) and
initialize(*level_g). Deleted: positional bounds, fine_block, base_block,
fine_objects, jets, child, child_block, child_objects, child_jets,
child_rectangles_in_parent, initialize(coarse_g/fine_g/child_g),
_legacy_levels and _initial_levels. Docstring, README and docs describe
the level lists. Compatibility views (patch, fine_boundary, ...) and the
PeriodicPatchStepper alias are unchanged (separate follow-up).
Error -> rule table (legacy keyword check -> level-list rule now firing):
- several patches without fine_block/base_block -> _check_levels
'several patches require fine_block and base_block' (unchanged rule)
- base_block without fine_block -> 'a blocked level requires blocked
refined levels below it'
- nested child without all blocks -> 'three or more levels must all be
blocked' / 'a blocked level requires ...'
- fine_objects/jets with a nested child ('only on L2') -> 'bodies/Jets are
supported only on the finest level of a nested hierarchy'
- child_objects/child_jets without a nested child -> 'level_objects/
level_jets needs one entry per level'
- scalar child with several L1 patches ('scalar child requires one parent
patch') -> hierarchy 'a scalar child requires a scalar parent'
- child vs child_rectangles_in_parent mutually exclusive -> no level-list
equivalent (cannot be expressed); covered by the new explicit
RemovedLegacyAPI test: removed keywords and positional bounds raise
TypeError before any context use, initialize has only *level_g.
The InitialLevels test of the removed adapter is replaced by that test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One local levels(bounds, blocks, objects, jets, **rest) builds the
two-level lists; run_steps and every rejection case use it. All five
before-CUDA rejections, the margin and one-jet checks keep their inputs.
Assertions unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dense root + blocked fine level is level_blocks=[None, block]; bodies go
to level_objects[1]. Both before-CUDA rejections (non-dividing and
malformed fine block) keep their inputs. Assertions unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FixedPatchStepper and the PeriodicPatchStepper alias are called with
refinements=[bounds] instead of the positional legacy bounds (same
_legacy_levels result). Assertions, including the before-CUDA and
four-cell/omega/layout rejections, unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KW becomes levels() (scalar L1 + scalar L2, per-level blocks, objects,
Jets). All rejection cases are kept per level. Two cases change branch:
L2 bodies/Jets with no nested child (legacy 'child_objects/child_jets
require a nested child') are now an entry for a level that does not
exist ('needs one entry per level'); several L1 patches + scalar child
now meets 'a scalar child requires a scalar parent'. Both still reject
before CUDA. Assertions unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>