From 6ae5312b6f3456caec50374864aef8a7ebd2786a Mon Sep 17 00:00:00 2001 From: Omar Sobh Date: Thu, 24 Sep 2026 22:25:49 -0500 Subject: [PATCH] embedded3 R6-2: the device classification default ON (RTX_E3_MASK_DEVICE=0 restores the host rebuild; needs the device geometry and a CUDA build) Co-Authored-By: Claude Opus 5.5 (1M context) --- .../solvers/incompressible/embedded3/maskupdate.rs | 11 +++++++---- .../solvers/incompressible/embedded3/step/device.rs | 2 +- .../incompressible/embedded3/step/device/mask.rs | 4 ++-- .../src/solvers/incompressible/embedded3/step/mod.rs | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/crates/specialized/rtx-cfd/src/solvers/incompressible/embedded3/maskupdate.rs b/crates/specialized/rtx-cfd/src/solvers/incompressible/embedded3/maskupdate.rs index 8e78b62..4af568d 100644 --- a/crates/specialized/rtx-cfd/src/solvers/incompressible/embedded3/maskupdate.rs +++ b/crates/specialized/rtx-cfd/src/solvers/incompressible/embedded3/maskupdate.rs @@ -1,4 +1,4 @@ -//! R6-2 (`RTX_E3_MASK_DEVICE=1`): the host mirror of a moving mask whose +//! R6-2 (default ON; `RTX_E3_MASK_DEVICE=0` off): the host mirror of a moving mask whose //! classification ran on the device. The device computes, on the changed set //! of the step (the cells touched by either build, dilated by one) and the //! faces of those cells, exactly the values the host rebuild computes over @@ -16,11 +16,14 @@ use super::wall::{FaceKind, Mask}; use super::Grid; use rayon::prelude::*; -/// `RTX_E3_MASK_DEVICE=1`, with the device geometry it requires (default -/// ON since R6-1's gate; `RTX_E3_GEOM_DEVICE=0` turns both off). +/// The device classification: default ON (R6-2's two-period 3D ny 62 gate +/// held 2026-09-25); `RTX_E3_MASK_DEVICE=0` restores the host rebuild. It +/// needs the device geometry (default ON; `RTX_E3_GEOM_DEVICE=0` turns both +/// off) and a CUDA build (a host-only build never keeps the arrays it needs). #[must_use] pub fn mask_device_enabled() -> bool { - std::env::var("RTX_E3_MASK_DEVICE").is_ok_and(|v| v == "1") + cfg!(feature = "cuda") + && !std::env::var("RTX_E3_MASK_DEVICE").is_ok_and(|v| v == "0") && !std::env::var("RTX_E3_GEOM_DEVICE").is_ok_and(|v| v == "0") } diff --git a/crates/specialized/rtx-cfd/src/solvers/incompressible/embedded3/step/device.rs b/crates/specialized/rtx-cfd/src/solvers/incompressible/embedded3/step/device.rs index 7bcee60..c81dc15 100644 --- a/crates/specialized/rtx-cfd/src/solvers/incompressible/embedded3/step/device.rs +++ b/crates/specialized/rtx-cfd/src/solvers/incompressible/embedded3/step/device.rs @@ -166,7 +166,7 @@ pub struct DeviceStep { steps_since_hierarchy: usize, /// R6-1: the persistent device cut geometry (default ON; `RTX_E3_GEOM_DEVICE=0` off). geom: Option, - /// R6-2: the device classification (`RTX_E3_MASK_DEVICE=1`). + /// R6-2: the device classification (default ON, `RTX_E3_MASK_DEVICE=0` off). dmask: Option, } diff --git a/crates/specialized/rtx-cfd/src/solvers/incompressible/embedded3/step/device/mask.rs b/crates/specialized/rtx-cfd/src/solvers/incompressible/embedded3/step/device/mask.rs index 57221b2..5a19349 100644 --- a/crates/specialized/rtx-cfd/src/solvers/incompressible/embedded3/step/device/mask.rs +++ b/crates/specialized/rtx-cfd/src/solvers/incompressible/embedded3/step/device/mask.rs @@ -1,5 +1,5 @@ //! R6-2: the moving mask's classification on the device (`e3_mask.cu`), -//! behind `RTX_E3_MASK_DEVICE=1` (which needs `RTX_E3_GEOM_DEVICE=1`). After +//! default ON (`RTX_E3_MASK_DEVICE=0` off; needs the device geometry). After //! the device geometry of the step (R6-1), the changed set, the faces of the //! changed cells, the kinds, the step apertures and open flags, the space-time //! activity, the merging masters, the centroid shifts, the GCL wall-flux @@ -102,7 +102,7 @@ struct Apertures { unsafe impl DeviceRepr for Apertures {} unsafe impl ValidAsZeroBits for Apertures {} -/// `RTX_E3_MASK_DEVICE=1` with `RTX_E3_GEOM_DEVICE=1`. +/// Default ON (`RTX_E3_MASK_DEVICE=0` off); needs the device geometry. pub(super) fn enabled() -> bool { crate::solvers::incompressible::embedded3::maskupdate::mask_device_enabled() } diff --git a/crates/specialized/rtx-cfd/src/solvers/incompressible/embedded3/step/mod.rs b/crates/specialized/rtx-cfd/src/solvers/incompressible/embedded3/step/mod.rs index ceaf85c..a9ce3af 100644 --- a/crates/specialized/rtx-cfd/src/solvers/incompressible/embedded3/step/mod.rs +++ b/crates/specialized/rtx-cfd/src/solvers/incompressible/embedded3/step/mod.rs @@ -305,7 +305,7 @@ pub struct Solver { pub(super) geom_pool: super::cut::GeomPool, pub(super) apertures_old_gen: u64, /// R6-2: the next moving rebuild's classification, computed on the - /// device (`RTX_E3_MASK_DEVICE=1`); `rebuild_moving_mask` assembles the + /// device (default ON, `RTX_E3_MASK_DEVICE=0` off); `rebuild_moving_mask` assembles the /// mask from it instead of classifying the whole grid. pub(super) pending_mask: Option, /// R6-2: the instantaneous arrays of the mask retired at the previous