Sample-index coverage worksheet - Leviathan Systems
Original offline Python arithmetic. Python 3.10+ standard library only.

Run a hypothetical comparison:
  python training_sample_coverage.py --input examples.csv
Run one case:
  python training_sample_coverage.py --records 10 --ranks 3 --batch-size 3
Add --trace for at most 10,000 ordered occurrence rows. Output goes to stdout.
No network, package installation, training execution or customer data is used.

MODEL
There are N fixed, distinct records labelled 0..N-1. R denotes participating
sampler replicas, not necessarily physical GPUs or servers. The illustrative
sequence is ordered and unshuffled. Padding cycles from its beginning until
each rank has equal length; dropping instead removes the trailing records.
Strided assignment distributes positions across ranks. A separate local batch
policy keeps or discards each rank's incomplete final batch. Output distinguishes
assigned occurrences, retained occurrences, distinct record coverage, repetitions
and omissions. A zero-record case has no batches or trace rows.

For N=10, R=3 with padding, 12 assigned occurrences cover ten distinct records.
With local batch size 3 and local tail dropping, nine occurrences survive and
one distinct record is absent. Intended sampling may legitimately repeat records.
These counts do not establish equal weighting, useful work, throughput, training
quality, dataset correctness or a production pipeline's behavior.

Counts support N 0..10^15, R 1..10^6 and local batch size 1..10^9. Integer
arithmetic avoids floating-point rounding. CSV allows at most 10,000 typed cases.
The small trace is an illustration, not a PyTorch shuffle or distributed runtime.
This resource does not configure or operate any training infrastructure.

CONCEPTUAL REFERENCES - verified October 20, 2026
PyTorch 2.14 data documentation, DistributedSampler and local batching:
https://docs.pytorch.org/docs/2.14/data.html
Pinned version's sampler source (reference only; no source code copied):
https://github.com/pytorch/pytorch/blob/v2.14.0/torch/utils/data/distributed.py

The replica-tail and local-batch decisions are separate. Check the actual
application version, data ordering, sampling/augmentation and loader behavior;
this stipulated worksheet is not a certification or software-service offer.
