rtx-cfd: overset Schwarz stall rule guarded (fires only within 10× the tolerance) — unguarded it cut CFD1's transient at round 3 every step and the coupled march diverged at ny=62 (pressure 4e4 → 1e140 by step 450); CFD1 harness knobs (stall, step cap, trace)
CI / Test (macos-latest) (push) Canceled after 0s
CI / Test (ubuntu-latest) (push) Canceled after 0s
CI / Build CPU-Only (Explicit) (push) Canceled after 0s
Documentation / Build User Guide (push) Canceled after 0s
Performance Benchmarks / Run Benchmarks (push) Canceled after 0s
CI / Format Check (push) Canceled after 0s
CI / Clippy Check (push) Canceled after 0s
CI / Build (macos-latest) (push) Canceled after 0s
CI / Build (ubuntu-latest) (push) Canceled after 0s
CI / Python Bindings (maturin) (macos-latest) (push) Canceled after 0s
CI / Python Bindings (maturin) (ubuntu-latest) (push) Canceled after 0s
CI / WASM Build + Size Check (push) Canceled after 0s
CI / Distributed Training Tests (push) Canceled after 0s
CI / CI Success (push) Canceled after 0s
Documentation / Build API Documentation (push) Canceled after 0s

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01X2GmJXeQ2njUecEKiJZ1G2
This commit is contained in:
Omar Sobh
2026-09-05 21:01:57 -07:00
co-authored by Claude Fable 5.1
parent 00f73eb70a
commit 02c855b9c4
2 changed files with 48 additions and 2 deletions
@@ -123,7 +123,10 @@ async fn run_cfd1(ny: usize) -> CfdResult<Cfd1> {
// progress (the noise floor); measured at ny = 41 without it: 5.0 rounds
// per corrector on average (the second corrector 8 every step), 2099 s.
let params = OversetParameters {
stall_rounds: 2,
stall_rounds: std::env::var("RTX_OVERSET_STALL")
.ok()
.and_then(|v| v.parse().ok())
.unwrap_or(2),
..OversetParameters::default()
};
let mut solver = OversetPisoSolver::new(background, patch, (nx, ny, h, h), params)?;
@@ -165,9 +168,42 @@ async fn run_cfd1(ny: usize) -> CfdResult<Cfd1> {
let mut steps = 0;
let mut rounds_total = 0usize;
let mut correctors_total = 0usize;
let max_steps: usize = std::env::var("RTX_OVERSET_CFD1_MAX_STEPS")
.ok()
.and_then(|v| v.parse().ok())
.unwrap_or(2_000_000);
let trace_first = std::env::var("RTX_OVERSET_CFD1_TRACE").is_ok();
loop {
let r = solver.advance(&mut field, dt).await?;
steps += 1;
let every: usize = std::env::var("RTX_OVERSET_CFD1_TRACE_EVERY")
.ok()
.and_then(|v| v.parse().ok())
.unwrap_or(0);
if (trace_first && steps <= 6) || (every > 0 && steps % every == 0) {
let pmax = field
.background
.p
.iter()
.fold(0.0_f64, |m, v| m.max(v.abs()));
let ppmax = field.patch.p.iter().fold(0.0_f64, |m, v| m.max(v.abs()));
let upmax = field.patch.u.iter().fold(0.0_f64, |m, v| m.max(v.abs()));
println!(
" step {steps}: rounds {:?} converged {} stalled {} bg res {:.2e} patch div {:.2e} patch iters {} conv {} | max|p| bg {pmax:.3e} patch {ppmax:.3e} max|u| patch {upmax:.3e} | defect bg {:.2e} patch {:.2e}",
r.rounds,
r.schwarz_converged,
r.schwarz_stalled,
r.background_residual,
r.patch_max_divergence,
r.patch_poisson_iterations,
r.patch_converged,
r.background_mass_defect,
r.patch_mass_defect
);
}
if steps >= max_steps {
break;
}
rounds_total += r.rounds.iter().sum::<usize>();
correctors_total += r.rounds.len();
if steps % 50 == 0 {