PERF-2 P0-b: CG iterations per Poisson solve in the profile (ms per V-cycle) and sub-timers inside the patch regeneration (outline, hull + offset, ring projection, Winslow sweeps, respace, warm bookkeeping, mesh finalisation)
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 / Build (macos-latest) (push) Waiting to run
CI / Test (macos-latest) (push) Blocked by required conditions
Documentation / Build API Documentation (push) Failing after 5s
CI / Build (ubuntu-latest) (push) Failing after 6s
Documentation / Build User Guide (push) Successful in 6s
CI / Format Check (push) Failing after 14s
CI / Clippy Check (push) Failing after 48s
CI / Build CPU-Only (Explicit) (push) Failing after 2m21s
Performance Benchmarks / Run Benchmarks (push) Successful in 4m4s

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YJPeT6WA2e7YvAnS875AHL
This commit is contained in:
Omar Sobh
2026-09-15 22:53:26 -05:00
co-authored by Claude Fable 5.1
parent 172a26dee4
commit 1547d14ff1
4 changed files with 100 additions and 43 deletions
@@ -168,9 +168,9 @@ pub struct EmbeddedPisoSolver {
/// (measured: at 1e-2 the first corrector's rounds never settled below
/// a 1e-3 relative change — 20/20 rounds every step).
inner_stop_factor: f64,
/// PERF-2 P0: Poisson `(setup ns, iterate ns, calls)` summed over
/// every multigrid-PCG solve (`docs/perf2_campaign.md`).
poisson_profile: std::cell::Cell<(u64, u64, u64)>,
/// PERF-2 P0: Poisson `(setup ns, iterate ns, calls, CG iterations)`
/// summed over every multigrid-PCG solve (`docs/perf2_campaign.md`).
poisson_profile: std::cell::Cell<(u64, u64, u64, u64)>,
moving: bool,
/// Mask hysteresis band in multiples of the min cell size (0 = off).
mask_hysteresis: f64,
@@ -197,7 +197,7 @@ impl EmbeddedPisoSolver {
fringe: None,
fringe_correction: Vec::new(),
inner_stop_factor: 1e-2,
poisson_profile: std::cell::Cell::new((0, 0, 0)),
poisson_profile: std::cell::Cell::new((0, 0, 0, 0)),
moving: false,
mask_hysteresis: 0.0,
time: 0.0,
@@ -294,8 +294,8 @@ impl EmbeddedPisoSolver {
}
/// Relative part of the pressure solve's inner stop (see the field).
/// The Poisson solves' `(setup ns, iterate ns, calls)` so far.
pub fn poisson_profile(&self) -> (u64, u64, u64) {
/// The Poisson solves' `(setup ns, iterate ns, calls, CG iterations)` so far.
pub fn poisson_profile(&self) -> (u64, u64, u64, u64) {
self.poisson_profile.get()
}
@@ -304,9 +304,13 @@ impl EmbeddedPisoSolver {
inner_stop,
anchor_cell,
);
let (s0, i0, c0) = self.poisson_profile.get();
self.poisson_profile
.set((s0 + solution.setup_ns, i0 + solution.iterate_ns, c0 + 1));
let (s0, i0, c0, k0) = self.poisson_profile.get();
self.poisson_profile.set((
s0 + solution.setup_ns,
i0 + solution.iterate_ns,
c0 + 1,
k0 + solution.iterations as u64,
));
// Unconverged: fall back to the SOR sweeps for this projection
// rather than apply a correction that did not reach the stop.
multigrid_converged = solution.converged;