embedded3 S2-6: the transverse gradient from the face at least 0.2 h off the wall (full neighbours over their own distance along the cut partner's normal) — the first form blew up at DFG ny 61 with the fine floor (coefficient ~ 1/d_f); host = device 7.7e-14 with the closures on; Couette linear exactness kept (<= 0.01 h); RTX_E3_OBLIQUE_N rung knob
CI / Format Check (push) Failing after 4s
CI / Clippy Check (push) Failing after 4s
CI / Build (ubuntu-latest) (push) Failing after 5s
Performance Benchmarks / Run Benchmarks (push) Failing after 5s
Documentation / Build User Guide (push) Successful in 7s
CI / Build CPU-Only (Explicit) (push) Failing after 49s
Documentation / Build API Documentation (push) Failing after 1m1s
CI / Build (macos-latest) (push) Canceled after 0s
CI / Test (macos-latest) (push) Canceled after 0s
CI / Test (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

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
Omar Sobh
2026-09-18 16:54:52 -05:00
co-authored by Claude Fable 5.1
parent e9b2e7887b
commit 9c3fac0755
3 changed files with 55 additions and 17 deletions
@@ -16,6 +16,7 @@
#define CUT_INERTIA_FLOOR 0.1
#define CUT_DISTANCE_FLOOR 0.05
#define CUT_DISTANCE_FLOOR_FINE 0.01
#define CUT_TRANSVERSE_FLOOR 0.2
struct E3Cut {
const double *a_u, *a_v, *a_w; /* apertures per face */
@@ -121,18 +122,31 @@ __device__ double cut_transverse(const E3Params& g, const E3Cut& m, int c, int d
if (!any) return 0.0;
double alpha_q, apm_q[3], app_q[3], wall_q[3], distance_q;
cut_cv(g, m, c, q[0], q[1], q[2], fq, &alpha_q, apm_q, app_q, wall_q, &distance_q);
/* Explicit, coefficient ~ 1/d_f: the gradient from the faces at least
CUT_TRANSVERSE_FLOOR h off the wall — a FULL neighbour too, over its own
distance along the cut partner's normal; only when neither is that far,
from the cut faces over the floored distance (cut_predictor.rs). */
double h_min = fmin(fmin(g.dx, g.dy), g.dz);
double d_min = CUT_TRANSVERSE_FLOOR * h_min;
double a0 = sqrt(wall[0] * wall[0] + wall[1] * wall[1] + wall[2] * wall[2]);
double aq = sqrt(wall_q[0] * wall_q[0] + wall_q[1] * wall_q[1] + wall_q[2] * wall_q[2]);
int cut0 = a0 > 0.0 && alpha < 1.0, cutq = aq > 0.0 && alpha_q < 1.0;
if (!cut0 && !cutq) return 0.0;
double n0[3], nq[3];
for (int e = 0; e < 3; ++e) { n0[e] = cut0 ? wall[e] / a0 : 0.0; nq[e] = cutq ? wall_q[e] / aq : 0.0; }
if (!cut0) for (int e = 0; e < 3; ++e) n0[e] = nq[e];
if (!cutq) for (int e = 0; e < 3; ++e) nq[e] = n0[e];
int far = distance >= d_min || distance_q >= d_min;
double gr[3] = { 0.0, 0.0, 0.0 };
double count = 0.0;
double a0 = sqrt(wall[0] * wall[0] + wall[1] * wall[1] + wall[2] * wall[2]);
if (a0 > 0.0 && alpha < 1.0) {
double slope = (u0 - ub) / (distance * a0);
for (int e = 0; e < 3; ++e) gr[e] -= slope * wall[e];
if (!((far && distance < d_min) || (!far && !cut0))) {
double slope = (u0 - ub) / fmax(distance, d_min);
for (int e = 0; e < 3; ++e) gr[e] -= slope * n0[e];
count += 1.0;
}
double aq = sqrt(wall_q[0] * wall_q[0] + wall_q[1] * wall_q[1] + wall_q[2] * wall_q[2]);
if (aq > 0.0 && alpha_q < 1.0) {
double slope = (uq - ubt[fq]) / (distance_q * aq);
for (int e = 0; e < 3; ++e) gr[e] -= slope * wall_q[e];
if (!((far && distance_q < d_min) || (!far && !cutq))) {
double slope = (uq - ubt[fq]) / fmax(distance_q, d_min);
for (int e = 0; e < 3; ++e) gr[e] -= slope * nq[e];
count += 1.0;
}
if (count == 0.0) return 0.0;