PERF-2 P0: intra-step profiler — StepTimers on the overset solver (RTX_PROFILE; overlap build / predictors / patch BiCGSTAB / background Poisson with its setup-vs-iterate split / round exchange / apply / end exchange), PoissonSolution carries setup_ns and iterate_ns, the harness times advance / restore / snapshot / load sampling / force / FEA predictor and prints the wall split of the coupled phase; no clock is read when profiling is off; the reclassified/step progress denominator fixed (was ×4)
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 6s
CI / Build (ubuntu-latest) (push) Failing after 5s
CI / Clippy Check (push) Failing after 5s
Documentation / Build User Guide (push) Successful in 6s
Performance Benchmarks / Run Benchmarks (push) Failing after 27s
CI / Build CPU-Only (Explicit) (push) Failing after 1m24s
Documentation / Build API Documentation (push) Failing after 1m34s

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:25:52 -05:00
co-authored by Claude Fable 5.1
parent 2d2fed7181
commit 172a26dee4
11 changed files with 223 additions and 40 deletions
@@ -310,6 +310,10 @@ pub struct PoissonSolution {
pub residual: f64,
/// `residual < tolerance` at exit.
pub converged: bool,
/// Wall time of the setup (hierarchy, fine level, components) [ns].
pub setup_ns: u64,
/// Wall time of the CG iteration (including the V-cycles) [ns].
pub iterate_ns: u64,
}
/// Which inner solver a projection uses for its pressure-correction system.
@@ -761,6 +765,7 @@ fn solve_pcg_with<T: MgScalar>(
"invalid PoissonProblem: {:?}",
problem.validate()
);
let t_entry = std::time::Instant::now();
let mut hier = Hierarchy::<T>::build(problem, params);
let fine = Level::<f64>::new(problem.clone());
@@ -771,6 +776,8 @@ fn solve_pcg_with<T: MgScalar>(
iterations: 0,
residual: 0.0,
converged: true,
setup_ns: t_entry.elapsed().as_nanos() as u64,
iterate_ns: 0,
};
}
@@ -818,6 +825,8 @@ fn solve_pcg_with<T: MgScalar>(
|p: &[f64], r: &mut [f64], fine: &Level<f64>| -> f64 { fine.residual(&b, p, r) };
let anchor = anchor.filter(|&a| a < n && fine.active[a]);
let setup_ns = t_entry.elapsed().as_nanos() as u64;
let t_iter = std::time::Instant::now();
let finish = |p: &mut [f64], iterations: usize, residual: f64| {
// Level of each singular component: the anchor's component is
// shifted so p[anchor] == 0, every other singular component to mean
@@ -839,6 +848,8 @@ fn solve_pcg_with<T: MgScalar>(
iterations,
residual,
converged: residual < tolerance,
setup_ns,
iterate_ns: t_iter.elapsed().as_nanos() as u64,
}
};