Skip to content

schwarz-precond: collapse Operator trait to single fallible apply pair (closes #29)#39

Merged
schroedk merged 1 commit into
mainfrom
refactor/operator-single-apply
May 11, 2026
Merged

schwarz-precond: collapse Operator trait to single fallible apply pair (closes #29)#39
schroedk merged 1 commit into
mainfrom
refactor/operator-single-apply

Conversation

@schroedk
Copy link
Copy Markdown
Collaborator

Summary

  • Collapses the Operator trait's two parallel apply pairs into a single fallible pair: apply / apply_adjoint now return Result<(), SolveError>. The infallible methods and the try_apply / try_apply_adjoint defaults are removed.
  • Removes ApplyError; its LocalSolveFailed and Synchronization variants move onto SolveError, alongside InvalidInput. The SolveError::Apply(_) wrapper and From<ApplyError> for SolveError are gone.
  • Drops the silent NaN-fill workaround in SchwarzPreconditioner::apply. PyFePreconditioner.apply now raises RuntimeError on local-solver failure instead of returning NaNs.

Closes #29.

Test plan

  • cargo build --workspace --tests --benches --examples (clean, zero warnings)
  • cargo test --workspace (192 tests pass)
  • cargo test --release -p schwarz-precond -p within -- --ignored (stress test passes; within-py ignored-test invocation fails with the pre-existing _PyBaseObject_Type linker issue, unrelated)
  • cargo bench -p within --no-run (benches compile)
  • pixi run develop && pixi run test (97 Python tests pass)
  • Both schwarz-precond examples run end-to-end

Drops the infallible/fallible apply split and the silent NaN-fill
workaround. `apply` and `apply_adjoint` now return
`Result<(), SolveError>`; the `try_apply` / `try_apply_adjoint`
defaults and the `ApplyError` enum are gone, with `LocalSolveFailed`
and `Synchronization` moved onto `SolveError`. `PyFePreconditioner.apply`
raises `RuntimeError` on local-solver failure instead of returning NaNs.
@schroedk schroedk merged commit 2542998 into main May 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Collapse the Operator trait error surface to a single apply pair

1 participant