Wright Omega explicit diode solver with selectable SolverMethod#33
Merged
Wright Omega explicit diode solver with selectable SolverMethod#33
Conversation
- wright_omega(): piecewise initial approx + 3 Halley steps for near-double-precision ω(x) across the full real domain - explicit_diode_pair(): anti-parallel pair WDF reflection using WO warm start (odd-symmetry fold) + 2 NR correction steps; < 1e-8 vs NR over all guitar-pedal Rp ranges - explicit_single_diode(): single forward diode using WO warm start + 2 NR correction steps; same accuracy - ExplicitDiodePairRoot / ExplicitDiodeRoot: WdfRoot + NlDeviceIv implementations wrapping the explicit solvers with Rs correction - Unit tests: wright_omega known values, explicit pair/single vs NR Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… stage dispatch Phase 3-4 of Wright Omega explicit diode solver: - Add SolverMethod enum to compiler::component and elements::nonlinear::solver - Add solver_hint() default to Component trait; Diode/DiodePair override with WrightOmega - Add DIODE_SOLVER_OVERRIDE atomic in solver.rs with set/clear/get API - Wire solver selection in build.rs: resolve_diode_solver() checks global override, falls back to component hint; diodes now default to ExplicitDiodePairRoot/ExplicitDiodeRoot - Add ExplicitDiodePair/ExplicitSingleDiode variants to RootKind and NlDeviceKind in stage.rs - Update all match arms in stage.rs and compiled.rs for new variants Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Replaces Newton-Raphson iteration for diode solving with an explicit Wright Omega / Lambert W closed-form evaluation. Zero iterations, deterministic cycle count, critical for Cortex-M7 real-time guarantees.
wright_omega(x)— D'Angelo ω₃ approximation with Halley refinement (< 1e-10 accuracy)explicit_diode_pair()/explicit_single_diode()— WO warm-start + 2 NR correction steps (hybrid for maximum accuracy while keeping deterministic cost)SolverMethodenum onComponenttrait —NewtonRaphson(default) orWrightOmegasolver_hint()— Component-level opt-in, diodes default toWrightOmegaDIODE_SOLVER_OVERRIDE— global atomic for runtime/platform-dependent selection (firmware setsWrightOmegaon Cortex-M7, desktop can forceNewtonRaphsonfor comparison)Architecture
The
SolverMethodenum is extensible for future use:EbersMollvsGummelPoonKorenvsDempwolfSelection priority: global override > component hint > default (NR).
Tests
Test plan
🤖 Generated with Claude Code