embedded3 PERF-3 P1-5 (a)(b): the previous-step aperture/volume records move out of the old mask instead of being cloned; the GCL table over the changed cells and the wall cells (the serial sums with their exact-zero terms left out, same order) — slab flag ny 62 CSV byte-identical, device moving/cg green; ny 124 rebuild block 1,995 → 1,895 ms per step
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 4s
CI / Build (ubuntu-latest) (push) Failing after 4s
CI / Clippy Check (push) Failing after 4s
Performance Benchmarks / Run Benchmarks (push) Failing after 5s
Documentation / Build User Guide (push) Successful in 7s
CI / Build CPU-Only (Explicit) (push) Failing after 56s
Documentation / Build API Documentation (push) Failing after 56s
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 4s
CI / Build (ubuntu-latest) (push) Failing after 4s
CI / Clippy Check (push) Failing after 4s
Performance Benchmarks / Run Benchmarks (push) Failing after 5s
Documentation / Build User Guide (push) Successful in 7s
CI / Build CPU-Only (Explicit) (push) Failing after 56s
Documentation / Build API Documentation (push) Failing after 56s
Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
c6a35a77e2
commit
e3958fc9c5
@@ -679,12 +679,31 @@ impl Mask {
|
|||||||
let g = self.grid;
|
let g = self.grid;
|
||||||
let dv = g.dx * g.dy * g.dz;
|
let dv = g.dx * g.dy * g.dz;
|
||||||
let (mut net, mut area) = (0.0, 0.0);
|
let (mut net, mut area) = (0.0, 0.0);
|
||||||
for (idx, entry) in table.iter_mut().enumerate() {
|
// P1-5 (b): a cell untouched by this build has the old volume (its
|
||||||
|
// entry is exactly 0 and adds nothing to `net`); a cell without a
|
||||||
|
// wall adds nothing to `area`. The sums run over the changed cells
|
||||||
|
// and the wall cells in ascending order — the serial loop's order
|
||||||
|
// with its zero terms left out, bit for bit.
|
||||||
|
let wall_cells: Vec<usize> = {
|
||||||
|
use rayon::prelude::*;
|
||||||
|
(0..table.len())
|
||||||
|
.into_par_iter()
|
||||||
|
.filter(|&idx| self.cell_active(idx) && cut.wall[idx] != [0.0; 3])
|
||||||
|
.collect()
|
||||||
|
};
|
||||||
|
let cells: Vec<usize> = match self.changed_cells.as_deref() {
|
||||||
|
Some(changed) => changed.to_vec(),
|
||||||
|
None => (0..table.len()).collect(),
|
||||||
|
};
|
||||||
|
for &idx in &cells {
|
||||||
if !self.cell_active(idx) {
|
if !self.cell_active(idx) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
*entry = (cut.vol[idx] - old_cut.vol[idx]) * dv / dt;
|
let entry = (cut.vol[idx] - old_cut.vol[idx]) * dv / dt;
|
||||||
net += *entry;
|
table[idx] = entry;
|
||||||
|
net += entry;
|
||||||
|
}
|
||||||
|
for &idx in &wall_cells {
|
||||||
let w = cut.wall[idx];
|
let w = cut.wall[idx];
|
||||||
area += (w[0] * w[0] + w[1] * w[1] + w[2] * w[2]).sqrt();
|
area += (w[0] * w[0] + w[1] * w[1] + w[2] * w[2]).sqrt();
|
||||||
}
|
}
|
||||||
@@ -703,9 +722,13 @@ impl Mask {
|
|||||||
}
|
}
|
||||||
let correction = if area > 0.0 { net / area } else { 0.0 };
|
let correction = if area > 0.0 { net / area } else { 0.0 };
|
||||||
if correction != 0.0 {
|
if correction != 0.0 {
|
||||||
for (idx, w) in cut.wall.iter().enumerate() {
|
// Every cell with a wall (the others subtract exactly 0).
|
||||||
let a = (w[0] * w[0] + w[1] * w[1] + w[2] * w[2]).sqrt();
|
for idx in 0..table.len() {
|
||||||
table[idx] -= correction * a;
|
let w = cut.wall[idx];
|
||||||
|
if w != [0.0; 3] {
|
||||||
|
let a = (w[0] * w[0] + w[1] * w[1] + w[2] * w[2]).sqrt();
|
||||||
|
table[idx] -= correction * a;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(table, correction)
|
(table, correction)
|
||||||
|
|||||||
@@ -72,19 +72,31 @@ impl Solver {
|
|||||||
self.last_ghost_correction = correction;
|
self.last_ghost_correction = correction;
|
||||||
}
|
}
|
||||||
let s_gcl = sub.elapsed();
|
let s_gcl = sub.elapsed();
|
||||||
if let Some(old) = &self.mask {
|
// P1-5 (a): the old mask is replaced below — its arrays MOVE into
|
||||||
self.apertures_old = old
|
// the previous-step records instead of being cloned (1 GB per step
|
||||||
.cut()
|
// at ny 124); the values are the same.
|
||||||
.map(|c| [c.a_u.clone(), c.a_v.clone(), c.a_w.clone()]);
|
if let Some(mut old) = self.mask.take() {
|
||||||
self.vol_old = (0..field.grid.cells())
|
let fluid = std::mem::take(&mut old.cell_fluid);
|
||||||
.map(|i| {
|
if let Some(c) = old.cut.as_mut() {
|
||||||
if old.is_fluid_cell(i) {
|
self.apertures_old = Some([
|
||||||
old.vol(i)
|
std::mem::take(&mut c.a_u),
|
||||||
} else {
|
std::mem::take(&mut c.a_v),
|
||||||
0.0
|
std::mem::take(&mut c.a_w),
|
||||||
}
|
]);
|
||||||
})
|
let mut vol = std::mem::take(&mut c.vol);
|
||||||
.collect();
|
use rayon::prelude::*;
|
||||||
|
vol.par_iter_mut()
|
||||||
|
.zip(fluid.par_iter())
|
||||||
|
.for_each(|(v, &f)| {
|
||||||
|
if !f {
|
||||||
|
*v = 0.0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
self.vol_old = vol;
|
||||||
|
} else {
|
||||||
|
self.apertures_old = None;
|
||||||
|
self.vol_old = vec![0.0; field.grid.cells()];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if std::env::var("RTX_E3_MOVING_PROFILE").is_ok() {
|
if std::env::var("RTX_E3_MOVING_PROFILE").is_ok() {
|
||||||
let ms = |d: std::time::Duration| d.as_secs_f64() * 1e3;
|
let ms = |d: std::time::Duration| d.as_secs_f64() * 1e3;
|
||||||
|
|||||||
Reference in New Issue
Block a user