How esranow/rippl works
1. What this repository is
rippl is a Python-first “physics compiler” for neural networks: users define a PDE/physics problem and a neural model, and rippl turns that into a training/inference workflow with residuals, boundary conditions, adaptive losses, and solver integration.
2. Primary user-facing entry points
The main public surface is the top-level rippl package plus rippl.nn. The README’s flow (compile(...) then run(...)) matches the architecture: model + domain + equation are assembled into an execution engine, then launched through a high-level API or CLI.
3. Core orchestration layer
rippl/core is the control plane. It contains the abstractions that glue everything together: configuration, experiments, simulations, operator experiments, inverse problems, equation/system representations, solver selection, and artifact handling. This is where the repository’s “physics compiler” behavior is coordinated.
4. Physics and equation definitions
rippl/physics is the domain library for PDE residuals and constraints. It includes many physics-specific modules such as Navier–Stokes, Schrodinger, Maxwell, Euler, elasticity, phase-field, stochastic, reaction-diffusion, and fractional operators. These modules provide the mathematical problem definitions that the engine compiles against.
5. Geometry and domain construction
rippl/geometry and rippl/operators support spatial domains and operator-level utilities. The CSG module indicates constructive solid geometry is used for complex shapes, while grid/operator utilities help map equations onto sampled domains or operator-learning settings.
6. Neural model layer
rippl/nn and rippl/models define the network architectures used by the physics workflows. The repo includes MLPs, SIREN, Fourier/spectral models, FNO, DeepONet, Hamiltonian/Lagrangian models, neural ODEs, and specialized blocks for conservation, boundaries, gradients, and residual computation. This layer is where the learning representation is chosen.
7. Training subsystem
rippl/training is the main optimization stack. It includes engines for Lightning and Accelerate, adaptive sampling, causal training, curriculum learning, NTK weighting, Pareto balancing, VPINN/FBPINN recipes, uncertainty quantification, and callbacks/logging. This subsystem is responsible for how physics losses are scheduled and optimized.
8. Solvers, sampling, and data flow
rippl/solvers, rippl/sampling, rippl/data, and rippl/datasets form the numerical/data pipeline around the model. They handle finite-difference and spectral solvers, spectral sampling strategies, sensor data ingestion, and synthetic dataset generation. The flow is generally: geometry/domain → sampled collocation/sensor points → residuals/constraints → training or verification.
9. Diagnostics and validation
rippl/diagnostics provides evaluation beyond standard ML metrics: energy-based checks, spectral analysis, physics validators, and generic metrics. This is the verification layer used to confirm that learned solutions respect the underlying PDE or conservation law.
10. Import/export and persistence
rippl/io and rippl/export manage checkpoints and model export, including quantization support. These modules define the persistence boundary for trained artifacts and are important for deployment or reproducibility.
11. Performance-critical native backend
rippl_backend is a Rust extension package that backs hot paths such as derivatives, boundary handling, causal weighting, NTK weighting, Pareto balancing, distance computations, and fingerprint/license utilities. The Python package wraps this backend, so the architecture splits between high-level orchestration in Python and low-latency kernels in Rust.
12. Plugin and enterprise extension boundary
rippl_pro is a separate extension tree for advanced capabilities such as multi-GPU/distributed training and CAD/mesh ingestion. It is intentionally isolated from the core package, indicating a plugin-style boundary for premium or specialized workflows.
13. Migration and compatibility layer
rippl/migrate contains a transpiler for moving from other physics-ML ecosystems. That suggests an explicit compatibility boundary: existing models/configs can be converted into rippl’s internal abstractions rather than rewritten manually.
14. Validation, benchmarks, and repository role
rippl/benchmarks, tests_real, and the regular test suite show that the project is organized around end-to-end physics scenarios, not just unit tests. The many notebooks and benchmark scripts indicate the repo serves as both a library and a verified reference implementation for PDE/operator-learning workflows.
15. How the main data/control flow fits together
A typical run starts with a user model and PDE definition, passes through core configuration/engine setup, uses geometry and physics modules to generate residuals and boundary conditions, trains through the training stack with possible native backend acceleration, and finally emits diagnostics/exported artifacts. The major architectural boundary is between declarative physics definition and the compiled execution engine that actually trains or solves the problem.
Main entry points: engine.py Engine · core Core · physics Physics · training Training
Components 19
Public API
User entry points and top-level package surface.
Core Engine
Compilation, experiment, and execution orchestration.
Physics Domain
PDEs, residuals, geometry, and domain operators.
Learning Stack
Neural models, training, and sampling.
- NN layer · Neural network components and physics-aware blocks.
rippl/nn - Models · Named model architectures such as DeepONet, FNO, Hamiltonian, Lagrangian, and neural ODEs.
rippl/models - Training · Engines and recipes for adaptive, causal, curriculum, NTK, Pareto, VPINN, and FBPINN training.
rippl/training - Sampling · Collocation and spectral sampling strategies.
rippl/sampling
Runtime & IO
Solvers, data flow, diagnostics, persistence, and logging.
- Solvers · Finite-difference and spectral solver implementations.
rippl/solvers - Data · Sensor ingestion and dataset generation.
rippl/data - Diagnostics · Energy, spectral, metrics, and physics validation checks.
rippl/diagnostics - IO & export · Checkpoints, export, and quantization of trained artifacts.
rippl/io - Migrate · Compatibility layer for converting external physics-ML projects into rippl abstractions.
rippl/migrate/transpiler.py
Connections 20
- rippl API → Core: compile/run · Public API delegates to the orchestration layer.
- CLI → rippl API: invoke · CLI routes user commands into the public API.
- Core → Engine: builds · Core configures and launches the execution engine.
- Core → Equations: assembles · Core binds equations and systems into a runnable problem.
- Engine → Physics: residuals · Engine evaluates PDE constraints and operators.
- Engine → Geometry: domains · Engine uses geometry to define collocation and boundary regions.
- Engine → Sampling: samples · Engine consumes sampling strategies for points and operators.
- Engine → Training: optimizes · Engine trains via the optimization stack and recipes.
- Engine → Solvers: solves · Engine may delegate to numerical solvers for verification or hybrid workflows.
- Physics → Operators: uses · Physics modules rely on operator/grid utilities.
- NN layer → Models: implements · Model package provides reusable neural architectures.
- Training → Backend: accelerates · Training uses native kernels for hot-path weighting and derivatives.
- Physics → Backend: accelerates · Physics computations use Rust-backed derivative and boundary routines.
- Data → Sampling: feeds · Sensor and dataset inputs are transformed into training points.
- Diagnostics → Engine: checks · Diagnostics validate solutions produced by the engine.
- IO & export → Engine: persists · IO stores checkpoints and exported artifacts from runs.
- Migrate → Core: adapts · Migration rewrites external problems into rippl core abstractions.
- rippl_pro → Training: extends · Enterprise package adds distributed training capabilities.
- rippl_pro → Geometry: ingests · Pro geometry layer supports CAD/mesh workflows.
- Backend → IO & export: supports · Native utilities assist artifact-related infrastructure.