# fstrim batch-outcome model

This executable illustration reduces labelled outcomes using the counters in
util-linux v2.41.2. It is not a device test, a fstrim replacement, or a simulation
of physical reclamation. No command, mount discovery, or ioctl is performed.

Run with Node.js: `node --test model.test.mjs`.
Inspect examples: import `examples` and `summarize` from `model.mjs`.

## Boundary

Input represents one successfully parsed, initially nonempty table after
selection, with exclusions retained as labels. An empty input means all targets
were excluded, NOT that parsing found an empty table. Missing files, parse errors,
allocation errors, mount races, output failures and final process teardown are
outside this reduction. Dry-run failures can occur before the ioctl boundary.

The source counts selected targets and negative results. Unsupported outcomes
do not increment its error counter. Thus exit 64 can coexist with zero successful
FITRIM calls. Exit 0 also cannot prove complete inventory coverage.

Seven explicit cases and all 5,461 sequences of four outcome labels through
length six check accounting. They are synthetic cases, not a sampled population.

## Evidence

- [Pinned upstream C source](https://raw.githubusercontent.com/util-linux/util-linux/v2.41.2/sys-utils/fstrim.c):
  `fstrim_filesystem`, `fstrim_all_from_file`, `fstrim_all`.
- [Interpretation](https://hesela.com/analyses/discard-is-not-zeroing/#fstrim-coverage).
- [Stable term](https://hesela.dev/terms/fstrim/).

Reviewed 2026-12-04. Source SHA256:
`9862deaa1e78f03b24bf907b7ee0d90624d8f516e90d1e5b263d4436fd5f14f5`.
