embedded3: the cut mask's imposition and the device surface-velocity tables restricted to a 4-cell band (deeper prescribed faces are never read; the surface velocity was the moving step's cost); the operator rebuild counted in the rebuild share
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 / Clippy Check (push) Failing after 3s
CI / Format Check (push) Failing after 4s
CI / Build (ubuntu-latest) (push) Failing after 5s
Documentation / Build API Documentation (push) Failing after 1m0s
Performance Benchmarks / Run Benchmarks (push) Failing after 5s
Documentation / Build User Guide (push) Successful in 7s
CI / Build CPU-Only (Explicit) (push) Failing after 58s

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
Omar Sobh
2026-09-17 19:33:33 -05:00
co-authored by Claude Fable 5.1
parent c30e3dba34
commit aca77fe1ac
3 changed files with 39 additions and 6 deletions
@@ -107,7 +107,10 @@ impl DeviceCut {
.memcpy_stod(if v.is_empty() { &[0u32][..] } else { v })
.expect("upload")
};
// Surface velocity at the foot per face, and the open flags.
// Surface velocity at the foot per face within the imposition band
// (zero beyond it: never read), and the open flags.
let band = mask.impose_band().unwrap_or(f64::INFINITY);
let dists: [&[f64]; 3] = [&cut.d_u, &cut.d_v, &cut.d_w];
let mut ub: [Vec<f64>; 3] = [Vec::new(), Vec::new(), Vec::new()];
let mut open: [Vec<i32>; 3] = [Vec::new(), Vec::new(), Vec::new()];
for c in 0..3 {
@@ -127,7 +130,11 @@ impl DeviceCut {
(j as f64 + if c == 1 { 0.0 } else { 0.5 }) * h[1],
(k as f64 + if c == 2 { 0.0 } else { 0.5 }) * h[2],
];
ubc[idx] = mask.surface_velocity_at(body, x, c, t);
ubc[idx] = if dists[c][idx].abs() <= band {
mask.surface_velocity_at(body, x, c, t)
} else {
0.0
};
opc[idx] = i32::from(if projection {
match c {
0 => mask.u_open(idx),
@@ -315,7 +322,6 @@ impl DeviceStep {
.expect("w*");
}
let cptrs = self.cut.as_ref().expect("cut").ptrs();
let rebuild = t_rebuild.elapsed();
if self.cg.is_none() || self.cg_dt != dt {
let problem = self.solver.poisson_operator(g, dt);
let params = MultigridParameters {
@@ -326,6 +332,7 @@ impl DeviceStep {
self.cg = Some(DeviceCg::new(&problem, &params));
self.cg_dt = dt;
}
let rebuild = t_rebuild.elapsed();
let anchor = self.solver.anchor_cell(g);
let mut total = 0;
let mut final_residual = f64::INFINITY;