This project starts as a Rust-native SciML runtime experiment. The long-term target is not a literal JAX clone, but a JAX-like stack with Rust-specific answers to typed arrays, autodiff transformation, backend lowering, and eventual sharding.
The first milestone is a small, verifiable inverse-problem vertical slice:
The current crate focuses on:
Dual,Tensor2<ROWS, COLS> with shape-checked matmul,TensorIr with broadcast-aware CPU evaluation and VJP,LotkaVolterraProblem value that keeps solver and target settings together,This is intentionally narrow. The solver is treated as one differentiable model inside a learning workflow, not as the main product by itself. The next core work should move toward typed tensors and transformable program representations, not more solver-only functionality.
jit, vmap, or arbitrary higher-order
autodiff.The minimum verification gate is:
cargo test
The tests should cover:
Dual derivative rules,After the first milestone passes, the next design decision should be made from evidence:
Arc, so the current API has no mutable-aliasing state. Tracing and
AD remain 2D at the Python bridge. TensorIr is the independently tested
compiler-core migration target for rank-N tracing and transforms.PINN residuals require coordinate derivatives to remain differentiable with respect to model parameters. A runtime Jacobian, Hessian, or HVP cannot become an operand of a later parameter VJP.
The next TensorIr transform is a symbolic JVP pass. Given source IR inputs
and tangent inputs, it emits a new IR containing primal and tangent nodes for
each source node. The first supported subset is scalar constants,
add/subtract/multiply, batched matmul, tanh, and sum/mean reductions. Applying
the transform again to the tangent output will produce coordinate second
derivatives while retaining the original parameter inputs.
The acceptance test is a scalar loss built from u_xx whose VJP yields a
non-zero MLP-weight gradient. Only after that invariant is proven should the
Python API add jacfwd/jacrev wrappers or a PINN training loop.
The initial vertical slice now evaluates manufactured 1D Poisson residuals, obtains parameter VJPs through two symbolic JVP transforms, and optimizes with Python-facing Adam. CUDA examples cover batched collocation, a two-layer four-parameter MLP, and a residual-plus-boundary loss assembled into one symbolic graph. General neural-network module containers and automatic loss composition remain outside this vertical slice.