Mosaic:A Benchmark Suite for Differentiable Physics Solvers

Which differentiable solver should you use for a given optimization task, and how much does the choice matter? Typically, each solver is evaluated on its own problems in isolation, which makes comparisons difficult. Mosaic puts 14 solvers behind one unified interface, whatever their language or way of computing gradients. It then measures their forward and gradient accuracy, cost, and integration effort on shared tasks, so you can compare before committing to one.

Five solvers minimize the compliance of the same cantilever on 48×24×24 cells: torch-fem and JAX-FEM on a GPU, the others on up to 16 CPU cores (Firedrake with multithreading enabled). A variant of the paper's compliance task, made for this page.

This page describes the benchmark as pinned for the paper, at the tag v0.3+paper-repro. The Mosaic documentation tracks the latest benchmark problems, solver versions, and numerical results.

What we found

The solvers that manage to return finite gradients agree with finite differences and reach comparable optima. Here's where they actually differ:

  1. Integration effort varies widely

    The code needed to wrap a solver ranges from under 200 lines to more than 2,000. Beyond the paper, the solver reference records each departure from a solver's default usage and why it was needed.

  2. On benign problems, choose the fastest (or friendliest) solver

    Where all solvers reach equivalent results, as on Mosaic's conductivity inversion and compliance minimization tasks, the choice comes down to speed and integration effort.

  3. Solvers fail because of missing features, instability, and memory constraints

    Some solvers lack features a task needs, such as non-periodic boundary conditions. On long rollouts, solvers run out of GPU memory at very different problem scales, and some return non-finite gradients well before that.

  4. Many differences only show up in a benchmark

    Solvers using the same framework, discretization, or time stepper can still differ wildly in their properties, and it is hard to predict how they will fail. Testing candidates on the task at hand is what Mosaic is built for.

Peak GPU memory, wall time, and gradient norm of one VJP against rollout length for seven 3D Navier–Stokes solvers. Three lines end in out-of-memory markers after ten to twenty thousand steps, three end in non-finite gradients after a few hundred steps, and Exponax runs to the end.
One gradient call against rollout length on initial condition recovery. Each line ends at the solver's last successful rollout, either because it ran out of memory or because its gradient stopped being finite. For the JAX solvers, every point after the first includes JIT compilation for its rollout length, so their wall time never drops below the compilation time.

Tasks and solvers

Mosaic covers four physical domains, each with one optimization task. Forward-only solvers serve as references.

Schematic of the heat task: a conductivity field, a steady-state solve to a temperature field, and the inverse problem of finding the conductivity from the temperatures.

Conductivity inversion Heat transfer

Recover the conductivity of a slab from its steady-state temperatures.

FEniCS, Firedrake, JAX-FEM, torch-fem, and deal.II (forward only)

Schematic of the structural task: a cantilever clamped on the left with a tip load, filled with a truss-like material layout.

Compliance minimization Structural mechanics

Make a cantilever as stiff as possible with a fixed amount of material.

FEniCS, Firedrake, JAX-FEM, TopOpt.jl, torch-fem, and deal.II (forward only)

Schematic of the channel: an inflow profile on the left, a cylinder with a drag arrow, and a vortex street downstream between two walls.

Inflow optimization Incompressible fluids

Shape the inflow to lower the drag on a cylinder in a 2D channel, and check gradients on periodic flows.

Exponax, INS.jl, JAX-CFD, PhiFlow, PICT, Warp-NS, XLB, and OpenFOAM (forward only)

Schematic of the 3D task: an initial velocity field in a cube evolves into a later snapshot, and the optimizer recovers the initial field from that snapshot.

Initial condition recovery 3D Navier–Stokes

Recover the initial velocity field of a 3D periodic flow from a later snapshot.

Exponax, INS.jl, JAX-CFD, PhiFlow, PICT, Warp-NS, XLB, and OpenFOAM (forward only)

How Mosaic works

Mosaic treats every solver as a black box with a forward and a gradient call, so the same checks apply to all of them.

Forward accuracy

Reference agreement. Error against analytic solutions, literature values or converged high-resolution runs, within a tolerance.

Convergence. How the error shrinks as the resolution increases.

Gradient quality

Gradient accuracy. Agreement with finite differences over a range of step sizes, with exact gradients where they exist, and through chains of calls.

Optimization. Convergence with the same optimizer and budget for every solver on a task.

Compute cost

Scaling. Wall time and peak memory of the forward and gradient calls across problem sizes.

Rollout length. The longest rollout a solver can differentiate through in one call before it runs out of memory or its gradient turns non-finite.

Development cost

Setup compatibility. Whether the solver can express the task, and why not if it can't.

Integration effort. Every departure from a solver's default usage, with its reason and evidence, rated from L0 (a documented option) to L3 (a change to the solver itself). These records are not part of the paper, which counts lines of wrapper code instead.

Example optimization run on the inflow optimization task, with five solvers. All of them end at about half the starting drag.

Use a solver in your own code

import jax
from tesseract_core import Tesseract
from tesseract_jax import apply_tesseract
from mosaic_shared.problems.navier_stokes_grid import make_vortex_ic

v0 = make_vortex_ic(N=64, seed=42)
image = "exponax_navier_stokes_grid"  # JAX, reverse-mode AD

with Tesseract.from_image(image) as solver:
    def loss(v0):
        out = apply_tesseract(solver, {"v0": v0, "steps": 50})
        return jax.numpy.mean(out["result"] ** 2)

    grad_v0 = jax.grad(loss)(v0)
  • …

Every solver in Mosaic is packaged as a Tesseract, a container that exposes a forward pass and a vector–Jacobian product, whatever the solver's language or way of computing gradients. The benchmark calls solvers through this interface, and your own code can too.

This code calls a solver from JAX, without the benchmark around it. The standalone guide covers the installation, PyTorch, the mesh solvers, GPUs, and loading a solver without Docker.

Dive in

Run the benchmark
Install Mosaic, run the benchmark on your own hardware, and read its output.
Current results
Every result and plot per task, for the latest version of the benchmark.
Solver reference
Each solver's checks, usage, and departure from its default usage.
Reproduce the paper
Regenerate the paper's figures and tables from the published results at the v0.3+paper-repro tag, or re-run the experiments.
Contribute
Mosaic thrives on community contributions, for example ones that add a solver, add a task or improve how a solver is set up.

Cite Mosaic

@inproceedings{rehmann2026mosaic,
  title     = {Mosaic: A Benchmark Suite for Differentiable Physics Solvers},
  author    = {Rehmann, Andrin and Zimmermann, Heiko and H{\"a}fner, Dion},
  booktitle = {Advances in Neural Information Processing Systems},
  note      = {Evaluations and Datasets Track},
  year      = {2026},
  eprint    = {2606.27895},
  archivePrefix = {arXiv},
  primaryClass  = {physics.comp-ph}
}