pub struct ArrowSolveOptions {
pub mode: ArrowSolverMode,
pub pcg: ArrowPcgOptions,
pub trust_region: ArrowTrustRegionOptions,
pub streaming_chunk_size: Option<usize>,
pub riemannian_trust_region: bool,
pub gpu_matvec: Option<GpuSchurMatvec>,
pub tolerate_ill_conditioning: bool,
pub solve_precision: ArrowSolvePrecisionPolicy,
pub schur_pd_floor: Option<f64>,
}Expand description
Complete BA Schur solve options.
Use ArrowSolveOptions::automatic for normal latent-coordinate fits;
use ArrowSolveOptions::sqrt_ba when the assembler has single-precision
row blocks or an ill-conditioned gauge; use ArrowSolveOptions::inexact_pcg
for SAE-manifold scale K.
Fields§
§mode: ArrowSolverMode§pcg: ArrowPcgOptions§trust_region: ArrowTrustRegionOptions§streaming_chunk_size: Option<usize>Row chunk size for streaming direct/Square-Root Schur assembly.
riemannian_trust_region: boolUse the Riemannian latent projection before the Schur reduction. The reduced Steihaug solve itself remains in Euclidean β coordinates.
gpu_matvec: Option<GpuSchurMatvec>Optional GPU-backed Schur matvec for CPU-driven InexactPCG at K ≥ 5000.
When set, run_pcg_with_preconditioner delegates each S·p call to
this closure instead of the CPU schur_matvec. Constructed by
crate::gpu_kernels::arrow_schur::gpu_schur_matvec_backend when cuda_selected()
and the system has dense per-row H_tβ slabs. None means CPU-only PCG.
tolerate_ill_conditioning: boolSkip the ill-conditioning rejection (the κ-based
[ArrowSchurError::PerRowFactorIllConditioned] per-row guard and the
matching reduced-Schur κ guard) while still requiring genuine positive
definiteness (a non-PD Cholesky pivot still errors).
The κ guards exist to protect the accuracy of the Newton step: a
barely-PD H_tt^(i) or an over-conditioned reduced Schur yields an
inaccurate Δβ/Δt. Evidence-only callers
(e.g. SaeManifoldTerm::reml_criterion_with_cache) do not consume the
step — they need only the factor cache for the log-determinant
(½log|H|, exact from diag(L) regardless of κ) and the selected-inverse
traces. For those callers the κ rejection is a false abort when ρ sweeps
to extreme values, so this flag lifts it and hands the
“is this step trustworthy” decision back to the caller.
Default false: ordinary solves keep the full guard.
solve_precision: ArrowSolvePrecisionPolicyArrow solve precision policy. Default is f64-only.
schur_pd_floor: Option<f64>Optional spectral positive-definiteness floor on the reduced Schur
complement S = H_ββ + ridge_β·I − Σ_i H_tβ^(i)ᵀ (H_tt^(i))⁻¹ H_tβ^(i),
as a relative fraction of S’s largest eigenvalue.
None (default) keeps the strict contract: a non-PD S errors as
[ArrowSchurError::SchurFactorFailed] so the LM outer loop lifts
ridge_beta globally and re-forms S.
Some(floor) engages the #1026 SAE co-collapse cure on the SOLVE path:
when the reduced Schur Cholesky refuses (collapsed atoms drive a per-row
H_tt near-singular, so the accumulated (H_tt)⁻¹ over-subtracts S
into an INDEFINITE matrix), instead of rejecting and over-damping every
β direction with a global ridge, symmetric-eigendecompose S and clamp
every eigenvalue UP to floor·max(λ). This is Levenberg–Marquardt
restricted to exactly the indefinite/collapsed subspace: the
well-conditioned β directions (λ ≫ floor·max λ) are untouched and the
step in those directions is the exact Newton step, while only the
collapsed directions receive the minimal damping needed for a PD solve.
The inner Newton then makes a real descent step rather than crawling
behind an inflated global ridge. Mirrors the per-row spectral floor the
evidence path uses for #1377/#1117/#1118
([super::factorization::factor_spectral_deflated_evidence_row]); the
difference is the floored value — a small positive floor·max λ
(Tikhonov) for the solve, vs unit stiffness +1 (log 1 = 0) for the
evidence log-det.
Only consulted by the dense Direct / SqrtBA reduced solve (the only
caller of [super::reduced_solve::solve_dense_reduced_system]); the
InexactPCG path is unaffected.
Implementations§
Source§impl ArrowSolveOptions
impl ArrowSolveOptions
Sourcepub fn automatic(k: usize) -> Self
pub fn automatic(k: usize) -> Self
Select Direct for K <= 2000 and InexactPCG above, following BA RCS
practice for dense-vs-iterative reduced systems.
Sourcepub fn direct() -> Self
pub fn direct() -> Self
Force dense reduced-camera-system Cholesky, the classic BA direct
solve for small K.
Sourcepub fn inexact_pcg() -> Self
pub fn inexact_pcg() -> Self
Force inexact BA Schur PCG with Jacobi preconditioning.
pub fn with_streaming_chunk_size(self, chunk_size: Option<usize>) -> Self
Sourcepub fn with_ill_conditioning_tolerated(self) -> Self
pub fn with_ill_conditioning_tolerated(self) -> Self
Lift the ill-conditioning rejection for evidence/log-det-only callers
while still requiring genuine PD. See Self::tolerate_ill_conditioning.
Use this when the returned (Δt, Δβ) Newton step is discarded and only
the factor cache is consumed (log-determinant + selected-inverse traces).
The cache stays undamped at ridge_t = 0, so the log-determinant is
exact regardless of κ.
pub fn with_solve_precision_policy( self, policy: ArrowSolvePrecisionPolicy, ) -> Self
Sourcepub fn with_streaming_solve_precision_default(&self) -> Self
pub fn with_streaming_solve_precision_default(&self) -> Self
Turn certified mixed precision ON for the streaming/residency reduced solve unless the caller already pinned an explicit policy (#1014).
Only F64Only (the inherited default) is upgraded to CertifiedMixed;
a caller that deliberately set a policy keeps it. The reduced-Schur f64
factor and every evidence log-determinant are unaffected — see
[mixed_precision_reduced_beta].
Trait Implementations§
Source§impl Clone for ArrowSolveOptions
impl Clone for ArrowSolveOptions
Source§fn clone(&self) -> ArrowSolveOptions
fn clone(&self) -> ArrowSolveOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ArrowSolveOptions
impl !UnwindSafe for ArrowSolveOptions
impl Freeze for ArrowSolveOptions
impl Send for ArrowSolveOptions
impl Sync for ArrowSolveOptions
impl Unpin for ArrowSolveOptions
impl UnsafeUnpin for ArrowSolveOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.