embedded3 PERF-3 P1-4 (steps 1–3 + d): the band-persistent operator — CutGeometry marks re-evaluated corners; Mask::changed_cells (touched by either build, dilated by one); Level::patch re-derives the changed rows with the constructor's formulas on the kept level; the fine export patched likewise with the parent map as a parallel per-cell map; components plane by plane with a small union across planes; Problem::link_map (sparse) replaces the per-cell link lists on the per-step path; RTX_E3_BAND_CHECK=1 compares against full rebuilds (passed on the slab) — slab CSV byte-identical at every step, device moving/cg green; ny 124 rebuild block 2,569 → 2,119 ms per step
CI / Build (macos-latest) (push) Waiting to run
CI / Test (macos-latest) (push) Blocked by required conditions
CI / Test (ubuntu-latest) (push) Blocked by required conditions
CI / Python Bindings (maturin) (macos-latest) (push) Blocked by required conditions
CI / Python Bindings (maturin) (ubuntu-latest) (push) Blocked by required conditions
CI / WASM Build + Size Check (push) Blocked by required conditions
CI / Distributed Training Tests (push) Blocked by required conditions
CI / CI Success (push) Blocked by required conditions
CI / Format Check (push) Failing after 4s
CI / Clippy Check (push) Failing after 4s
CI / Build (ubuntu-latest) (push) Failing after 4s
Performance Benchmarks / Run Benchmarks (push) Failing after 7s
Documentation / Build User Guide (push) Successful in 4s
CI / Build CPU-Only (Explicit) (push) Failing after 1m9s
Documentation / Build API Documentation (push) Failing after 1m10s

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
Omar Sobh
2026-09-20 13:46:33 -05:00
co-authored by Claude Fable 5.1
parent 44caeb8110
commit fe76413c66
8 changed files with 477 additions and 12 deletions
@@ -33,6 +33,10 @@ pub struct CutGeometry {
/// motion, comes within the band; far corners keep a stale value with
/// the right sign, which is all their cells use).
pub bound: Vec<f64>,
/// P1-4: the corners re-evaluated by this build (all of them without a
/// narrow band) — a cell whose corners are all untouched has unchanged
/// apertures, volume and activity.
pub touched: Vec<bool>,
}
impl CutGeometry {
@@ -64,10 +68,12 @@ impl CutGeometry {
use rayon::prelude::*;
let mut phi = vec![0.0; n_nodes];
let mut bound = vec![0.0; n_nodes];
let mut touched = vec![true; n_nodes];
phi.par_iter_mut()
.zip(bound.par_iter_mut())
.zip(touched.par_iter_mut())
.enumerate()
.for_each(|(n, (phi_n, bound_n))| {
.for_each(|(n, ((phi_n, bound_n), touched_n))| {
let (k, j, i) = (
n / ((ny + 1) * (nx + 1)),
(n / (nx + 1)) % (ny + 1),
@@ -78,6 +84,7 @@ impl CutGeometry {
if b > band {
*phi_n = p.phi[n];
*bound_n = b;
*touched_n = false;
return;
}
}
@@ -196,9 +203,34 @@ impl CutGeometry {
d_v,
d_w,
bound,
touched,
}
}
/// The cells with a touched corner (P1-4).
#[must_use]
pub fn touched_cells(&self) -> Vec<bool> {
use rayon::prelude::*;
let g = self.grid;
let (nx, ny) = (g.nx, g.ny);
(0..g.cells())
.into_par_iter()
.map(|idx| {
let (k, j, i) = g.kji(idx);
let mut t = false;
for dk in 0..2 {
for dj in 0..2 {
for di in 0..2 {
t |= self.touched[Self::node(g, k + dk, j + dj, i + di)];
}
}
}
let _ = (nx, ny);
t
})
.collect()
}
/// φ at the corner `(k, j, i)` of the corner lattice.
#[inline]
#[must_use]