schwarz-precond: collapse Operator trait to single fallible apply pair (closes #29)#39
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Operatortrait's two parallel apply pairs into a single fallible pair:apply/apply_adjointnow returnResult<(), SolveError>. The infallible methods and thetry_apply/try_apply_adjointdefaults are removed.ApplyError; itsLocalSolveFailedandSynchronizationvariants move ontoSolveError, alongsideInvalidInput. TheSolveError::Apply(_)wrapper andFrom<ApplyError> for SolveErrorare gone.SchwarzPreconditioner::apply.PyFePreconditioner.applynow raisesRuntimeErroron 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-pyignored-test invocation fails with the pre-existing_PyBaseObject_Typelinker issue, unrelated)cargo bench -p within --no-run(benches compile)pixi run develop && pixi run test(97 Python tests pass)schwarz-precondexamples run end-to-end