PERF-2 P1.1: the multigrid-PCG's prepared operator (hierarchy, f64 fine level, active cells, components) cached on the embedded solver and reused while the operator is bit-identical (an exact key over the coefficient bit patterns, the mask and the hierarchy parameters); solve_multigrid_pcg_cached gives the uncached solve's answer bit for bit (pin poisson_cache_exact.rs: five right-hand sides on one operator, a one-coefficient miss, both precisions); the CG driver split into Prepared::build + run_pcg
CI / Build (macos-latest) (push) Waiting to run
CI / CI Success (push) Blocked by required conditions
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 / Build CPU-Only (Explicit) (push) Failing after 6s
Documentation / Build API Documentation (push) Failing after 6s
Documentation / Build User Guide (push) Successful in 6s
CI / Format Check (push) Failing after 16s
CI / Build (ubuntu-latest) (push) Failing after 2m13s
CI / Clippy Check (push) Failing after 2m41s
Performance Benchmarks / Run Benchmarks (push) Successful in 3m7s

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 23:30:53 -05:00
co-authored by Claude Fable 5.1
parent 01830e5c8d
commit 79c18def32
5 changed files with 294 additions and 15 deletions
@@ -171,6 +171,9 @@ pub struct EmbeddedPisoSolver {
/// 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)>,
/// PERF-2 P1.1: the prepared multigrid operator, reused across rounds
/// and steps while the operator's coefficients and mask are unchanged.
pcg_cache: std::cell::RefCell<super::poisson::PcgCache>,
moving: bool,
/// Mask hysteresis band in multiples of the min cell size (0 = off).
mask_hysteresis: f64,
@@ -198,6 +201,7 @@ impl EmbeddedPisoSolver {
fringe_correction: Vec::new(),
inner_stop_factor: 1e-2,
poisson_profile: std::cell::Cell::new((0, 0, 0, 0)),
pcg_cache: std::cell::RefCell::new(super::poisson::PcgCache::default()),
moving: false,
mask_hysteresis: 0.0,
time: 0.0,