# Geiger TRNG randomness analysis

**Generated:** 2026-05-25T10:38:51Z (duration 11.28 s)
**Git SHA:** 934fae4c3eb0301b9706c91aeb9b21a958c2277e  ·  **Analysis version:** 1.0.0  ·  **Python:** 3.13.5

## Parameters

| Knob | Value |
|---|---|
| bits window | 65536 bytes (524,288 bits) |
| events window | 60.0 min |
| metrics window | 24.0 h |
| pile-up cutoff | 5000 µs |
| ACF max lag | 32 |

## Inputs

| Source | Loaded |
|---|---|
| `bits_stream.bin` (last N) | 65536 bytes |
| `events.csv` deltas | 34096 |
| `metrics.tsv` rows | 108 |
| `health.csv` rows | 13523 |
| `battery_history.tsv` rows | 31 |

---

## A · Source physics — inter-arrival distribution



The Geiger source is a Poisson process: the probability of an event in any
infinitesimal interval is constant. Inter-arrival times of a Poisson process
are exponentially distributed.

**Observed:**

| Statistic | Value |
|---|---|
| n deltas | 34,096 |
| mean Δt | 105583.6 µs |
| median Δt | 72533.5 µs |
| min Δt | 66.1 µs |
| max Δt | 1234809 µs |
| estimated rate | 9.47 Hz (568 CPM) |

**Goodness-of-fit (Kolmogorov-Smirnov vs exponential):**
KS statistic = 0.0084,
p-value = 0.0162 →
**departs_from_poisson**

**Pile-up cluster** (Δt < 5000 µs, the GM tube + NE555 recovery floor):
1845 of 34,096
(5.41%).


![Inter-arrival log-log histogram](plots/interarrival_loglog.png)

*([interactive HTML](plots/interarrival_loglog.html))*



The pile-up cluster shows up as the spike below the cutoff line: events that
arrived faster than the recovery dynamics. These come from genuine random
arrivals binned by the dead-time floor:

![Pile-up cluster histogram](plots/pileup_cluster.png)

*([interactive HTML](plots/pileup_cluster.html))*




---

## B · Bit-level statistics



The Δt₁ vs Δt₂ disjoint-pair extractor emits 1 if Δt₁ > Δt₂, 0 otherwise.
With independent samples and constant dead time, the symmetry argument gives
unbiased output. With non-constant dead time (which we have — see Section A)
we filter by `--reject-us`.

| Statistic | Value | Target |
|---|---|---|
| n bits | 524,288 | – |
| ones | 262,174 (50.006%) | 50% |
| bias | +0.00006 | 0 |
| bias 1σ (sampling) | ±0.00069 | – |
| Shannon entropy | 7.9971 bits/byte | 8.0 |
| χ² statistic | 264.34 | ~255 (df) |
| χ² percentile | 33.06% | 5–95% |

**Autocorrelation** at lag 1..32 —
maximum |ρ| = 0.0041 at lag 10.


![Bit-stream autocorrelation](plots/bit_acf.png)

*([interactive HTML](plots/bit_acf.html))*



**Byte distribution** (0..255):

![Byte-value histogram](plots/byte_histogram.png)

*([interactive HTML](plots/byte_histogram.html))*



**Frequency-domain check.** A truly uniform bit stream has a flat power
spectrum (white noise). Any structural bias shows up as a peak.
Spectral flatness = 0.5620 (1.0 = perfectly flat):

![FFT power spectrum](plots/fft_power.png)

*([interactive HTML](plots/fft_power.html))*




---

## C · Drift over time (L2 rolling stats)



108 samples over the trailing 24.0 h
(2026-05-24T19:17:42Z → 2026-05-25T10:35:19Z).

| Metric | mean | std | first | last | min | max |
|---|---|---|---|---|---|---|
| bias | -0.0006 | 0.0055 | 0.0017 | -0.0022 | -0.0175 | 0.0115 |
| ent_bpb | 7.8059 | 0.0170 | 7.8181 | 7.7994 | 7.7674 | 7.8457 |
| chi_pct | 46.9750 | 29.0737 | 61.1500 | 19.7500 | 1.4900 | 98.9900 |
| lag1_bits | 0.0042 | 0.0123 | -0.0075 | -0.0185 | -0.0246 | 0.0313 |
| mean_dt_ms | -4164.8402 | 42467.7698 | -443108.4100 | 111.0300 | -443108.4100 | 112.8500 |
| lag1_dt | 0.0003 | 0.0385 | -0.0010 | -0.0406 | -0.0726 | 0.2426 |
| pileup_pct | 6.6434 | 3.3319 | 4.0000 | 4.3900 | 4.0000 | 32.9100 |



![Bias timeline](plots/bias_timeline.png)


![Entropy timeline](plots/entropy_timeline.png)


![χ² percentile timeline](plots/chi_timeline.png)


![Pile-up % timeline](plots/pileup_timeline.png)




---

## D · Health-test history (L1)



13523 rows in `health.csv`.


**Adaptive Proportion Test** — counts of bits matching the first bit of each
W=512 window. NIST cutoff: 310.

| | Observed | Theoretical |
|---|---|---|
| n verdicts | 13517 | – |
| n pass | 13517 | – |
| n fail | 0 | – |
| count mean | 256.60 | 256.00 |
| count std | 11.28 | 11.31 |


![APT count distribution vs Bin(W, 0.5)](plots/apt_distribution.png)



**RCT failures logged:** 5



---

## E · Battery history (L3)



31 runs from 2026-05-07T22:45:52Z to 2026-05-25T06:22:22Z.
**24 pass / 7 fail.** Current pass-streak: **7**.

| Metric | Value |
|---|---|
| ent mean | 7.9971 bits/byte |
| ent range | 7.9965 – 7.9977 |
| Rabbit pass-rate | 80.65% |
| Alphabit pass-rate | 83.87% |


![Daily battery history](plots/battery_history.png)


**Recent runs:**

| ts | ent | chi% | rabbit | alphabit | failures |
|---|---|---|---|---|---|
| 2026-05-22T02:01:00Z | 7.9971 | 38.11 | 1 | 1 | 0 |
| 2026-04-30T22:49:08Z | 7.9974 | 77.06 | 1 | 1 | 0 |
| 2026-05-24T19:17:55Z | 7.9974 | 76.35 | 1 | 1 | 0 |
| 2026-04-30T22:49:08Z | 7.9971 | 33.37 | 1 | 1 | 0 |
| 2026-05-25T06:22:22Z | 7.9971 | 32.61 | 1 | 1 | 0 |




---

## F · NIST SP 800-22 STS subset



A subset of the NIST SP 800-22 Statistical Test Suite, computed
directly from the loaded bit window (524,288
bits). The decision rule is **pass if p ≥ α**, with α = 0.01
(the canonical NIST threshold).

**Summary:** 4 pass / 0 fail.
**Overall: PASS.**

| Test | p-value | Verdict | Detail |
|---|---|---|---|
| Frequency (monobit) | 0.9340 | pass | S_n = 60 |
| Block Frequency | 0.0771 | pass | M=128, N=4096, χ²=4225.62 |
| Runs | 0.1961 | pass | V_n = 261676 (expected 262144) |
| Longest Run of 1s | 0.2839 | pass | M=128, N=49, χ²=6.24 |


![NIST STS subset p-values](plots/nist_pvalues.png)

*([interactive HTML](plots/nist_pvalues.html))*


The four tests cover progressively finer structure:
- **Frequency** — global 0/1 balance.
- **Block Frequency** — per-block balance (catches local drift).
- **Runs** — bit-flip frequency vs the random expectation.
- **Longest Run of 1s** — local clustering, sensitive to dead-time
  artefacts the others miss.

With our default 64 KB load (≈ 524 K bits), Longest Run runs in the
NIST M=128 / N=49 regime. To activate the larger M=10,000 / N=75
regime, run an ad-hoc analysis with `--bits-window-bytes 131072`
(≥ 1 M bits) once `bits_stream.bin` is big enough.



---

## Notes

- Static PNGs in `plots/` (rendered inline above) are produced via matplotlib.
- Interactive Plotly charts live alongside as `plots/*.html` (linked under
  Section A/B; for Section C/D/E open them directly from a clone).
- Source data slices used for this run are in `raw/` (if `keep_raw=True`).
- Numeric values are also available machine-readable in `stats.json`.
- This report is generated by `analysis/runner.py` v1.0.0.
