WorksPhysics and Astronomy
Replayable Monte Carlo MRI: From Persistent Tissue Microphysics to Queryable Virtual Phantoms
Abstract
Multiphysics Monte Carlo simulation is the reference method for diffusion MRI in idealized tissue: walkers diffuse through a numerical substrate with relaxation, permeability, susceptibility and magnetization transfer, and accumulate the signal of a prescribed acquisition. Yet walker histories are massive, petabytes for a tractography-scale phantom, so current simulators treat them as transient. They are regenerated for every new acquisition, field strength or relaxation rate, although identical for all of them. I propose to keep these histories instead as a replay pack, compressed into persistent, shareable tissue microphysics, so that any such query is a cheap inner product against the pack. By storing each path as a Brownian bridge cut to the band a scanner class can play, transform coding its coefficients and contracting them into time segments, a replay pack is up to 5000 times smaller than the histories it keeps, while staying within the Monte-Carlo floor for every waveform of that class. It matches analytical solutions in pores, and MC/DC and MCMRSimulator on realistic axon meshes. At the scale of the field's largest benchmark, I re-simulate DiSCo, the billion-walker Monte Carlo tractography phantom, as a multiphysics replay phantom. It reproduces the published protocol's signal to one percent, and any waveform, relaxation or susceptibility up to 100 ms is a query of the same replay pack. I release every replay pack of this paper on the SubstrateCommons Hugging Face Hub and deploy replayable DiSCo as a public Hugging Face Space (https://huggingface.co/spaces/rfick/disco-replay), where anyone can choose an acquisition type (PGSE, OGSE, PGSTE or tensor encoding) and the tissue's parameters, and within two minutes receive their multiphysics Monte Carlo diffusion-weighted image volumes. With replay, a Monte Carlo simulation becomes an instrument anyone can query, at scale.
(https://huggingface.co/spaces/rfick/disco-replay), where anyone can choose an acquisition type (PGSE, OGSE, PGSTE or spherical tensor encoding) and the tissue’s parameters, and within two minutes receive their multiphysics Monte Carlo diffusion-weighted image volumes. With replay, a Monte Carlo simulation becomes an instrument anyone can query, at scale.
Introduction
Diffusion MRI measures the thermal motion of water over micrometres. The motion is independent of the scanner, but the signal depends entirely on its encoding: the method “is not a single biomarker but an acquisition-and-model framework” (Le Bihan, 2026), in which “two very different tissues can produce similar ADC values”. The response has been to diversify the acquisition and to make the biophysical description of tissue more explicit, and the demand for validation of what those descriptions mean has grown with them (Jelescu & Budde, 2017; Le Bihan, 2026; Novikov et al., 2019). Monte Carlo simulation is one of the few settings where both the microscopic tissue state and the signal are known (Fieremans & Lee, 2018; Hall & Alexander, 2009). Walkers are propagated through a numerical substrate and their magnetization evolved under a sequence, with few assumptions about the substrate, and a generation of simulators has made that routine: Camino (Hall & Alexander, 2009), MC/DC [12], Disimpy (Kerkelä et al., 2020), the Realistic Microstructure Simulator (Lee et al., 2021), and SpinDoctor by finite elements (Li et al., 2019). The substrates have grown with them: axons packed by growth (R. Callaghan et al., 2020) or from spheres (Ginsburger et al., 2019), bundles with dispersion, crossings and myelin [16] and the glia between them (Nguyen-Duc et al., 2026), axons traced from electron microscopy with their caliber variation and undulation (Andersson et al., 2020; Lee, Jespersen, et al., 2020; Lee, Papaioannou, et al., 2020), permeable membranes (Nedjati-Gilani et al., 2017), up to phantoms at the scale of a tractography benchmark [11] (Girard et al. 2023); and a current simulator evolves spins through an arbitrary sequence with diffusion, relaxation, permeability, susceptibility, surface relaxation and magnetization transfer active in one substrate at once [2]. A microscopic simulation is now a numerical experiment on tissue rather than a generator of one diffusion-weighted signal.
That completeness exposes an asymmetry. Generating the stochastic histories is the expensive step, and almost nothing asked afterwards changes them. A different gradient waveform does not move the membranes a walker has already met; a different field orientation does not alter a trajectory generated in a fixed substrate; a different surface relaxivity does not change where and when a walker touched a wall. Yet the histories are either discarded once a signal is produced or kept as trajectories too large and simulator-specific to serve as a scientific object. Precomputation is well established elsewhere in microstructure imaging: matrix formalisms evaluate restricted diffusion under arbitrary waveforms from a tractable pore’s eigenmodes ([7] (P. T. Callaghan 1997; Drobnjak et al. 2011; Özarslan et al. 2009)), and dictionaries make model fitting linear (Daducci et al., 2015). Monte Carlo itself has been precomputed as a signal library (Nedjati-Gilani et al., 2017; Rensonnet et al., 2019), which keeps the acquisition with it: a new sequence is a new library. Monte Carlo poses a different question: its value lies in substrates and physics with no compact analytical object, so the object kept must come from the stochastic simulation itself and be the physics, not one of its signals.
This paper asks what the output of a Monte Carlo simulation of tissue should be, and answers that it should be the solved physics, with the signal as a query of it,
substrate — one Monte Carlo simulation / one-time compute → persistent microphysics — any acquisition / any scanner / any tissue / a query → .
This sounds like caching, but a simulation is not easily cached. If keeping the histories were enough, DiSCo would have shared its trajectories with its meshes, and a multiphysics simulator would ship each spin’s path and what it met beside its signals ([2]); neither does, because a trajectory dump is neither small (DiSCo’s own walk, kept at every step, would be 1.2 PB; Table 4), nor readable by anyone else, nor scalable to a brain. A persistent object others can reuse needs three contributions, two theoretical and one infrastructural, and this paper makes them:
| Every tier | Diffusion only | |||||
| 53.5 ms | 100 ms | smaller | 53.5 ms | 100 ms | smaller | |
| DiSCo as simulated, walkers (0.8%) | – | – | – | 1.2 PB | – | – |
| DiSCo as simulated, at a 1% floor | – | – | – | 385 TB | – | – |
| Trajectory, every step of the walk | 33 TB | 62 TB | 1× | 6.2 TB | 12 TB | 1× |
| Truncated, Connectome 2.0 band, float32 | 0.80 TB | 1.5 TB | 41× | 0.55 TB | 1.0 TB | 12× |
| Replay pack, the same bands quantised | 177 GB | 294 GB* | 210× | 138 GB | 220 GB | 53× |
| read by a Prisma | 111 GB | 186 GB | 330× | 70 GB | 112 GB | 100× |
| Time-segment layout, one stored timing | 12 GB | 12 GB | 5 200× | 5.1 GB | 5.1 GB | 2 300× |
| Time-segment layout, the page’s nine timings | 51 GB* | 51 GB* | 1 200× | – | – | – |
Table 4. What DiSCo’s walk costs to keep, over DiSCo’s 53.5 ms and over the 100 ms the packs are built for; a pack answers every echo time beneath its own (§ 1.2.1). The first two rows are DiSCo’s walk as simulated [11], steps of 0.535 µs, positions only, in float32: at its own walkers, a standard error of at most 0.8%, and at the walkers of a 1% floor. Every other row is at that 1% floor, the DiSCo pack’s. Trajectory: float32 at every step of the walk, 3 015 steps of 33 µs over 100 ms, the position and, for every tier, the field’s twelve channels and the contact. Truncated: the band of § 1.2.3, 256 modes over 100 ms, still float32. Pack: the bands quantised in the container derived at the 1% floor (§ 1.5.1); at 53.5 ms the same container on the leading 137 bands. Prisma: the same bytes, read to the leading 104 of the 256 modes. Time-segment layout: Eqs. (12) and (7) contracted at stored timings and gates, every other knob free: , direction, pose, , , , , and its direction. Ratios are against the trajectory at the same floor. Published: SubstrateCommons/disco-replay (Fick, 2026d) and SubstrateCommons/disco-time-segments [4], the layout the page reads.
Encoding. Which quantities of the simulation an acquisition can never change, so that they and only they are stored, and how to compress them into a dense form without losing accuracy for the questions asked of them afterwards, with a certificate that says so.
Replaying. How every later question, another sequence, another scanner, a rotated substrate, a different tissue, is posed in that same compressed space, so that the dense object is queried without ever being expanded back into the trajectories it came from.
Sharing. How such objects are certified, shared, queried by anyone and extended in place, so a substrate’s persistent microphysics is computed once and never again.
These contributions rest on a contract. A stored microphysics is reusable only inside a precise vocabulary of what was simulated: which pools of which substrate a walker can occupy, which walls it can meet and with what properties, and which sources produce the field it samples, so that the simulation is set up in exactly one way from its description; how that record is represented, so that every later question knows what it holds and what may be done with it; and the same again one level up, from one stored substrate to an image built of many. I write these contracts down as an open specification independent of any simulator, one document each for the substrate, the stored microphysics, the acquisition and the image (Fick, 2026g); what follows is one implementation of it. This paper is therefore not another simulator. A replay pack sits after the simulation: any engine that saves its walkers’ paths can write one, and the engine of § 1.5.2 is the one whose channels could be checked one by one against closed forms and two other simulators [2, 12].
I introduce the replay pack as that stored microphysics: for every walker, its path as a Brownian bridge on a sine basis (Caflisch et al., 1997; Glasserman, 2003), its compartment occupancy, boundary local time and sampled susceptibility field, four series a later acquisition contracts against (Figure 1). A pack scales to an image as a replay phantom, one simulation of a whole volume with its walkers grouped by voxel, similar to software phantoms that build a voxel from a fibre configuration (Caruyer et al., 2014; Neher et al., 2014) and benchmark tractography (Maier-Hein et al., 2017), but with Monte Carlo substrates rather than analytic signal models. Every pack and phantom reported here, DiSCo’s multiphysics reproduction included, is served and queryable under the SubstrateCommons organisation on the Hugging Face Hub, each described by a substrate card. Queried, a phantom becomes something new to Monte Carlo simulation: on a public Hugging Face Space, disco-replay (Fick, 2026c), a visitor chooses an acquisition and, within two minutes on a shared GPU, receives DiSCo imaged with it, fitted and tracked to a connectome against its ground truth (§ 3.0.2).

Figure 1. One simulation, every acquisition (figures/fig_one_walk.py; the CACTUS pack of § 2.1.3). (A) The bundle in cross-section, myelin sheaths grey, and one extra-cellular walker’s 100 ms in it, light to dark with time. (B) What that walker leaves in the pack: its position across the fibre, its pool, its boundary local time (the running sum, hits beneath it), and the sheaths’ field it passed with across the fibre, each against simulation time and each the quantity a knob later multiplies. (C) What the pack answers without another simulation, each curve coloured by the channel it reads: PGSE (at its diffusion-time equivalent ) and cosine OGSE with one period per block against frequency at , the spin echo through the pools’ , PGSE against surface relaxivity, and the gradient echo against the fibre-to- angle at 3 and 7 T.
The paper builds the claim one layer at a time, each resting on the one before, so the final result – queryable, browser-based virtual phantoms – stands on nothing not shown first.
The signal is an inner product with what the replay pack stored (§ 1.1.1). Every later choice is a replay knob, set after the simulation; what changes the walkers’ positions (another geometry, a slower diffusivity) still costs a simulation.
The scanner sets how much of a walker’s path must be stored (§ 1.2.2–§ 1.3.1, § 2.1). The truncation error has a closed form, so a pack certifies which scanners it serves; the bits of each kept mode follow from the Monte-Carlo floor by another, and the certified pack is 210 times smaller than the trajectory, 5 000 times once contracted at a timing (Table 4).
Replay matches two other simulators on realistic axons (§ 2.1.3).
A re-simulated DiSCo reproduces its published images (§ 3.0.1), and answers four acqui-
sitions it was never scanned with. Making it a multiphysics phantom took substrate work of its own: strands as curved myelinated cylinders on the published centrelines, one wall test per segment in place of some 24 triangles, and the sheaths’ field summed over the whole millimetre by a closed-form segment kernel on a particle–mesh grid shipped with the substrate.
Anyone can query the phantom in a web browser (§ 3.0.2).
The division of labour is Le Bihan’s (Le Bihan, 2026): the diffusion is the tissue’s, and the scanner an experiment designed to observe it. A replay pack stores the tissue’s side once, and every acquisition becomes a question asked of it. The open question then lies on the substrate side: how far generated micro- and mesoscopic substrates, replayed this way, predict what a scan shows.
Theory
The theory follows the road from a substrate to the DiSCo page. The replay equation writes the signal of one walker as four inner products, one per channel, between series the simulation stored and functions the tissue and the scanner supply, and draws the boundary of what a stored simulation can answer (§ 1.1.1). What a replay pack answers, over which envelope and to which error, is stated once (§ 1.2.1). Four steps decide what a replay pack keeps of each series, each adding its own term to that error, drawn in Fig. 2 and gathered per channel in Table 1: the bridge (§ 1.2.2), the band (§ 1.2.3), the bits (§ 1.2.4) and the time-segment layout (§ 1.3.1). Each step is worked in full on the path, C0, and then for what differs in C1 to C3. Symbols are coloured by owner throughout: the substrate in green, the tissue in blue, the scanner in red.
| Channel | Envelope (§ 1.2.1) | Bridge (§ 1.2.2) | Band (§ 1.2.3) | Bits (§ 1.2.4) | At one timing (§ 1.3.1) |
| C0, path | the scanner class: , per axis | endpoints and sine modes of the bridge | the waveform: , a closed-form tail | ; 11 bits falling to 4 | : 3 numbers |
| C1, occupancy | none: any , | events, exact in time | none | none, exact | , : 2 per pool |
| C2, contact | the largest relaxivity | endpoints and sine modes of the bridge | the band of C0 | , flat in ; 11 bits falling to 3 | , : 2 numbers |
| C3, field , , | the largest ; pulses | thirteen series on cosine modes | the gate: , then a ladder on a pilot | ; 9 bits on the first mode, 3 to 4 after | : 13 numbers |
Table 1. The four channels through the four steps: the envelope that bounds what each answers (§ 1.2.1), what each series is stored as, what sets how many of its coefficients a pack keeps, the weight that sets their bits in Eq. (11) with the bits that follow on the CACTUS pack at the 1% floor, and what one timing contracts it to.

Figure 2. One substrate, two roads (figures/fig pipeline.py). Above, a forward simulator: the acquisition enters before the first step and a signal for it comes out, so every question is a walk; its trajectory file, the path at every step, is the optional output a few of them offer. Below, the replay engine: the walk accumulates the band’s modes as it runs, the transform coding and the time-segment layout follow once, and every question is an inner product at the end, with the scanner’s and the tissue’s numbers supplied then. Beneath each step, what one walker costs after it over 100 ms, every tier, and how much smaller that is than the trajectory file at every step (Table 4).
The replay equation
A Monte Carlo tissue simulation advances walkers by the position update with reflection or transmission at membranes ([2, 12] (Hall & Alexander 2009)), and advances each walker’s magnetization along the path it produces. The two updates are not symmetric. The path depends on the geometry, the diffusivity , the membrane permeability and the seed, and on nothing else: no gradient, field, pulse, relaxation time or relaxivity enters it. Everything the magnetization update needs, it reads off the path. A stored path with its contact record therefore suffices for every magnetization evolution on that substrate, and a quantity is a replay knob if it enters only the magnetization update (Table 3).
| Quantity | Set per | Replayable |
| Replay knobs | ||
| Gradient waveform, , direction, | acquisition | yes, any deliverable waveform |
| Pulse train: gates, flip angles, finite pulses | acquisition | yes; finite pulses by the vector Bloch update |
| Field strength and direction | acquisition | yes |
| Substrate pose | acquisition | yes, exactly: rotate and instead |
| The scanner’s own terms | scanner, voxel | yes, through and at the voxel |
| , | compartment | yes |
| Surface relaxivities , | wall | yes |
| Bound-pool , , offset | wall | yes |
| Susceptibilities , | tissue | yes |
| Nucleus: | tissue | yes: scales the phase rows; its by a rescaling |
| Proton density | tissue | yes: a multiplier |
| Fixed in the simulation | ||
| Geometry; box wrap rule | — | no: a new simulation |
| MT binding kinetics | wall | no: a new simulation |
| Diffusivity | compartment | faster only, as a time scaling |
| Permeability | wall | with , at no other pair |
| Substrate size | substrate | as a length scaling, with and |
Table 3. The replay boundary. What enters only the magnetization update is a replay knob, set at replay by the scanner or the tissue; what enters the position update is the substrate’s and fixed in the simulation, except through two exact rescalings of diffusion (Sec. 5).
For any train of instantaneous pulses, the magnetization update is a sum over coherence pathways (Hennig, 1991; Weigel, 2015): a pathway is the sequence of states, transverse, conjugated or stored, the magnetization takes between pulses. Four numbers describe it: its amplitude , a product of the pulses’ transition coefficients that depends on the flip angles alone; its two gates over time, while transverse and while stored; and its coherence sign , while transverse, flipped by each refocusing pulse, and 0 while stored. Along one pathway a walker’s transverse magnetization at the readout is , with a sum of four inner products over time, , one per channel:
such that the signal is the walker average over the pathways,
Magnetization transfer is in these rows and needs no row of its own. MCMRSimulator holds it as stuck particles, walkers bound to a membrane for a dwell time and relaxing there at their own rates [2]; here such a walker occupies the bound pool, one more column of with its own and , so C1 carries it while it stays bound, the binding and release being the walk’s (Table 3). Its per-collision form, signal lost at every collision, is C2’s surface relaxivity. The scanner enters through the gradient and the field offset the voxel receives; a real scanner’s terms in them vary over millimetres while a walker moves microns, so each multiplies the stored series and never changes them. In this work the scanner is ideal, , the prescribed waveform, and , and pulses are instantaneous; a real scanner’s terms and finite pulses replay too, and are the Discussion’s (§ 3.1). C0 and C3 are phases: they scale with the field and depend on the substrate’s pose, since and are in the scanner’s frame and the series in the substrate’s, so a rotated substrate is a rotated acquisition. C1 and C2 are magnitudes: they only shorten the magnetization, know nothing of orientation, and are gated only by whether the magnetization is transverse or stored.
A spin echo is one pathway, with , so Eq. (1) is its closed form with ; a stimulated echo is the pathway with over the mixing time, where the occupancy
The replay equation
| Symbol | What it is | Domain, shape, unit | Enters |
| the walker’s path | in m over | C0 | |
| occupancy of compartment , the bound pool one of them | over time, kept as the instants it changes | C1 | |
| the rate at which the walls push the walker back, its local time | , m s | C2 | |
| , , | the sheath’s field along the path per unit of , in tensor form: its local term and one tensor per kind of susceptibility | , , : thirteen scalar series | C3 |
| the walker’s weight, its pool’s water fraction | |||
| gyromagnetic ratio of the nucleus observed | rad s T | C0, C3 | |
| , | relaxation times of compartment | , s | C1 |
| , | surface relaxivities of transverse and of stored magnetization, acting per unit contact as | , m s | C2 |
| the pool’s simulated diffusivity | , m s | C2 | |
| , | the sheath’s iso- and anisotropic susceptibility | , dimensionless | C3 |
| proton density | |||
| the gradient the voxel receives: the prescribed on the ideal scanner, with what a machine adds at first order across the voxel | over time, T m | C0 | |
| , | pathway ’s transverse gate and its gate stored along , whatever the bore’s axis | over time | C0–C3 |
| , , | measurement played as one temporal shape along one direction, : its amplitude, direction and shape, refocusing signs included | T m; the unit sphere; dimensionless | C0, Eq. (12) |
| the conjugation sign, flipped by each refocusing pulse; is the coherence sign and the effective gradient | over time | C0, C3 | |
| , | the field and its direction, the latter through the quadratic forms of the two tensors | , T; the unit sphere | C3 |
| every field uniform across the voxel, zero on the ideal scanner | , T; one phase per voxel, no walker series | C3 | |
| , | the flip angles, which set the gates and the pathway amplitudes | rad; |
Table 2. The symbols of Eqs. (1) and (2) by owner: what each is, its domain, shape and unit, and the channel it enters. The substrate’s series are the pack, written once per simulation, all functions of where the walker was; the tissue’s numbers and the scanner’s functions are given at replay.
term relaxes at and the position and field terms accrue nothing; a train of pulses sums over its pathways, whose gates are the same few sign patterns however long it runs.
The envelope: what a replay pack answers, and to which error
A replay pack does not keep the walk; it keeps the series of Eq. (1) compressed, and its certificate is a statement about that compression: every signal replayed from it lies within a stated error of the signal its own walk would give, for every question inside a stated envelope.
The envelope has two sides (Table 1). On the scanner’s side it is a class, the largest gradient amplitude and slew rate per axis, and the envelope covers every waveform the class can play, at any -value and direction. On the tissue’s side it is the largest value of each knob that scales a stored series: the surface relaxivity, which multiplies the contact, and , which multiplies the field, at any direction of . The relaxation times and the proton density need no bound; they are weights at most one on series stored exactly. A question outside the envelope is not certified.
Inside it the error is of two kinds, which behave differently:
Statistical, the floor . Every knob multiplies a walker’s contribution by a phase or by a weight at
most one, so the standard error of a replayed signal, in units of the voxel’s unrelaxed water signal, is at most whatever the knobs, and the bare signal at high reaches it. is a standard error, set by the walkers, held for every combination of knobs at once, and lowered by more walkers or by averaging over a region. The rounding of the stored coefficients (§ 1.2.4) belongs here: to first order it adds to each walker’s phase an error of zero mean, independent of every other walker’s, so it widens the floor in quadrature as fewer walkers would.
Bias, , lowered by neither: the truncation of each series above the band its reader sees (§ 1.2.3), the walk’s quadrature of each coefficient (§ 1.2.2), its sampling of the field along the path, and the rounding’s second order, far below the floor. Each has a closed form or is read on a pilot, and their sum is held below .
A replay pack states , with the rounding’s share in it, beside each term of ; the steps that follow fix what a replay pack keeps and derive the term each adds.
The bridge: each series as coefficients
The replay pack stores each series of Eq. (1) as coefficients on a fixed basis in time, on which every inner product of Eq. (1) is a contraction. The walk accumulates those coefficients on the fly, so the coefficients, not a trajectory, are the simulation’s output.
C0, the path as a Brownian bridge. A walker’s path is stored as its two endpoints plus the residual between them, a Brownian bridge ((Caflisch et al., 1997; Glasserman, 2003)), expanded on the sines , , orthonormal on . The waveform’s net area and its first moment read the endpoints; the rest of the waveform reads the sines, in order of frequency, so keeping the first modes keeps the path up to a frequency, and § 1.2.3 sets how many a scanner needs. Gathered on the basis , a walker is one matrix, a waveform one matrix of the same shape, and the phase their inner product:
and are , sums the products of their matching entries. The truncation at is the approximation that remains, and the pack’s certificate carries it (§ 1.2.3).
C1 to C3, each on the basis its shape asks for. A walker rarely changes pool, so its occupancy, C1, is stored as events: the instants it changes pool, exact to the step, with the pool it enters, and a single label behind impermeable walls. With and the time before with the transverse, respectively stored, gate on, the relaxation is exact on the runs between events,
The contact, C2, measures how much of the walk the wall stopped: each reflection adds twice the depth the step would have gone past the wall along its normal, so a head-on hit counts fully and a grazing one hardly at all. Summed, it is the distance the wall has pushed the walker back, the local time of the reflected path [7], a length, and times it is the log of the magnetization the wall leaves (Brownstein & Tarr, 1979). A membrane’s crossing has the same shape, with probability times the same increment (Powles et al., 1992). The cumulative local time is monotone and near linear, so it is stored like Eq. (3): its two endpoints and sine modes of its residual. The C2 row integrates the gate against the increment of , and the increment of a sine mode is a cosine, ; with the gate’s cosine coefficients,
two scalars and one -term product per walker; ungated, it is , read off the endpoints.
The field, C3, is stored the way a diffusion tensor stores diffusivity. At a walker’s position the sheath shifts the field along by per unit of , as gives the diffusivity along any gradient (Basser et al., 1994): one symmetric tensor per kind of susceptibility, for the isotropic and for the anisotropic, holds the field for every direction of at once, and where the walker sits sets it; in a straight sheath’s lumen lies across the fibre, the of Wharton and Bowtell (2012). With the sheath’s local term , a third of its indicator and of the trace of , these are thirteen series, functions of the geometry alone, read along the path at an interval the field’s largest gradient sets and stored as their leading cosine coefficients, orthonormal on , , , . The field only ever enters through a gate, so the gate is expanded on the same basis, , and each series’ gated integral is one product, for the local term and likewise for the six components of each tensor, and . The field’s strength, its two contrasts and its direction are applied last, the direction as a quadratic form,
one gate. These are the gated field integrals, thirteen per walker and gate, the field’s phase in tensor form, the same value to rounding as the -term sum. C2 and C3 are thus read alike, each through the gate’s cosine coefficients: the contact because the increments of its sines are cosines, the field because it is stored on them.
The band: how many modes the scanner sees
Each series above is cut at a number of modes, and each row of Eq. (1) reads it through a function of the scanner’s: the waveform for C0, the gate’s switches for C2, the gate for C3. Figure 3 sets each series above the function that reads it, on the same modes. The band a channel needs is the narrower of the two spectra, the series’ or the scanner’s; when the scanner’s is the narrow one the band follows from the scanner class by a closed form, otherwise it is measured. Measured means one thing for every row. Let be the ensemble mean of that row’s factor alone, the other rows at their identity, under acquisition , and the same from the series cut at modes; over a battery of the class’s shapes, each at the largest amplitude the class allows,
Figure 3. Each stored series above the function of the scanner’s that reads it, on the same modes (figures/fig spectra.py, data fig spectra data.py). Top, the rms amplitude of each mode over the walkers. (A) The path across the fibres: free diffusion and a 5 μm cylinder walked for 100 ms, 20 000 walkers each, every mode to 2 000, and the CACTUS bundle from its pack, its 256 stored modes. (B) The bridge residual of the cumulative local time over its mean total, the cylinder and the bundle. (C) The field, over its mode 1: the bundle’s isotropic series, its 128 stored modes, and the permeable slab of § 2.1.2, whose field is the indicator of its off-resonant layer. Bottom. (D) Per scanner class, the worst signal error a deliverable waveform leaves above mode , from the waveform alone (Eq. (10)), as in Figure 7, against the floor ; the dotted lines are its crossings, carried up into A. (E) The sine coefficients of a stimulated echo’s gate increments, 80 ms mixing, modes 1 to 40, and their bound at every mode; inset, the gate and its two switches. (F) The cosine coefficients of the coherence sign of a spin echo and of CPMG trains of 4 and 16 pulses, the nonzero modes; inset, the 4-pulse sign; the dotted lines are , carried up into C.
is the truncation’s term of (§ 1.2.1), each row certified on its own factor. The walk keeps no series to measure against, so a pack states as a sum of terms that need none: the truncation, from Eq. (10) below for C0, from the bands beyond the it stores at the largest relaxivity for C2, and from a pilot for C3; and the walk’s quadrature and its read of the field, each in closed form. A subset of walkers kept whole measures directly where a check is wanted.
C0, cut by the waveform, with a closed form. Mode of Eq. (3) completes half-periods in , so modes resolve the path up to
The path carries every frequency up to its step rate. The waveform does not: a ramp at the slew limit takes to reach the amplitude limit , and an oscillation at has a quarter period per ramp, so above the amplitude a waveform can reach falls as (Figure 3A, D). Thus a pack keeps for the band of the fastest scanner it serves, and a consumer reads only the leading its own hardware needs. The cost of the cut has a closed form to leading order. Split of Eq. (4) into and for the kept and the discarded modes. For free diffusion the residual of
Eq. (3) is a discrete Brownian bridge whose Karhunen–Loève modes are exactly the ((Caflisch et al., 1997; Glasserman, 2003)), making the independent Gaussian contributions, so the tail only multiplies the signal; in a pore the residual is not Brownian, and the same holds approximately above the frequency at which the walls act, where the path moves as if free (the cylinder of Figure 3A). Then
with the Fourier transform of the encoding , the diffusion spectrum (P. T. Callaghan & Stepišnik, 1995; Stepišnik, 1993), whose real part never exceeds , the largest diffusivity a walker can reach, and the -value of the waveform above the band, evaluated on the discarded themselves. The cut loses at most a factor , read off the waveform alone (§ 2.1).
C1 to C3, cut by the series or the gate. C1’s events are exact and have no band. C2 and C3 are read through the gate, and the gate is broadband: its switches are steps, so of Eq. (6) does not fall with , and the coherence sign is a square wave whose harmonics fall only as (Figure 3E, F). The scanner’s spectrum is then the wide one, and the series or the gate sets the band. The two differ in their series. The local time is a cumulative count, near linear, so its bridge residual carries little (Figure 3B), and the walk accumulates it at the band of C0, where its small high modes cost few bits (§ 1.2.4). The field a walker samples is broadband (Figure 1B): it crosses the structure of a sheath’s field within one save, so its coefficients hardly fall with (Figure 3C), and no small enough to store approximates the series itself. The gate sets the cut instead. A train of pulses switches times in , a square wave with nothing below its cosine mode , so a pack keeps , the first mode at half the band, and declares as the depth it serves. What the cut loses above falls as slowly as the gate’s harmonics and has no closed form, since nothing in it is Gaussian, so it is measured before the walk: on a pilot of a thousand walkers, a doubling ladder from 16 modes to the band of C0, stopped at the first rung whose error, Eq. (8), is within its share of , fixes for the walk. The phase the cut drops is times a number the walk fixes, so the pilot runs at the envelope’s largest , which covers every weaker field and susceptibility.
The bits: rounding as a share of the Monte-Carlo floor
Sec. 2.4 fixed how many coefficients each series keeps; it left open how precisely each must be stored. The coefficients are real numbers, and float32 stores every one of them to a relative , far below what a replayed signal can resolve. Rounding a stored coefficient perturbs what its series contributes to each walker: the phase of Eq. (4) for the path, the contact term of Eq. (6), the field’s phase of Eq. (7). The perturbation has zero mean and is independent from walker to walker, so to first order it is noise of the same kind as the walk’s own: it averages over the walkers and widens the floor of § 1.2.1 in quadrature, as fewer walkers would. Only its second order is a bias, a term of . The coefficients may therefore be rounded until the floor they widen is a small fraction above the walkers’ own, at the lowest floor the replay pack will be read at (Figure 4A–C). Matching the bits spent on each coefficient to its size is transform coding (Gersho & Gray, 1992; Gray & Neuhoff, 1998; Huang & Schultheiss, 1963): one step for every coefficient and of its size over that step in bits (Bennett, 1948), as JPEG sets a step per frequency (Wallace, 1991) and functional quantisation rounds the Karhunen–Loève coordinates of Brownian motion (Luschgy & Pagès, 2002); a coefficient that is small over every walker gets few bits (Figure 4D–F). What is new is the distortion: not a mean-square error on the series, but the widening of the replayed signal’s floor.
Figure 4. The bits of each series, set by the floor (figures/fig_bits.py, data fig_bits_data.py and fig_container_data.py); one column per series, as Figure 3. Top: the rounding’s own error on the replayed signal, for the same bits on every coefficient (lines), beside the walkers’ Monte-Carlo floor (dashed) and the ceiling at the 1% floor (grey). (A) The path of free diffusion, the 5 cylinder and the CACTUS bundle, 20 000 walkers, , against the float pack on the certificate’s battery, with the container of Eq. (11) derived for five floor targets from 2% to 0.125% (circles, at their mean bits) and float32’s 24-bit significand (square, extrapolated). (B) The contact series of 2, 5 and 10 cylinders and the CACTUS bundle, the same bits on every band: the worst surface factor over windows of the walk and relaxivities up to , in floors of each contact reading; the circles are the derived containers. (C) The field of the CACTUS bundle, 20 000 walkers, its twelve stored series at , the same bits on every mode: the worst gated signal over a gradient echo, a spin echo, an eight-pulse train and a stimulated echo, at 3 and 7 T, along and across the bundle; the circle is the derived container. Bottom: the bits Eq. (11) gives each mode at the 1% floor, beside the precision stored without it. (D) The path, and for free diffusion at 0.25%, sixteen times the walkers (dashed); the grey rule is a container chosen by hand, 16 bits on the first sixteen bands and 8 on the rest. (E) The contact series. (F) The field.
C0, the rule. A coefficient kept as an integer at its own scale , its largest value over the walkers, with a step common to the coefficients of a series, carries a rounding error uniform on . Every series is read linearly, so a walker’s rounding errors add into one random perturbation of what the series contributes, of variance , with the sum of the squared weights by which the scanner reads the coefficients, taken at its largest over the envelope. For the path it is the waveform’s weight on the bands, in the units of Eq. (4), and the scanner class bounds it for every waveform at once: by Bessel’s inequality on the orthonormal sines, a waveform with over has on each axis, whatever its shape, -value or direction. To first order the perturbation adds to the mean signal a random term times the floor, of order one (§ 1.5.1), so the floor widens from to ; to second order it biases the mean by , the mean of a cosine over a zero-mean phase, which does not fall with the walker count while the floor does. A budget of the floor target caps both, the widening at and the bias at , and gives one step and the bits of every coefficient in closed form,
clipped to 3 to 16 bits and grouped into runs of equal bit count that fill whole bytes. At the rounding widens the floor by at most a quarter of a percent, what half a percent fewer walkers would cost. The first branch binds above a floor of ; below it the bias sets the step, , so a replay pack gains half a bit per band for every halving of its floor, that is for every fourfold increase in walkers, and never spends a bit below the noise the walkers bought. The path’s coefficients fall as , and its bits fall with them, from 11 to 4 over the band (Figure 4D). Nothing in the container is chosen: the band comes from the scanner, the bits from the walkers. The floor target is that of the pack as it will be read. A walk run as shards of the same voxels and merged is one ensemble with a floor below a shard’s, and the bias does not average away, so is the union’s floor and the bits are derived once, before the shards walk: a quarter of bits per band more than one shard alone would take.
The bits: rounding as a share of the Monte-Carlo floor
C1 to C3, the same rule with their own weights. C1’s events are exact and leave nothing to round. For the contact the weight is the gate’s, of Eq. (6) at the largest relaxivity, flat in , since each switch of the gate reaches every mode alike (Figure 3E); the local time’s coefficients fall nonetheless, and its bits with them, from 11 to 3 (Figure 4E), about a ninth of the bytes of float32. For the field it is , with the weights by which Eq. (7) combines the thirteen series, at the largest and susceptibilities and the worst direction; the gate is a sign, so by Parseval , whatever its pulses: the broadband gate that sets (§ 1.2.3) costs the bits nothing. The field’s first mode carries its mean, which the gradient echo reads, and takes 9 bits; the modes after it take 3 or 4 (Figure 4F).
The time-segment layout
The pack keeps every time: any waveform and any gate within the band. A protocol uses few of them. It varies and direction far more often than its gate, the echo time, the refocusing times and the coherence pathway, and its tissue and its field never touch time at all. So Eq. (1) can be contracted along time alone, once per timing, and left open along everything else (Figure 5). I call what that leaves the time-segment layout; it is what a page stores. It is exact, its only error the pack’s truncation at , and it gives up nothing but the waveform’s course in time: a walker’s 0.91 kB in the pack become 37 bytes at one timing, while , direction, pose, , , the relaxivities, the susceptibilities and stay free (Table 4).
Figure 5. Contract time, keep the knobs (figures/fig_segments.py, data fig_segments_data.py). One intra-axonal walker of the CACTUS pack under a spin echo with a pulse pair, ms, ms, ms, cut into six segments at the pulses’ edges and the refocusing time. Its four series as the pack decodes them: the path along the axon from its 256 bands, with each segment’s mean position (bars; the two under the pulses coloured); its pool; its cumulative local time; its field at 3 T, across the bundle. On the right, what the timing contracts each to (each set scaled to its largest): the one-shape vector of Eq. (12), the gated pool times, the gated local times and the twelve stored gated field integrals of Eq. (7).
C0, one shape, one vector. A timing plays its gradient as a fixed temporal shape , the refocusing signs included, at many amplitudes and directions, . Its phase is one vector per walker,
with the shape’s numbers, a projection of the stored bands, its first entry, the start position, set to zero. Subtracting the start is exact, since a refocused waveform leaves no net area, and keeps the stored values to displacements of micrometres. Nothing asks to be constant or square: a pulse pair, a trapezoid with its ramps, a cosine oscillating gradient and a numerically designed waveform are each one vector, exact to the pack’s truncation at . A measurement at that timing costs three multiplications per walker instead of , 258 times fewer at , and returns the same number to rounding for every -value and direction.
For a pulse pair, is during the first pulse and during the second, and , with the walker’s time-averaged position during pulse : the centre of mass of the path traced during
The time-segment layout
it (the coloured bars of Figure 5). This is the narrow-pulse phase with each position replaced by the walker’s centre of mass during its pulse (Mitra & Halperin (1995)); in a pore a long pulse puts that centre near the pore’s middle, which is why finite pulses make a pore look smaller. For any other shape, is the path weighted by in place of that equal-mass average.
C0, several shapes: segments and tensors. A protocol that varies more than one amplitude within its timing plays a sum of fixed shapes, , with the vectors set per measurement, and with the C1, C2 and C3 rows at the same gate a walker’s exponent of Eq. (1) is
one vector per shape. Two families of shapes cover the protocols a page serves. Time segments are the indicator shapes of the intervals between instants that include every refocusing time and every switch of the waveforms to be served; their vectors are , the segments’ centres of mass times their durations and , and they serve every waveform constant on the cuts, each segment at its own amplitude and direction. A waveform whose direction turns during the encoding, as in -tensor encoding (Topgaard, 2017; Westin et al., 2016), is three shapes along fixed axes, , with the encoding’s rotation and the weights of its shapes, and its phase is
three vectors per walker, nine numbers, which serve every rotation, every -value and every weighting of the three shapes, linear, planar or spherical. A rotation is a replay knob like a direction: it enters each walker’s phase, and the signal is the mean of the walkers’ phase factors, so the encoding is exact in any substrate, not only in the Gaussian limit in which a -tensor alone describes it. Every set of shapes fixes the waveforms’ course in time and serves those waveforms alone; the gate, not the shapes, fixes the C1 to C3 integrals below, so shapes that share a gate share them. The DiSCo page stores one shape at each of its pulsed and oscillating timings and the three shapes of one tensor encoding (§ 3.0.2).
C1 to C3, the gated integrals. With the gate fixed the other three rows are integrals of the stored series against it. Eq. (5) leaves two numbers per pool, the time the walker spent in pool while transverse, , and while stored, , and any and follow; Eq. (6) leaves the gated local times and , and any relaxivity follows; and C3 is the thirteen gated field integrals of Eq. (7), from which every field strength, susceptibility and field direction follows. A spin echo has no stored gate, so its walker carries one occupancy time per pool and one local time.
The bits. The contracted numbers are rounded by Eq. (11), each with the weight of what multiplies it: for the segment means, over the segments the declared envelope switches on; for one shape’s , the largest amplitude it declares for that timing; for the gated local times, which enter as a weight, , with the same two error terms; and for the gated field integrals, the field’s weight of § 1.2.4 with the gate already summed into them. Each inherits the rounding of the coefficients it was contracted from, so the two shares add in quadrature and each takes .
Methods
The replay pack
A replay pack is one persistent simulation on one substrate as a file: the walker-side channels of Eq. (1) in the coefficient forms of § 1.2.2, truncated in modes by the rule of § 1.2.3, and a header that says what the pack may be asked. Table 4 gives what that costs, within the Monte-Carlo floor the certificate measures. Three properties of the pack make a question cheap.
The pack is separable. Every channel is its own tensor and every tier its own byte range, in one safetensors file, a JSON header of named tensors followed by their bytes, memory-mapped rather than parsed and readable from any language. A question therefore reads the tiers it needs and nothing else, and a weaker scanner reads fewer modes of each (Table 4). The same separability holds across walkers: a simulation too large for one file is sharded over walkers in any grouping, and a consumer reads the walkers and the tiers of its question by byte range.
The pack is ordered. Walker-indexed tensors are stored walkers first with the walkers shuffled and the modes in band order, so the leading walkers are an unbiased sub-ensemble and the leading modes the narrower band (§ 1.2.3), both contiguous. In time a pack is a sequence of storage windows (100 ms here), each certified on its own, with exact positions at every boundary (Eq. (3)): a pack is cut, joined or continued at a window. Exact start positions let one simulation re-partition onto any voxel grid by grouping walkers by where they started. Nothing is re-encoded to serve a smaller question.
The pack is quantised per band. Each band is stored as an integer at its own scale, with the bits Eq. (11) derives from the pack’s floor target under a budget and , about the largest ratio measured on the pores (0.4 to 1.1); where it reaches 1.1 the rounding errs a tenth more, well inside the budget. At the 1% floor of the DiSCo simulation that is 6.8 bits per band on average, 13 for the first eight bands and 5 or 6 for the last hundred, 653 bytes per walker for the positions. Table 4 gives what the truncation and the quantisation each take off a walker; the certificate is measured on the quantised pack, so the error it states includes the rounding.
The header carries what fixes the simulation and cannot be replayed (the fixed rows of Table 3, with the seed and the integrator settings), the envelope of § 1.2.1, and the certificate. The envelope is stated and recorded, never a default: the scanner class with its per-axis and , from which the band of Eq. (9) follows (for the packs of this paper Connectome 2.0, 0.5 T/m and 600 T/m/s, so no largest -value is declared); the largest surface relaxivity, µm/s; the field strengths with the largest susceptibility, of 1.5, 3 and 7 T with the substrate’s own ; and the refocusing depth the field channel serves. The certificate states the floor , a standard error with the rounding’s share in it, beside each term of (§ 1.2.3), so that “solved” is a checkable property of the file. The format is a published specification (Fick, 2026g), and the datasets behind this paper, their revisions and their archive are § 4.
Encoding, replaying and sharing replay packs
Encoding: dmipy-sim. Packs are written by dmipy-sim1, a Monte Carlo engine written for persistence and scale, with the multiphysics content of Cottaar et al. [2], every row of Eq. (1) active in one substrate at once, on analytic pores and their packings, curved and myelinated tubes, sphere unions and triangle meshes [2, 12] (Hall & Alexander 2009). It is written in JAX (Bradbury et al., 2018), which compiles one program to the CPU or any GPU. The walk accumulates the series of § 1.2.2 as coefficients on the fly, so its memory stays flat in the walk’s length and no trajectory is written. Its step takes one of two lengths chosen to match the Gaussian step’s moments (Kloeden & Platen, 1992), at the largest duration that holds the walk’s diffusion spectrum within up to the acquisition class’s band, measured from two pilot walks and recorded in the pack. Every pack carries its certificate, the terms of § 1.2.3 and the Monte-Carlo floor, in its header.
Replaying: dmipy-replay. Packs are replayed by dmipy-replay2, a client that depends on NumPy alone: it fetches a pack at a pinned revision, checks its sha256, reads its tiers by range, reads Pulseq sequences (Layton et al., 2017) natively, and replays them bit for bit as dmipy-sim does, which imports it. A set of measurements is one product of the coefficients with a compiled acquisition, § 1.2.2. A third package, dmipy-design3, reads packs through the same description of an acquisition and optimises waveforms under a scanner’s limits; its search for the worst waveform a scanner class can play gives the waveforms the band certificate is tested on (§ 2.1).
Sharing: SubstrateCommons. Packs are shared from the SubstrateCommons organisation on the Hugging Face Hub4, one dataset per substrate family. Each dataset holds its packs, a manifest with every pack’s sha256, size, walk parameters, certificate and licences, and a substrate card rendered from the manifest. A pack is addressed by dataset, path and revision, and a reader checks it against the manifest at that revision, so a figure cites an immutable object. The Hub serves byte ranges, and since every channel, tier and window of a pack is its own byte range (§ 1.5.1), a question fetches only the walkers, modes and tiers it needs. Every pack is under CC BY-NC-SA 4.0 or a commercial licence, stated per pack in the manifest beside the licence of its source geometry.
The experiments
Table 5 lists every experiment of § 2: what is checked, on what substrate and simulation, under which acquisition, against which reference; Figure 6 shows the four substrates. The paragraphs below give the one design decision of each that a reader needs to judge its result; the recipes, sources and solver settings are in the Supplementary Material, S1, and every figure names the script that produced it.
Figure 6. The four substrates of the experiments (figures/fig_substrates.py). (A) Canonical pores: parallel planes at gap , a cylinder and a sphere of diameter , reflecting walls and water inside, from to in 200 sizes per shape, 600 replay packs; the shapes are drawn at one size and the axis gives . (B) The permeable slab: with reflecting faces and a membrane at of permeability 10 or ; walkers start in compartment A ( 80 ms), and compartment B ( 20 ms) is magnetised, ppm, a field of against A with in the plane of the faces. (C) The CACTUS bundle [16]: a section normal to the fibre axis of the 344 strands in their box with reflecting faces, from the meshes the pack is walked on; intra-axonal, myelin and extra-axonal pools. (D) DiSCo [11]: 1 600 of its 12 196 strands, projected and coloured by direction, in the 1 mm cube of voxels of (one outlined); each strand is two tubes along its centreline, the axolemma at the listed diameter (median ) and a sheath at a -ratio of 0.7 (inset).
The experiments
The band certificate. The substrates are simulated once and kept as float coefficients to 2 000 modes over 100 ms ([4]), so every is a leading slice of one simulation. Per substrate, scanner class (Table 6) and , the certificate is the largest over waveforms within the class’s amplitude and slew limits that vanish at both ends and refocus, found by projected ascent on half the walkers and its error measured on the other half against Eq. (10), which for free water needs no simulation at all.
| Class | System | (mT/m) | (T/m/s) | Band (Hz) |
| Prisma | clinical 3 T scanner | 80 | 200 | 522 |
| Connectom | human connectome scanner, derated for diffusion | 300 | 62.5 | 310 |
| MAGNUS | high-performance head insert | 200 | 500 | 877 |
| Connectome 2.0 | next-generation connectome scanner | 500 | 600 | 960 |
| BGA-9S | preclinical, 9 cm bore | 760 | 6 840 | 3 000 |
| Micro2.5 | microscopy insert, 4 cm bore | 1 500 | 15 000 | 4 100 |
Table 6. The six gradient systems of Figure 7: per-axis amplitude and slew rate, and the band a pack needs for every waveform the system can play at a tolerance of , from Eq. (10). Sources in Supplement Table S1.
Canonical pores. Each pack’s walker count is set by its own pilot for a standard error of under any toggle, with the per-walker variance , so a sub-micron pore has 8 000 walkers and the 525 largest 40 000; every comparison is a pore’s worst row against the level its walkers’ noise alone reaches in 99 draws of 100: the gradient channel against the matrix method, the surface channel against Brownstein–Tarr, the two together under the Robin condition, each reference stepped finely enough to resolve the pore’s own relaxation.
The compartment and field channels. The two channels the pores do not exercise are checked on the one substrate where their physics has an exact solution, a slab split by a membrane with compartment of 80 and 20 ms and one compartment magnetised, a layer whose field is against the other with in its plane. Every walker starts in the unmagnetised compartment, so the other fills through the membrane at a rate its permeability sets, about 200 ms at 10 /s and 20 ms at 100 /s: the compartment channel must place each crossing in time and the field channel follow phase in a compartment whose population changes, both against the same initial-value problem solved exactly.
Realistic axons. The CACTUS bundle ([16]) is simulated once with every channel of Eq. (1), its field channel at 128 modes. Its references are two other engines, MCMRSimulator.jl ([2]) and MC/DC ([12]), each run strand by strand on the same meshes from the same start positions, their walks stored as packs and read by the same reader.
The replay phantom. DiSCo ([11]) is simulated from its published centrelines rather than its meshes, at its diffusivity: each strand is a curved myelinated cylinder, the tube a ball sweeps along the centreline at the listed diameter with a sheath around it, a sphere-swept line of collision detection ((Larsen et al., 2000)), cylindrical along every segment and spherical at every joint. A wall is then a distance to a segment, found through a grid over the segments, and a step is reflected in closed form: one test per nearby segment where a twelve-sided mesh of the same tube has at least 24 triangles, so the 636 951 segments stand in for some 15 million triangles per wall. The sheath holds no water but is a susceptibility source, so one simulation carries all four channels in both water pools, and the dataset’s own simulation is the replay with the field off. The susceptibility field must reach the whole millimetre, since stopping its sum at 50 still moves it by 8.1%. Each segment contributes the dipole kernel integrated in closed form along it; the segments near a walker are summed exactly where it stands, and the rest through a grid built once per substrate and shipped with it, the particle–mesh split of Hockney and Eastwood (1988) that cosmological -body codes use for gravity ((Efstathiou et al., 1985)), here with sources that never move. An independent -space route that shares no closed form with this sum agrees with it to 0.15% (Appendix S2). The walkers are planned for the most a 300 GB dataset on the Hub holds: from each voxel’s water shares and a pilot’s per-walker cost at the class envelope, the plan gives every voxel and pool the walkers that bring each voxel to one floor, a standard error of 1.0% that holds under any combination of tiers, and so places walkers over the 31 815 voxels of its 25 grid that hold water, assigned to voxels by where they start. The walk is one pack of 294 GB (§ 3.0.2). The page’s layout holds each walker’s vectors as integers at the precision § 1.3.1 derives for each timing’s largest , within the timing’s rounding budget, decoded in the kernel. The acquisitions it was never scanned with are timing classes of the page’s layout: a clinical shell, a three-shell research scheme, a Connectome 2.0 shell, a cosine OGSE at 50 Hz, a stimulated echo (PGSTE), and linear and spherical -tensor encoding at of 100 to 2000 s/mm from the three gradient shapes of one numerically optimised spherical waveform (Sjö lund et al., 2015); their timings and the tractography pipeline are Supplement S1.5.
Results
The modes a pack needs are set by the scanner
The scanner, not the tissue, sets how many modes a pack keeps (Sec. 3.3). Table 6 lists six gradient systems, from a clinical 3 T scanner to a microscopy insert, by their per-axis amplitude and slew rate, and the band a pack needs for each at a tolerance of (Figure 7A). The band follows the slew rate, not the amplitude: the Connectom, with almost four times the Prisma’s amplitude but a third of its slew rate, needs a narrower band, because the highest frequency at which a gradient can still deposit diffusion weighting is set by how fast it can switch. These bands come from a closed form in the waveform alone, Eq. (10), computed without a simulation, which bounds the replay error of every waveform the scanner can play: the bound lies above every measured point that clears the walkers’ own floor, and its worst waveform, replayed on the free-water simulation, agrees with it to two percent.

Figure 7. A pack is a band (figures/fig_band.py, data fig_band_data.py). A: per scanner class, the worst replay error over the deliverable waveforms against the band : found on the walkers of four 100 ms simulations kept as float coefficients [4] (points; the CACTUS bundle to its stored 256 modes, 640 Hz), and found on Eq. (10) for free diffusion with no simulation (red dashed, for 100, 50 and 25 ms). The grey dashed line is ; the dotted line its walker-free crossing. B: the truncation bias on held-out walkers against Eq. (10) from the waveform alone, for every worst waveform with (colour) and for PGSE and cosine-OGSE rows (grey); the band is a factor of two. C: modes for against simulation time: the walker-free certificate per class (squares), and the crossing of three OGSE frequencies on the Micro2.5 (circles) with their lines . D: the worst waveform the search finds for a pack cut at (160 Hz), walker-free, for the weakest and the strongest class.
The restricted substrates fall below the free-water curve, as they must, since a wall can only lower a path’s diffusion spectrum, never raise it; the few points above it, by at most 1.4 times, are the search’s noise on 20 000 walkers. Figure 7D shows what sets those bands: for a pack cut at (160 Hz), the waveform that loses the most signal, on the Prisma a train of the fastest lobes its slew rate allows, on the Micro2.5 an oscillation far above the band.
Figure 7B asks more of Eq. (10): not a bound but a prediction of the error of one waveform, measured on the walkers the search did not use against computed from the waveform alone. The median ratio of measured to predicted error is 1.00 on free water, 0.91 and 0.97 on the 2 and 10 µm cylinders, 0.55 on the CACTUS bundle, whose pools restrict the path most, and 1.05 on ordinary PGSE and OGSE rows, over errors from to the whole signal.
Figure 7C separates two questions Eq. (9) does not. For one declared acquisition, the modes a longer simulation needs grow linearly, to within a factor of 1.2 to 1.8 set by the ramps. For the certificate over everything a scanner can play they grow faster, as to , because a longer storage window lets a waveform put more above the band at the same frequency.
This fixes the storage of everything that follows. The packs of § 2.1.1 to § 3.0.1 are simulated for 100 ms and stored at , a band of 1.28 kHz that covers every human scanner of Table 6, Connectome 2.0 with a margin of 1.33 and the others with more, of which a Prisma reads the leading 104 modes. A longer simulation declares a gradient-on budget of 100 ms and keeps the same bandwidth, so its modes grow linearly with its length, and a shorter echo time is a prefix at the same number of bands per second.
Canonical pores agree with the closed forms
Figure 8 puts the 600 canonical pores [3] against their closed forms (Sec. 3.3. On the gradient channel (A) the residual follows that level over six decades of signal: of the 6 300 PGSE and OGSE rows above one micron the largest is 4.2 standard errors, the extreme of that many draws, and the one exception is the cosine OGSE at 800 Hz, the battery’s fastest waveform, whose residual of is the pack’s truncation at 256 modes, inside the its certificate states. Below one micron the residual stays under . On the surface channel (B) the free-induction decay lies within of Brownstein–Tarr at both relaxivities and every diameter, at the noise level. The two channels together (C), PGSE with relaxivity against the Robin matrix method, follow the noise level as the gradient channel does. The walker ladder (D), the 20 µm pores walked again to 256 000 walkers, shows the worst gradient-row residual falling as , from – at 2 000 walkers to –, with no floor in sight.
Figure 8. The published family of canonical pores against the closed forms (§ 1.5.3; 600 packs, 8 000 to 40 000 walkers each): the worst residual over a pore’s rows against its diameter, with, dotted, the level that worst row reaches from the walkers’ noise alone in 99 draws of 100. Colour is the pore’s shape in every panel; solid and dashed lines are the two series each panel names. (A) The gradient channel, PGSE and OGSE, against the matrix method. (B) The surface channel, free-induction decay at two relaxivities, against Brownstein–Tarr. (C) Both, PGSE with relaxivity, against the Robin matrix method. (D) The walker ladder on the pores walked again at 256 000 walkers: the worst gradient-row residual over nested prefixes of the shuffled ensemble against walker count, with the line.
The compartment and field channels replay exchange
Figure 9 tests the compartment channel, where each walker is and for how long, and the field channel, the susceptibility field each walker passes through, against the exact one-dimensional solution on the permeable slab of Figure 6B (§ 1.5.3). One simulation of the slab answers four acquisitions at echo times from 10 to 100 ms: the free-induction decay; the spin echo, which refocuses the static field and has no diffusion gradient; the PGSE, the same spin echo with diffusion gradients; and the gradient echo, which keeps the field’s dephasing. Each is replayed at both membrane permeabilities, 10 and 100 , and at 3 and 7 T, 62 signal values in all. None differs from the exact solution by more than 4.1 times its Monte Carlo standard error, and on average by 0.8 times it (panel C); in absolute terms the replay is within of the exact signal for the compartment channel and for the field channel, the largest at the 100 ms spin echo at 7 T, where the magnetised compartment dephases most. The spin echo refocuses the static part of that compartment’s field, and what it leaves is the dephasing of walkers that crossed the membrane during the echo (panel B): a model that gives each compartment its own off-resonance cannot produce that term, and the field channel replays it because it stores the field along each walker’s path rather than per compartment.
Figure 9. The compartment and field channels against the one-dimensional Bloch–Torrey reference on a permeable slab (Sec. 3.3). (A) The compartment channel: signal against echo time for two pools with of 80 and 20 ms at two permeabilities, lines the reference (FID solid, spin echo dashed), markers the replay with three standard errors. (B) The field channel: the same with the magnetised compartment at 3 and 7 T, gradient and spin echo. (C) Every row’s residual in units of its standard error.
Realistic axons: three engines agree
On a realistic substrate there is no closed form, so the reference is other simulators. The intra-axonal pool of the CACTUS bundle’s 176 strands was walked by three engines, this one, MCMRSimulator.jl (Cottaar et al., [2]) and MC/DC (Rafael-Patino et al., [12]) (§ 1.5.3), each walk stored as a replay pack and all three read by one reader. Read under PGSE at of 1 000 to 10 000 with the gradient from along the bundle to across it, a grid on which the signal runs from 0.04 to 0.98, the three agree within three standard errors on every one of the 16 readings (Figure 10A, B; Table 7). MCMRSimulator and MC/DC,
| (s/mm²) | angle | dmipy-sim − MCMRSimulator.jl | dmipy-sim − MC/DC | MCMRSimulator.jl − MC/DC |
| 1,000 | 0° | +8.3 ± 4.3 (+2.0) | +8.7 ± 4.3 (+2.0) | +0.5 ± 4.2 (+0.1) |
| 1,000 | 90° | +0.1 ± 0.2 (+0.7) | +0.3 ± 0.2 (+1.6) | +0.2 ± 0.2 (+1.0) |
| 3,000 | 0° | +2.6 ± 5.1 (+0.5) | +2.1 ± 5.1 (+0.4) | −0.7 ± 5.0 (−0.1) |
| 3,000 | 90° | +0.4 ± 0.5 (+0.7) | +0.9 ± 0.5 (+1.6) | +0.5 ± 0.5 (+1.0) |
| 6,000 | 0° | +0.4 ± 5.1 (+0.1) | +3.7 ± 5.1 (+0.7) | +3.3 ± 5.0 (+0.7) |
| 6,000 | 90° | +0.6 ± 1.0 (+0.6) | +1.5 ± 1.0 (+1.5) | +0.9 ± 1.0 (+1.0) |
| 10,000 | 0° | +1.9 ± 5.1 (+0.4) | +6.8 ± 5.1 (+1.3) | +4.9 ± 5.0 (+1.0) |
| 10,000 | 90° | +0.8 ± 1.5 (+0.5) | +2.2 ± 1.5 (+1.4) | +1.4 ± 1.5 (+0.9) |
Table 7. The three engines on the CACTUS intra-axonal pool: differences of the replayed PGSE signal ( ms, averaged over 11 azimuths around the bundle axis) along the bundle (0°) and across it (90°), as difference ± standard error (), in units of ; this engine’s columns as independent walks, the last paired on the two engines’ shared start positions.
Figure 10. The CACTUS bundle’s intra-axonal pool walked by three engines, each walk a replay pack read by one reader (figures/fig_mesh.py; § 1.5.3). (A) PGSE signal ( ms) against the gradient’s angle to the bundle axis, averaged over 11 azimuths, at four -values; bars one standard error. (B) Every reading’s difference between two engines in units of its standard error, against the signal, with and . (C) The surface channel: this engine’s replay minus MCMRSimulator against , across the bundle, at of 0, 1 and 3 m/s, and at 3 m/s with MCMRSimulator at a 2 s step.
Realistic axons: three engines agree
which walk the same start positions, agree within one standard error; this engine reads above both, by up to 2.6 standard errors, most along the bundle at , and its pack walls the bundle’s box with reflecting faces where the other two continue it periodically (Supplement S1.4). On the surface channel this engine’s contact matches Brownstein–Tarr on tessellated cylinders (Supplement S1.4), and on the strands the replay sits above MCMRSimulator by 0.3% of the signal at and 0.6% at , at either of MCMRSimulator’s steps (Figure 10C). The other two engines’ walks took 1.8 and 1.4 hours on eight CPU threads; a row of any of the three packs replays in 50 to 150 ms on one CPU core.
DiSCo, a partitioned replay phantom
Figure 11A puts the dataset’s own protocol (Rafael-Patiño et al., [11]), replayed from the pack, voxel by voxel against its published noise-free images over the 15 040 voxels of its mask: they agree to a median of 0.006 to 0.010 on the four shells at a correlation of 0.987 to 0.992, and 3.3% of voxels exceed twice their certified floor. The replay sits 0.005 to 0.009 of above the dataset on every shell, the area DiSCo’s twelve-sided tubes lose against the round tubes simulated here (Supplement S1.5). Replaying the 364-measurement protocol over the whole phantom takes 14 s on one GPU, 18 s with every tissue tier at 3 T, through the time-segment layout of § 3.0.2.
Figure 11. DiSCo, partitioned: one simulation, the dataset’s protocol and five others. (A) The dataset’s own protocol replayed from the pack against its published noise-free images: one slice at 13 191 s/mm, and the direction-mean signal of every mask voxel per shell (the scatter is the pass’s floor). (B) The same protocol with the catalogue’s white matter at 3 and 7 T, as the change of the shell’s direction mean. (C) The tractography score of six acquisitions replayed from the simulation at SNR 30 (three seeds; bars are the spread), with the dataset’s own images through the same pipeline as the ceiling. (D) The research scheme’s score against SNR beside the dataset’s own releases. (E) -tensor encoding: fractional anisotropy (DTI on the linear encoding) and microscopic anisotropy on one slice, crossing voxels outlined from the ground truth, and both against the number of strand directions in the densest quarter of strand voxels.
With the catalogue’s white matter at 3 T, the pools’ , the walls’ relaxivity and the sheath’s , the same protocol replayed from the same pack lowers the direction-averaged shells by 0.004 to 0.007 of and single measurements by up to 0.034. The tiers act at one scale: in the voxel the 3 T tissue moves most at s/mm, all of them together take the signal from 0.513 to 0.479, the alone by 0.020, and and the relaxivity by 0.007 each. At 7 T the catalogue gives both pools one , and the shells move by less than 0.001 while single measurements still move by 0.05.
Figure 11 and Table 8 are the tractography question, through one pipeline, constrained spherical deconvolution (Tournier et al., [15]) and probabilistic tractography, both dipy’s (Garyfallidis et al., [6]), whose ceiling the dataset’s own images set at 0.905. The replay of the dataset’s own scheme scores 0.911 ± 0.002 over three noise seeds: the partitioned phantom is the ground truth the dataset was, to within the seed. The five acquisitions the dataset never simulated separate by their diffusion contrast, not by their direction count: the high- single shell scores as the dataset’s own scheme with a sixth of its directions, above the three-shell research scheme; the clinical shell at the dataset’s diffusivity attenuates as does in vivo and gives the deconvolution little to work with; and the cosine OGSE at 50 Hz scores as the clinical shell at the same but places its fibre peaks twice as far from the strands, 18° against 10°, while the stimulated echo at the same , its diffusion time stretched to 45.9 ms by the mixing time, scores above both at the clinical shell’s peak error, questions the dataset could not have been asked. Against noise the research scheme scores 0.850 at SNR 10 and 0.894 at SNR 50 (panel D), each point one more pass of the image loop over the same simulation.
| Acquisition | Directions | Score | Peak error |
| Dataset’s images, noise-free / SNR 30 | 360 | 0.904 / 0.905 | 5.7° / 7.7° |
| Dataset’s scheme, replayed | 360 | 0.911 ± 0.002 | 6.6° |
| Connectome 2.0, | 60 | 0.911 ± 0.001 | 7.2° |
| Research, , 2000, 3000 | 270 | 0.886 ± 0.004 | 6.3° |
| Clinical, (order 6) | 30 | 0.776 ± 0.008 | 9.8° |
| Cosine OGSE 50 Hz, | 60 | 0.769 ± 0.009 | 18.0° |
| PGSTE, mixing time 38.3 ms, | 60 | 0.803 ± 0.003 | 9.6° |
Table 8. Six acquisitions replayed from the one DiSCo simulation at SNR 30 (three noise seeds) through one tractography pipeline: the connectome score against the ground truth and the median angle between the estimated FOD peak and the strands’ mean orientation per voxel. The dataset’s own images through it give the ceiling.
The same simulation answers a -tensor encoding (panel E). In the densest quarter of strand voxels the fractional anisotropy falls from 0.47 where the strands run in one direction to 0.31 where they cross in three or more, while the microscopic anisotropy (Lasič et al., 2014; Szczepankiewicz et al., 2015) stays at 0.59 to 0.62: crossing lowers the voxel’s anisotropy, not the strands’.
Anyone can query the phantom in a browser
DiSCo, the largest Monte Carlo phantom built for diffusion tractography, can now be imaged by anyone, with their own acquisition, in a web browser (Fick, 2026c). On a public page a visitor designs a protocol, its shells and directions on any of nine stored timings (PGSE, cosine OGSE, a stimulated echo and a -tensor encoding), chooses the tissue (, surface relaxivity and the sheaths’ susceptibility at 3 or 7 T) and a signal-to-noise ratio, and presses one button. Within two minutes the page returns the whole phantom’s Monte Carlo diffusion-weighted images under that protocol, every tissue tier included, and for
a diffusion protocol the fibre orientations, the tractogram and the connectome scored against the ground truth, or for the -tensor encoding the maps of mean diffusivity and microscopic anisotropy (Figure 12); the visitor downloads the images as NIfTI with their -values and directions, and the tractogram. No simulation runs: every image is a replay of the one DiSCo walk, at the accuracy its pack certifies, and the compute is the Hub’s shared GPU pool’s, charged to the visitor’s own daily quota (Table 9).
| Protocol | Replay | Maps or fit | Tracking | GPU in all | At the visitor |
| DiSCo’s own, 364 measurements, SNR 30 | 33 s | 1 s | 3 s | 41 s | 100 s |
| -tensor, linear and spherical, SNR 100 | 25 s | 9 s | – | 36 s | 72 s |
Table 9. A visitor’s run on the DiSCo page, on the Hub’s shared GPU, every tissue tier at 3 T: GPU time per stage and the time from the button to the results on the visitor’s screen.

Figure 12. The DiSCo page ((Fick, 2026c)) as a visitor sees it, snapshots of the live page (figures/fig_pages.py). After a run of DiSCo’s own 364-measurement protocol at SNR 30 with every tissue tier at 3 T: (A) a slice of the replayed images with the fibre orientations, (B) the tractogram, (C) the connectome against the strands’ count, scored against the ground truth. (D) After a -tensor run: fractional anisotropy, microscopic anisotropy and mean diffusivity, the ground truth’s crossing voxels outlined. (E) Each stage’s time and the files the visitor downloads: the images as NIfTI with their -values and directions, the fibre orientations and the tractogram.
The page does not read the 294 GB pack but its time-segment layout: the pack contracted once per stored timing by Eq. (12) (§ 1.5.3), 169 bytes per walker and 51 GB in all (Fick, 2026e), on which any -value and direction is one phase per walker. The connectome the page scores, 0.845, comes from dmipy-fit’s constrained spherical deconvolution and dmipy-tract’s probabilistic{footnote reference}5 tracker, both on the GPU, in place of the dipy pipeline of {xref}Table 8. What the page serves is what {xref}Sec. 4.5` validated: the layout is within of the full replay, against a combined bound of , and the page’s acceptance test refuses a build above . The price of seconds is the timing: the page serves the timings it stores, and a new one is one more contraction of the pack, done once rather than per visitor.
Discussion
Replay changes which part of the pipeline is scarce. Conventional Monte Carlo penalises a generator for its own realism, ConFiG (R. Callaghan et al., 2020), MEDUSA (Ginsburger et al., 2019), CACTUS [16], CATERPillar (Nguyen-Duc et al., 2026) or an axon traced from microscopy (Andersson et al., 2020; Lee, Jespersen, et al., 2020), because every geometry sample must be simulated again for every question asked of it; replay simulates a sample once, to a declared accuracy, and every later question is an inner product. The break-even is the second question: DiSCo is walked once, and every further acquisition is an image of the whole phantom in seconds of a shared GPU (§ 3.0.2). What this leaves untouched is the parameter space, which Table 3 says still costs one simulation per geometry. The factorisation has a precedent in another field. Precomputed radiance transfer (Sloan et al., 2002) stores a spherical-harmonic record of light transport at every vertex of a scene once, evaluates any lighting
as an inner product with that record and rotates the record rather than the scene, as replay rotates the acquisition rather than the simulation, and it turned global illumination from an offline computation into a real-time one; replay does to spins what it did to light. The open problem moves upstream, to which tissue representations are worth solving rather than how quickly a signal can be simulated: the generators above, and the measured morphology they are built from (Aboitiz et al., 1992; Andersson et al., 2020; Liewald et al., 2014), become the scarce input, and replay makes each of their samples worth more questions, not fewer. Three consequences follow for the field, and one future direction.
Validation becomes a property of a file. A simulator is trusted today by its paper: the engine was checked against closed forms once [12] (Hall & Alexander 2009; Kerkelä et al. 2020), and every result it later produces inherits that trust. A pack carries its own certificate, each channel’s error stated as terms with a closed form beside the Monte-Carlo floor, the standard error of its walkers (§ 1.2.3), so the claim “this substrate is solved to for every waveform a Prisma can play” is a checkable property of an object anyone can download, not of a program anyone must believe. Other engines’ walks enter as packs read by the same reader, so engines are compared walker by walker rather than paper by paper (§ 2.1.3); the specification was written for exactly that. Every experiment in this paper reads a certificate before it reads a signal, and I would argue that a simulated reference should carry one.
The acquisition-and-model framework becomes explorable. Le Bihan’s many-to-one mapping from tissue to signal (Le Bihan, 2026) has been explored by acquiring: a new contrast means a new scan of a subject whose tissue is not known. A stored substrate is the other experiment, the one where the tissue is fixed and the acquisition varies without simulating again, and the DiSCo page (§ 3.0.2) puts that experiment in a visitor’s hands; DiSCo’s acquisitions in Table 8 are a first map of it. Sequence design against a stored tissue follows directly (Alexander, 2008; Drobnjak et al., 2010): the worst-waveform search of § 2.1 is already a search over a scanner’s deliverable set against a pack, and what it maximised here, the certificate’s error, can as well be a contrast.
Learned estimators get a training set that spans acquisitions. Microstructure is increasingly estimated by models trained on simulated signals: random forests and networks trained on Monte Carlo walks with exchange (Hill et al., 2021; Nedjati-Gilani et al., 2017), networks for a diffusion–relaxation model (de Almeida Martins et al., 2021), likelihood-free inference that learns a posterior from simulations (Cranmer et al., 2020; Jallais et al., 2022), and neural emulators that stand in for a simulator altogether (Kasim et al., 2022). Their accuracy is bounded by the distribution they were trained on (Gyori et al., 2022), and a Monte Carlo training set is tied to the protocol it was simulated with. A pack removes that tie: one simulation yields labelled signals for any acquisition, field strength and tissue parameter inside its certificate, each exact to it, so a training set spans protocols and tissue at the cost of replays rather than walks, and an emulator, where one is still wanted, is checked against the replay it approximates.
A commons of solved substrates. What makes a pack shareable is the contract and the compression: a specification that says what a substrate, a pack, an acquisition and a phantom are (Fick, 2026g), and a size small enough to host. The Hugging Face Hub is the infrastructure that fits it, because it serves pinned revisions and byte ranges, so a pack is not a file on one computer but a resource the whole community reads by the bytes its question needs: solved once and replayed indefinitely for any later question. Replaying needs nothing more than dmipy-replay, a reader with NumPy as its only dependency that replays any pack on the Hub. Nor is a pack a finished deposit: its endpoints are exact and a walk is Markov, so it can be continued by one more certified window without walking the first again (§ 1.5.1).
Limitations. Nothing in this paper is compared with a measured sample, the ex vivo tissue with known histology that validation of microstructure imaging rests on (Dyrby et al., 2018; Fieremans & Lee, 2018). What it establishes is the method: every channel, from the substrate to the voxel signal, is checked against a closed form, an independent computation or another simulator. Turning it into a prediction of a scan needs a sample whose substrate is known independently of that scan. What changes the position update still costs a simulation: the geometry, the diffusivity and permeability, and the kinetics of a bound pool (Table 3), with two exact exceptions. In time, a walk of duration at , read as one of duration with , is the walk at , every channel rescaled with it, and across a membrane the walk at and at no other pair (Powles et al., 1992); only faster, since replay’s in-step error grows as and the pack’s certificate does not cover it. Water’s rises 2.5 % per kelvin (Holz et al., 2000), so on an impermeable substrate this is a temperature knob. In space, scaling every length by , every pool’s by and permeability, surface relaxivity and binding by leaves , the crossing probability and unchanged, so the walk at size is the walk at size at , read at gradient ; exact both ways, but for the gradient can leave the waveforms the pack was certified for. The occupancy, contact and field channels are defined by the walk that accumulates them, so only an engine that implements those definitions writes them; another engine’s walk enters as positions alone. Every certificate in this paper is a Monte-Carlo floor, so a claim below a pack’s floor is not one it can make; and one comparison stands outside the noise: on the CACTUS strands this engine’s surface relaxation sits 0.3 to 0.6% of the signal above MCMRSimulator’s (§ 2.1.3), although it matches the closed form. on tessellated cylinders; the cause is not yet known.
From the voxel to the image. Replay here ends at each voxel’s signal on an ideal scanner. A real scanner’s own terms, its gradients’ nonlinearity, concomitant fields and readout, and a voxel’s distribution of fibre poses enter at the voxel through the replay equation (§ 1.1.1) without touching a pack; composing them is the step from an ideal scanner to a real one and from a voxel’s signal to an image, and it needs calibrations against measured maps that are future work.
Nothing in the walk’s projection is specific to MRI: any Monte Carlo whose observables are linear functionals of the path can keep the path’s coefficients on a basis in place of the path, and answer every later question from them.
Conclusion
A Monte Carlo simulation of tissue does not have to be run again to be asked again. Everything a scanner can do to a spin enters the signal through a few records of each walker’s history, the stored record has a band set by the scanner and not by the tissue, a rotated substrate is a rotated acquisition, and what a real scanner adds enters at the voxel. Stored once as a certified pack, 210 times smaller than its trajectories and 5 000 times at a timing, a simulation answers any acquisition by an inner product, in pores to the closed forms, on realistic axons to two other engines, and on DiSCo to the published images, and a phantom built this way is a public page that anyone can query in seconds. What remains scarce is no longer the simulation but the choice of what to simulate: which substrates, at which accuracy, are worth solving once for everyone. The pack specification and the commons are offered so that the choice can be a community’s.
Data and Code Availability
Every signal in this paper is simulated; no human or animal data were used. Every replay pack of the paper is public on the Hugging Face Hub under the SubstrateCommons organisation [3, 4] (Fick 2026d; Fick 2026e; Fick 2026f), free for research and non-commercial use under CC BY-NC-SA 4.0, with a commercial licence on request; each dataset states the terms of its packs beside the licence of the source geometry they were simulated in, which the packs never relicense. The DiSCo substrate, its images and its ground truth are the DiSCo authors’ dataset (Mendeley Data, CC BY 4.0) (Rafael-Patiño et al., 2021b).
The software is public under the dmrai-lab organisation on GitHub and on PyPI: the engine dmipy-sim, dmipy-fit, dmipy-tract, dmipy-design and the page’s application disco-space under AGPL-3.0 or a commercial licence, and the reader dmipy-replay and the replay-pack specification (Fick, 2026g) under Apache-2.0. The DiSCo page is public at https://huggingface.co/spaces/rfick/disco-replay (Fick, 2026c). The scripts behind every figure, which read the packs from the Hub at pinned revisions, are published with the paper’s source on publication.
Ethics Statement
This study involved no human participants, human data, or animal subjects, and required no ethical approval.
Author Contributions
Rutger Fick: Conceptualization, Methodology, Software, Validation, Formal analysis, Investigation, Data curation, Visualization, Writing – original draft, Writing – review & editing, Project administration.
Funding Information
This work received no external funding. The author self-funded it.
Declaration of Competing Interests
The author offers commercial licences for the software and the replay packs described here (Sec. 7).
Declaration of Generative AI and AI-Assisted Technologies
The engine, the analyses and the scripts behind every figure were developed with an AI coding agent (Claude, Anthropic) under my direction, and the manuscript was drafted and revised with it. I set every question and design decision, reviewed every change, and take full responsibility for the content. Every claim is checked against a closed form, an independent route or another engine (§ 2), and every figure names the script that produced it.
Acknowledgements
This work did not begin as a plan for Monte Carlo replay. When coding agents became capable of serious engineering, I wanted to see whether that capability could be pointed at infrastructure for the field, as dmipy once was, and replay grew out of asking, at every step, what more a simulation could give and how it could be done more efficiently. It is the product of a collaboration between a human acting as research director and AI coding agents that grew markedly more capable over the six months of the project. I thank Marco Pizzolato for our conversations over those six months, and the authors of DiSCo, CACTUS, MCMRSimulator.jl and MC/DC for making their data and software open, without which none of the comparisons here would exist. The carbon footprint of developing this computational efficiency framework is deliberately excluded, for reasons of personal embarrassment.
Supplementary Material
S1, the experimental details behind Table 5; S2, the fibre field and its long-range sum. They follow the references, with their own bibliography.
| Check | Substrate, simulation | Acquisition | Reference | Fig.; Supp. |
| Band certificate | free water, 2 and 10 cylinders, CACTUS bundle; 20 000 walkers, 100 ms, 2 000 modes | the worst deliverable waveform of six scanner classes, PGSE, OGSE | the truncation theorem, Eq. (10); split-half | 7; S1.1 |
| Canonical pores | the published family [3]: planes, cylinders, spheres, 0.1 to 20 in steps of 0.1, 600 packs; walkers set per pack by its pilot for a standard error of , 8 000 to 40 000; 100 ms | four PGSE timings at 1000, 3000; OGSE 50 to 800 Hz; FID | matrix method; Brownstein–Tarr; both under Robin | 8; S1.2 |
| Exchange | permeable slab, 4 , 10 and 100 ; 40 000 walkers, 100 ms | FID, spin echo, PGSE, gradient echo, TE 10 to 100 ms, 3 and 7 T | 1-D Bloch–Torrey with the transmission condition | 9; S1.3 |
| Realistic axons | CACTUS bundle (111 011 walkers, ); 100 ms | PGSE, OGSE 25 to 400 Hz, spin echo, gradient echo at 3 and 7 T, relaxivity 0 to 3 | the pack’s own floor; MCMR-Simulator.jl and MC/DC strand by strand, as packs | 10; S1.4 |
| DiSCo, partitioned | 12 196 strands in 1 , as curved myelinated cylinders on its centrelines, ; walkers on the 25 grid | the dataset’s four shells; five schemes it was never scanned with; a -tensor encoding | the published images; the known connectome | 11; S1.5 |
Table 5. The experiments. Simulations at unless stated, stored at the storage band of § 2.1 (256 modes per 100 ms); “floor” is the split-half Monte-Carlo floor.
Supplementary Material for: Replayable Monte Carlo MRI
Experimental details
The recipes behind Table 5, in its order; every figure’s data script is named in its caption.
The band certificate
Four substrates are simulated for ms at a save step of 0.1 ms, 20 000 walkers each, seed 7: free diffusion and cylinders of 2 and 10 diameter along at m/s, and the CACTUS bundle bundle_00000_capped ([16]) with all three pools at its own . Each is stored at , lossless on its 1001 saves. For each substrate, scanner class (Table S1) and the certificate of Sec. 3.3 is searched by projected Adam ascent on the simulation’s grid from 32 oscillatory starts over 300 steps (dmipy_design.certify), fitted on the first 10 000 walkers and measured on the other 10 000 against , with from the waveform’s sine coefficients above and the free bridge variance. PGSE ( ms at and 3000 s mm where deliverable) and cosine OGSE at 50–1600 Hz at each class’s maximum amplitude are read through the same slices; the 50 and 25 ms prefixes repeat the sweep on three classes. A class’s certified bandwidth is the crossing of its free-diffusion certificate with , interpolated in log–log between the sampled .
| Class | System | (mT/m) | (T/m/s) | Source |
| Prisma | Siemens Prisma, XR gradients | 80 | 200 | vendor specification, “achievable simultaneously along each axis” [14] |
| Connectom | Siemens Connectom, AS302 | 300 | 62.5 | McNab et al. [10]: 200 T/m/s hardware, “de-rated to 62.5 T/m/s during the diffusion encoding to prevent physiological stimulation” |
| Connectome 2.0 | MGH/Siemens head-only coil | 500 | 600 | design target [8], reached per axis on the built scanner [13] |
| MAGNUS | GE head-only insert, 1 MVA prototype | 200 | 500 | Foo et al. [5], “200 mT/m and 500 T/m/s on each axis”; the 2024 product is rated 300 mT/m, 750 T/m/s |
| BGA-9S | Bruker BioSpec gradient, 90 mm bore | 760 | 6840 | measured on system at , (Bruker BioSpin, 2011) |
| Micro2.5 | Bruker microscopy insert, 40 mm bore | 1500 | 15 000 | 1.5 T/m per direction; slew rate derived from the stated 5–95% rise time below 100 s at 60 A (Bruker BioSpin, 2024) |
Table S1. The scanner classes of Figure 7 and Table 6: the per-axis amplitude and slew rate the bound takes its worst case over, and their sources. The coefficient walks keep 2 000 modes over 100 ms, a band of 10 kHz above every class.
Canonical pores
The 600 published packs ([3]) are each walked from their own seed for ms and stored at , the surface channel at 8 modes; each walker count is set by a pilot of 8 000 walkers for any refocused Connectome 2.0 waveform and relaxivity up to 3 /s. The reference is the matrix method under the Robin condition ([1, 7] (Callaghan & Stepišnik 1995)) (figures/pore_oracle.py), its split step resolving the pore’s slowest relaxation by sixteen sub-steps (at most 64), the waveform’s samples held over the echo time and not beyond it. The rows are PGSE at of 5/20, 10/40, 10/60 and 25/55 ms at of 1000 and 3000 s/mm, with and without relaxivity; cosine OGSE at 50 to 800 Hz and 0.3 T/m; and the free-induction decay at 10 to 100 ms at relaxivities of 1 and 3 /s. Figure 8D reads nested prefixes of each pack’s shuffled ensemble.
The permeable slab
The two 2 m compartments of a closed 4 m slab have of 10 and 100 m/s between them, of 80 and 20 ms, and one is magnetised at ppm at 3 and 7 T, its Lorentz-corrected field with in its plane; every walker starts on one side. One simulation of 40 000 walkers over 100 ms stores both channels at the band of § 2.1; every row is compared at its standard error. The reference is the one-dimensional Bloch–Torrey equation with at the membrane, by finite differences with a Strang split (400 nodes, the diffusion half-steps in the eigenbasis of the transmission Laplacian, the 180 as a conjugation); doubling the nodes and halving the step changes it below .
Realistic axons
The substrate is the CACTUS bundle bundle_00000 [16]: 344 of its 366 myelinated strands, each an inner and an outer triangle mesh (1.5 triangles; 22 strands whose surface is not watertight are dropped), in a 30 m box, reflecting at its faces in this engine’s pack. Intra- and extra-axonal water are at m/s with of 50 and 55 ms; myelin water at 40% density, ms, ppm, no diffusion. One GPU walk of 111 011 walkers over ms carries every channel of Eq. (1), stored at . The myelin field’s basis is rasterised on nodes,
Realistic axons
two across the thinnest sheath, membership by ray parity per strand (25.31% of the cell is sheath on the raster, 25.27 ± 0.07% by sampling the specification). The contrasts of Table 5 are perpendicular PGSE ( ms) and OGSE at s/mm under the Connectome 2.0 limits, a spin echo at six echo times, and the gradient echo at TE 40 ms with isotropic myelin susceptibility.
The two references walk the intra-axonal pool strand by strand from shared start positions, each strand periodic along the 30 m cell, exact at zero permeability: MCMRSimulator.jl 1.1 [2] at its default step and MC/DC 1.50 [12] at 2.3 s, one process and seed per strand. Their PGSE rows are a bipolar trapezoid pair, ms, readout at 61 ms, nominal of 500 to 3000 s/mm (527 to 3412 with the ramps), without RF. Each walk is also a pack of 88 bands from positions at 36.8 s, with the engine, version, commit, step and seeds in the header. The comparison of Table 7 reads all three packs under PGSE ( ms, TE 60 ms) at of 1 000 to 10 000 s/mm and at 0, 30, 60 and 90° to the bundle axis, 11 azimuths per angle; on that grid the 88-band packs’ truncation stays below , the reading’s standard errors above . MCMRSimulator’s collision loss per hit is the Robin condition at , checked on a sphere against Brownstein–Tarr to . On the extra-axonal pool, 500 spins under a three-hour cap on eight threads, MCMRSimulator reached 74 of the 100 ms and MC/DC completed 60 spins. Scripts, packs and logs: figures/mesh_xengine/packs/.
Table S2: The intra-axonal pool of the CACTUS bundle’s 176 strands walked by three engines: MCMRSimulator and MC/DC strand by strand from the same 40 678 start positions, stored as packs of 88 bands; dmipy-sim as the intra-axonal pool of the whole-bundle pack, 37 458 walkers. The walk’s cost, and at s/mm the pack’s signal through one reader and its difference from dmipy-sim’s as independent walks, with one standard error.
| Engine | Version | Step | Hardware, walk | at | minus dmipy-sim |
| dmipy-sim | 2.2.0 | 2.8 s | one H100, 523 s (whole bundle) | 0.9428 0.0006 | — |
| MCMRSimulator.jl | 1.1.0 | default, 3–45 s | 8 CPU threads, 6 354 s | 0.9422 0.0005 | |
| MC/DC | 1.50 | 2.3 s | 8 CPU threads, 4 919 s | 0.9415 0.0006 |
Table S2.
The surface channel. On closed 12- and 64-gon cylinders of radius 1 and 2.5 m at the bundle’s step, the boundary local time is within of and the free decay within 1.7 standard errors of Brownstein–Tarr at TE 10 to 100 ms and of 1 and 3 m/s. On the strands the replay sits above MCMRSimulator by 2.9 to 3.9 of the signal at m/s and 5.8 to 6.2 at 3 m/s over of 500 to 3000 s/mm, and by 6.1 to 6.4 against MCMRSimulator at a 2 s step on 26 strands.
DiSCo, partitioned
Each of DiSCo’s 12 196 strands ([11]) is two tubes swept along its centreline, the axolemma at the listed diameter and a sheath at a -ratio of 0.7; intra-axonal water inside the first and extra-axonal water outside the second, both at , with no exchange. The walk holds walkers, planned per voxel and pool for a floor of 1.0% within a 300 GB dataset, on the 31 815 of the 64 000 voxels that hold water. The dataset’s acquisition is one echo time of 53.5 ms, ideal pulses, the three upper shells at the ActiveAx timings of Alexander et al. (2010) (, and ms) and the shell, whose timing the dataset does not state, at the first shell’s. The other acquisitions of Table 8 are at the same echo time, each the waveform of one timing class of the published time-segment layout ([4]), so the public page replays exactly these: a clinical shell (, 30 directions, ms), a research multi-shell (, 2000 and 3000 , 90 directions each, 17/30 ms) and a Connectome 2.0 shell (, 60 directions, 8/20 ms), all with square lobes, a cosine OGSE at 50 Hz and , one 20 ms period each side of the refocusing pulse, and a stimulated echo (PGSTE; ms, mixing time 38.3 ms, ms) at with the OGSE shell’s 60 directions; Rician noise is added at replay. All, and the dataset’s images, go through constrained spherical deconvolution ([15]) at order 8, or the largest even order the sparsest shell supports, the response from the single-fibre voxels; probabilistic tracking seeded four times in every voxel of the sixteen regions, at most of turn per half-voxel step (both dipy, [6]); and the Pearson correlation of the matrix of streamline counts with the ground truth over the 120 pairs. The strands’ orientation in a voxel is the principal axis of the length-weighted dyadic of their tangents.
DiSCo’s tubes are meshes whose twelve-sided cross-section, inscribed in the nominal circle, holds of its area, where the pack’s tubes are round. Twelve straight tubes (inner radii –, -ratio 0.7, a periodic cell, walkers per pool, twenty directions per shell) simulated round and twelve-sided through the dataset’s acquisition differ by +0.004 to +0.008 of on every shell, and the intra-axonal weight term alone reproduces that to within (Table S3).
| (s/mm) | intra round | intra poly | extra round | extra poly | combined round | combined poly | round − poly | s.e. () | weight | intra | extra |
| 1 000 | 0.8151 | 0.8163 | 0.6471 | 0.6466 | 0.7102 | 0.7064 | +0.0038 | 4.0 | +0.0039 | −0.0004 | +0.0003 |
| 1 925 | 0.6903 | 0.6924 | 0.4409 | 0.4399 | 0.5345 | 0.5288 | +0.0057 | 5.4 | +0.0058 | −0.0007 | +0.0007 |
| 3 094 | 0.6003 | 0.6015 | 0.2796 | 0.2776 | 0.3999 | 0.3916 | +0.0083 | 5.9 | +0.0075 | −0.0004 | +0.0013 |
| 13 191 | 0.2868 | 0.2891 | 0.0303 | 0.0277 | 0.1265 | 0.1197 | +0.0068 | 4.9 | +0.0060 | −0.0008 | +0.0017 |
Table S3. The same twelve tubes simulated round and twelve-sided through DiSCo’s acquisition: direction-averaged signal per pool and combined, the round-minus-polygon difference with its standard error, and its split into the intra-axonal weight term and the two pools’ own signal changes, all in units of .
The fibre field and its long-range sum
One fibre. The field of an infinite hollow cylinder of inner radius and outer radius , its sheath carrying with the radial director, is known in closed form ([17]); the pack stores it in the thirteen-channel basis of the -space kernel ([9],
, with the sheath indicator and the unit field direction, so that , its orientation and both susceptibilities are contractions at replay. In the fibre’s own frame ( the axis, the radial unit vector, , , ) the lumen has and , uniform, and the outside has and , fitted region by region to a two-dimensional -space solve of one annulus and agreeing with it on every component.
A curved fibre. A strand is a polyline, and a segment’s field is the dipole kernel integrated along it in closed form, , with the unit vector from the source point to the field point and the axial coordinate from the point’s foot on the axis: a segment of cross-section carries and , with the annulus-averaged director tensor; on a straight strand, however cut, this is the outside formula above. Within a strand’s outer tube and one radius beyond it, the strand’s own term is its nearest segment’s whole cylinder, and every other segment is seen from outside its sheath, so that holds everywhere. Table S4 is the cost of this rule at a joint; on one kinked strand of 20 m segments the segment sum agrees with the independent check below, on a 1 m grid, to 0.1–0.2% of the field’s r.m.s. at 15 to 70 m on every channel.
| joint | rule | lumen | sheath | within | beyond |
| 20° | segment fields | 5.0 | 3.6 | 0.8 | 0.7 |
| nearest segment | 4.8 | 3.5 | 1.4 | 0.9 | |
| 54° | segment fields | 8.9 | 8.4 | 3.6 | 0.6 |
| nearest segment | 9.0 | 9.3 | 4.6 | 1.4 |
Table S4. The fibre field against the rasterised -space route on one sheathed strand with joints of 20° (DiSCo’s median) and 54° (its sharpest), as the r.m.s. error over each region in percent of the component’s maximum; the sum of segment fields and, for comparison, the nearest-segment rule.
The long-range sum. Every segment’s term is split by a cubic smoothstep of its distance, from 0 at 11 to 1 at 18 , beyond the largest sheath’s gate plus two cells. The near part is summed in closed form at the walker’s position; the far part is tabulated once from all 636 951 segments on nodes of 2.5 (1.7 GB in half precision, shipped with the substrate) and read by tricubic interpolation. On a 100 crop of DiSCo’s centre the read error is 0.98% of the far part, 0.08% of the whole field. The sum within 100 of a point differs from the sum within 50 by 8.1% of the isotropic channels’ spread and 3.4% of the anisotropic.
The independent check. The far part depends only on each segment’s moment, so a source conserving it serves the -space route: cloud-in-cell assignment gives every cell of a 2.5 grid the sheath volume of the strand length it holds, and that volume times , smoothed by a one-cell Gaussian, under the kernel on a box zero-padded to twice the domain; it shares no closed form with the sum. On DiSCo’s whole tract ( cells) it agrees with the near sum plus far grid at 29 021 random points at least 15 from every segment to 0.15% of the isotropic channels’ r.m.s. and 0.04% of the anisotropic, correlation 1.0000, after the least-squares quadratic in position, the block’s own demagnetising field, is removed from both (with nothing removed, 1.5 and 0.1%).
References
- [1]Codd, S. L., & Callaghan, P. T. (1999). Spin echo analysis of restricted diffusion under generalized gradient waveforms: Planar, cylindrical, and spherical pores with wall relaxivity. Journal of Magnetic Resonance, 137(2), 358–372. https://doi.org/10.1006/jmre.1998.1679
- [2]Cottaar, M., Zheng, Z., Miller, K. L., Tendler, B. C., & Jbabdi, S. (2026). Multi-modal Monte Carlo MRI simulator of tissue microstructure [Preprint: bioRxiv 2025.04.03.646577]. Imaging Neuroscience, 4. https://doi.org/10.1162/IMAG.a.1177
- [3]Fick, R. H. J. (2026a). Canonical-pores: Planes, cylinders and spheres from 0.1 to 20 μm as replay packs [600 packs, CC BY-NC-SA 4.0 or commercial; accessed 2026-10-29]. https://huggingface.co/datasets/SubstrateCommons/canonical-pores
- [4]Fick, R. H. J. (2026b). DiSCo time segments: The DiSCo replay phantom contracted at its seven timing classes [Accessed 2026-10-29]. https://huggingface.co/datasets/SubstrateCommons/disco-time-segments
- [5]Foo, T. K. F., Tan, E. T., Vermilyea, M. E., Hua, Y., Fiveland, E. W., Piel, J. E., Park, K., Ricci, J., Thompson, P. S., Graziani, D., Conte, G., Kagan, A., Bai, Y., Vasil, C., Tarasek, M., Yeo, D. T. B., Snell, F., Lee, D., Dean, A., . . . Ho, V. B. (2020). Highly efficient head-only magnetic field insert gradient coil for achieving simultaneous high gradient amplitude and slew rate at 3.0 t (MAGNUS) for brain microstructure imaging. Magnetic Resonance in Medicine, 83(6), 2356–2369. https://doi.org/10.1002/mrm.28087
- [6]Garyfallidis, E., Brett, M., Amirbekian, B., Rokem, A., van der Walt, S., Descoteaux, M., & Nimmo-Smith, I. (2014). Dipy, a library for the analysis of diffusion MRI data. Frontiers in Neuroinformatics, 8, 8. https://doi.org/10.3389/fninf.2014.00008
- [7]Grebenkov, D. S. (2007). NMR survey of reflected Brownian motion. Reviews of Modern Physics, 79, 1077–1137. https://doi.org/10.1103/RevModPhys.79.1077
- [8]Huang, S. Y., Witzel, T., Keil, B., Scholz, A., Davids, M., Dietz, P., Rummert, E., Ramb, R., Kirsch, J. E., Yendiki, A., Fan, Q., Tian, Q., Ramos-Llordén, G., Lee, H.-H., Nummenmaa, A., Bilgic, B., Setsompop, K., Wang, F., Avram, A. V., . . . Rosen, B. R. (2021). Connectome 2.0: Developing the next-generation ultra-high gradient strength human MRI scanner for bridging studies of the micro-, meso- and macro-connectome. NeuroImage, 243, 118530. https://doi.org/10.1016/j.neuroimage.2021.118530
- [9]Marques, J. P., & Bowtell, R. (2005). Application of a Fourier-based method for rapid calculation of field inhomogeneity due to spatial variation of magnetic susceptibility. Concepts in Magnetic Resonance Part B, 25B(1), 65–78. https://doi.org/10.1002/cmr.b.20034
- [10]McNab, J. A., Edlow, B. L., Witzel, T., Huang, S. Y., Bhat, H., Heberlein, K., Feiweier, T., Liu, K., Keil, B., Cohen-Adad, J., Tisdall, M. D., Folkerth, R. D., Kinney, H. C., & Wald, L. L. (2013). The Human Connectome Project and beyond: Initial applications of 300 mt/m gradients. NeuroImage, 80, 234–245. https://doi.org/10.1016/j.neuroimage.2013.05.074
- [11]Rafael-Patiño, J., Girard, G., Truffet, R., Pizzolato, M., Caruyer, E., & Thiran, J.-P. (2021). The diffusion-simulated connectivity (DiSCo) dataset. Data in Brief, 38, 107429. https://doi.org/10.1016/j.dib.2021.107429
- [12]Rafael-Patino, J., Romascano, D., Ramirez-Manzanares, A., Canales-Rodríguez, E. J., Girard, G., & Thiran, J.-P. (2020). Robust Monte-Carlo simulations in diffusion-MRI: Effect of the substrate complexity and parameter choice on the reconstructed microstructure. Frontiers in Neuroinformatics, 14, 8. https://doi.org/10.3389/fninf.2020.00008
- [13]Ramos-Llordén, G., Lee, H.-H., Davids, M., Dietz, P., Krug, A., Kirsch, J. E., Mahmutovic, M., Müller, A., Ma, Y., Lee, H., Maffei, C., Yendiki, A., Bilgic, B., Park, D. J., Tian, Q., Clifford, B., Lo, W.-C., Stocker, S., Fischer, J., . . . Huang, S. Y. (2026). Ultra-high gradient connectomics and microstructure MRI scanner for imaging of human brain circuits across scales. Nature Biomedical Engineering, 10, 309–324. https://doi.org/10.1038/s41551-025-01457-x
- [14]Siemens Healthineers. (2024). MAGNETOM Prisma: 3t MRI scanner, technical details (XR gradients, 80 mt/m at 200 t/m/s) [Accessed 2026-09-13]. https://www.siemens-healthineers.com/magnetic-resonance-imaging/3t-mri-scanner/magnetom-prisma
- [15]Tournier, J.-D., Calamante, F., & Connelly, A. (2007). Robust determination of the fibre orientation distribution in diffusion MRI: Non-negativity constrained super-resolved spherical deconvolution. NeuroImage, 35(4), 1459–1472. https://doi.org/10.1016/j.neuroimage.2007.02.016
- [16]Villarreal-Haro, J. L., Gardier, R., Canales-Rodríguez, E. J., Fischi-Gomez, E., Girard, G., Thiran, J.-P., & Rafael-Patiño, J. (2023). CACTUS: A computational framework for generating realistic white matter microstructure substrates. Frontiers in Neuroinformatics, 17. https://doi.org/10.3389/fninf.2023.1208073
- [17]Wharton, S., & Bowtell, R. (2012). Fiber orientation-dependent white matter contrast in gradient echo MRI. Proceedings of the National Academy of Sciences, 109(45), 18559–18564. https://doi.org/10.1073/pnas.1211075109







