Quabla

Quabla Core Design

Goal

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:

  1. define a scientific model in Rust,
  2. integrate it with a deterministic ODE solver,
  3. compute a scalar loss,
  4. differentiate model parameters,
  5. update those parameters with an optimizer,
  6. verify the derivative against finite differences and the fit loop against loss reduction.

Initial Scope

The current crate focuses on:

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.

Non-Goals For The First Milestone

Verification

The minimum verification gate is:

cargo test

The tests should cover:

Next Decisions

After the first milestone passes, the next design decision should be made from evidence:

Composable Coordinate Derivatives

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.