Energy as Credit: Bounded Early Termination for Domain-Decomposed Detector Simulation

When a single particle shower is simulated across many machines, each machine owning one slab of the detector, nobody can easily tell when the event is finished. Particles keep crossing from one slab into the next. A machine that has emptied its own queue cannot know whether a stray photon or a slow neutron is still on its way to it. The usual answer is a central coordinator that waits until every particle is accounted for. That waiting is where the time goes, because the last few particles are often low-energy stragglers that will never change what the detector records.

We propose to use the conserved energy of the event as a ledger that every machine can reason about without a coordinator. Every particle carries an upper bound on the energy it could still deposit. Machines run a lightweight averaging protocol on how much energy has already been deposited or has escaped the detector. This gives each machine, in a bounded number of rounds, a guaranteed upper bound on the energy that is still unsimulated anywhere in the system. Setting the tolerance to zero recovers exact termination. Setting it just below the detector's readout threshold lets every machine stop early and simultaneously, with a stated bound on what was skipped.

Core Claim

Classical termination detection asks a yes/no question: is anything still in flight? Detector simulation has a physical quantity, deposited energy, whose conservation turns that into a "how much" question. Our claim is that an energy ledger with one designated starting node, combined with existing finite-time consensus stopping rules, gives three things together. It gives a coordinator-free stopping rule that never terminates prematurely when the tolerance $\varepsilon$ is zero. It gives a tunable early stop whose skipped energy is provably at most $\varepsilon$. And at matched compute, that early stop preserves detector-level fidelity better than the time and energy cuts simulation practitioners use today.

The mechanism rests on one invariant. Let $E_0$ be the primary particle's energy. Let $D_i$ be the energy deposited in subdomain $i$, $X_i$ the energy that escaped through subdomain $i$'s outer boundary or was removed through untracked channels (neutrinos, production cuts deposited locally), and $C$ the total credit carried by particles still on local stacks or in transit. Then

$$E_0 = \sum_i \left(D_i + X_i\right) + C,$$

so the outstanding credit $C = E_0 - \sum_i (D_i + X_i)$ can be computed from quantities that only ever grow. That monotonicity is what makes the scheme robust. A stale or delayed report of $D_i + X_i$ can only overestimate $C$, so asynchrony and slow links make the rule more cautious, never less safe.

One subtlety decides whether the idea is physically sound. A particle's credit must be the most it could still deposit, not its kinetic energy. A thermal neutron carries almost no kinetic energy but releases a 2.2 MeV gamma when hydrogen captures it. Its credit must therefore include the capture Q-value, the energy released by the capture reaction. Getting this right is the difference between a valid bound and a silent bias.

How It Relates to Prior Work

Two systems papers motivate the accounting view. NeXeme: A Distributed Scheme Based on Nexus keeps an exact invariant for distributed reference counting: local counters plus in-flight increment/decrement messages always equal the global count. It also notes that such invariants are fragile under message loss. Distributed Resolution for ALC has solver modules that go idle when they can derive nothing new but wake up when a clause arrives from elsewhere. Global termination there requires everyone to be idle with nothing in transit, which is exactly the condition a transport worker faces. Both answer only yes or no. Neither has a physical quantity that would let a system stop when what remains is provably negligible. That is the step we add.

Two consensus papers supply the method. Convex Decreasing Algorithms: Distributed Synthesis and Finite-Time Termination in Higher Dimension shows three things: ratio-consensus updates shrink the convex hull of node states, the hull diameter bounds every node's error, and a norm-based stopping rule costs one scalar and one bit per iteration. We use ratio consensus in its "push-sum" form, where nodes pass along both a running value and a weight, so the network can compute a sum. The node where the primary particle enters starts with weight one, and all others start at zero. This yields the network-wide accounted energy without anyone knowing the number of nodes. The paper's stopping rule then certifies when that estimate is accurate.

Distributed Finite-Time Termination for Consensus Algorithm in Switching Topologies supplies the second layer. Nodes propagate running maximum and minimum estimates and test them only at epoch boundaries of length $n' \ge n-1$, which keeps the stopping decision simultaneous when links switch. We use it to propagate each node's outstanding-credit estimate. All nodes stop together once the maximum estimate is below $\varepsilon$. That paper also constrains us: the network-size bound $n'$ must not be underestimated. In our setting the subdomain layout is fixed by the geometry, so $n'$ is known, and we rely on that.

On the physics side, Selective background Monte Carlo simulation at Belle II discards whole events before full transport using a graph neural network on the decay tree. It reports more than 25x speedup on its TDCPV filter. The authors acknowledge that a learned filter can bias the physics. Our approach is complementary and differs in kind. It acts inside an event that is already being simulated, and the skipped energy is bounded by conservation rather than predicted by a classifier.

The fast-simulation literature, including CaloChallenge 2022: A Community Challenge for Fast Calorimeter Simulation, CaloDREAM -- Detector Response Emulation via Attentive flow Matching and Fast, accurate, and precise detector simulation with vision transformers, replaces transport with generative models. It supplies our fidelity metric and geometries. We do not compete with these surrogates. A natural extension is to hand the bounded remainder to one of them, but we keep that out of the core claim.

Research Program

We will build a domain-decomposed Monte Carlo transport harness. It will use Geant4 physics for the step-by-step interactions where feasible, wrapped so that each worker owns a spatial region, and a simplified in-house stepper wherever region-level decomposition of Geant4 proves impractical. Workers exchange boundary-crossing particles as messages over a configurable peer topology.

Each particle carries its credit: kinetic energy plus rest-mass or capture energy it could still release. Hadronic interactions in Geant4 do not conserve energy exactly step by step. We therefore log the per-step mismatch between credit in and credit out and fold it into the escaped/removed term $X_i$. We will report its empirical size, because if it is large the bound loosens.

On top of the transport, each worker runs push-sum on $D_i + X_i$ with the norm-based certificate. It then runs the epoch-checked max/min layer on its resulting estimate of the outstanding credit $C$. The output is a single stopping rule parameterized by $\varepsilon$.

Analytically, we will prove two properties under the monotonicity argument above. First, with reliable, possibly delayed links, no node stops while $C > \varepsilon$. Second, the time to detect termination after the true outstanding credit falls below $\varepsilon$ is at most two epochs plus the consensus certification time. We will also characterize what happens under message loss. A lost particle message makes the outstanding credit permanently look nonzero, so the system never stops early but may never stop at all. This failure mode is the reverse of NeXeme's, and we will detect it with a timeout plus resend.

Baselines

The naive reference point is the standard coordinator design. A master process collects per-worker sent and received particle counters through an all-reduce and broadcasts shutdown when every worker is idle and the counters match. This is exact termination with no early stop. Every method runs on the same geometries, events, worker counts and network emulation as our system, and we report wall-clock time per event and messages per event. No reported result was found on Lacuna for termination overhead in domain-decomposed particle transport, so this baseline's number is one we must measure.

The strongest practical competitors for the early-stop regime are the cuts practitioners already use: a global time cut that kills every particle after a fixed simulated time, and a kinetic-energy kill threshold. We will tune each competitor's cut on a held-out event set, with the same tuning budget as our $\varepsilon$, so that all methods use equal wall-clock time. Our method beats them if, at matched wall-clock time, it gives a lower discriminator score against full simulation, and it never violates its stated energy bound while the cuts do.

The fidelity reference comes from the generative surrogates. CaloDREAM -- Detector Response Emulation via Attentive flow Matching reports a classifier AUC of about 0.53 on CaloChallenge Dataset 2, where an AUC of 0.5 means a trained classifier cannot tell the samples from Geant4. The community models in CaloChallenge 2022 reach roughly 0.5–0.6. These numbers set what "indistinguishable" means in practice. We want early-stopped transport to stay well below 0.53 while saving a measurable fraction of the roughly 10 seconds per shower that Fast, accurate, and precise detector simulation with vision transformers cites for Geant4.

For the termination layer itself, the reference is the epoch protocol of Distributed Finite-Time Termination for Consensus Algorithm in Switching Topologies. It reports simultaneous termination of 10 agents in 21 iterations at tolerance 0.01. We will report detection latency in comparable iteration units.

Two ablations isolate the key ingredient. The first replaces credit with plain kinetic energy, dropping capture and rest-mass terms. It should visibly break the bound in neutron-rich events. The second keeps the credit but stops on local idleness alone, with no consensus. It should terminate prematurely.

Why not just…?

Why not just parallelize over events and never decompose a single event? This is the most serious threat. For most calorimeter workloads, giving each event its own worker is embarrassingly parallel and needs no termination protocol at all. We therefore restrict the claim to two regimes. The first is when a single event's geometry or particle multiplicity does not fit one worker's memory, as with continuous Time Projection Chamber volumes such as in TPCpp-10M or kiloton-scale scintillator such as Neutrino physics with JUNO. The second is when per-event latency rather than throughput matters. We will report the crossover point where event-level parallelism wins. If decomposition never pays off in any regime we test, the protocol result stands on its own, but the physics motivation weakens, and we will say so.

Why not just use counters and an all-reduce, which is exact and simple? Counters can say that nothing is in flight. They cannot say that what is in flight is worth less than the detector threshold, so they cannot stop early with a guarantee. The zero-tolerance version of our method must match counters in correctness and come close in overhead. The value of the proposal lies entirely in the positive-tolerance regime, which counters cannot express.

Why not just apply a time cut or energy kill threshold? These are cheap and widely used. They bound neither the skipped energy nor its spatial location. A time cut applied in water silently removes the delayed capture gammas that Cosmogenic Neutron Production in Water at SNO+ depends on. Our matched-compute comparison settles whether the bound buys real fidelity or only theoretical comfort.

Why not just filter events up front, as Belle II does? Up-front filtering decides whether to simulate an event at all. It cannot shorten an event that must be simulated. The two compose, and we will show that combined savings multiply rather than overlap.

Proposed Experiments

The first experiment checks correctness. It uses the CaloChallenge Dataset 2 geometry (45 cylindrical layers, 6,480 voxels) and Dataset 3 geometry (40,500 voxels), split into 4 to 45 layer-group subdomains on ring, mesh and switching topologies. With $\varepsilon = 0$, we verify zero premature terminations over a large event sample and measure detection latency and message overhead against the counter baseline.

The second experiment sweeps $\varepsilon$ from zero up to the readout threshold. At each setting it measures wall-clock savings and the classifier AUC of the voxel energies against full transport, plotted against time-cut and energy-kill curves at equal cost.

The third experiment is the decisive test of the credit definition. It runs a water volume with injected cosmogenic-like neutrons. If our bound is right, the neutron-capture count and the 2.2 MeV deposit spectrum must be preserved at every $\varepsilon$ below 2.2 MeV. The kinetic-energy ablation and the time cut must visibly lose them.

The fourth experiment injects link switching and message loss to map where the safety and liveness guarantees hold. It also measures how large Geant4's per-step energy non-conservation is, since that sets the tightest tolerance the method can honestly claim.