# ADR-0341: A shard teaches a cost only for the mutants it ran

**Status:** Accepted
**Date:** 2026-12-03
**Amends:** [0013](/docs/decisions/a-run-learns-which-tests-kill-and-how-wide-to-cut): what a finished shard teaches of its units' costs

## Context

A finished shard shares the time it spent mutating among its units, in
proportion to their mutants' durations, and a mutant with no duration stands
in with the time of the tests covering its line. Every mutant a shard's part
of the test files reached took part in that share, whatever its status. A
mutant the budget ran out before is `unjudged`: it never ran, yet its stand-in
weighed as if it had.

In run 46964929812 the gate cut the test files into 18 parts. Each shard spent
between 2,173 s and 2,734 s and stopped on its budget. None of
`src/Core/Plan/ShardSizing.php`'s mutants ran in any shard: 36, 28 and 27 of
them were unjudged in three shards and the rest were not reached. Their
stand-ins still took a share of those three shards' time, and the unit learned
153.6 s. The next plan priced a change to that file and four others at
434.5 s; its one shard took 905.9 s.

## Decision

1. A mutant counts toward a shard's share only where the run spent work on it:
   killed by a test or by static analysis, survived, uncovered, timed out,
   errored, out of memory, or failing unmutated. An unjudged, skipped,
   equivalent, not-reached or marker-ignored mutant weighs nothing.
2. A unit none of whose mutants ran in a shard learns nothing from that shard.
   It keeps a timing an earlier shard taught it, or the plan measures or
   guesses its cost as for a unit no shard timed.
3. Where nothing that ran was timed at all, the units that ran share the time
   equally, and the others get none of it.

## Consequences

- A shard stopped by its budget teaches costs only for the work it did, so a
  unit's learned cost no longer comes from a run that never measured it.
- A unit with no mutable code in a shard no longer learns a share of that
  shard's time.
