# Geiger TRNG randomness analysis

**Generated:** 2026-05-21T04:06:28Z (duration 14.74 s)
**Git SHA:** c46462da71fe1ade400b74d432bb9626ff0c751c  ·  **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 | 34461 |
| `metrics.tsv` rows | 287 |
| `health.csv` rows | 11781 |
| `battery_history.tsv` rows | 26 |

---

## 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,461 |
| mean Δt | 104459.7 µs |
| median Δt | 71718.3 µs |
| min Δt | 284.8 µs |
| max Δt | 1052981 µs |
| estimated rate | 9.57 Hz (574 CPM) |

**Goodness-of-fit (Kolmogorov-Smirnov vs exponential):**
KS statistic = 0.0045,
p-value = 0.4861 →
**consistent_with_poisson**

**Pile-up cluster** (Δt < 5000 µs, the GM tube + NE555 recovery floor):
1520 of 34,461
(4.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,378 (50.045%) | 50% |
| bias | +0.00045 | 0 |
| bias 1σ (sampling) | ±0.00069 | – |
| Shannon entropy | 7.9975 bits/byte | 8.0 |
| χ² statistic | 227.85 | ~255 (df) |
| χ² percentile | 88.84% | 5–95% |

**Autocorrelation** at lag 1..32 —
maximum |ρ| = 0.0030 at lag 14.


![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.5622 (1.0 = perfectly flat):

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

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




---

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



287 samples over the trailing 24.0 h
(2026-05-20T04:07:24Z → 2026-05-21T04:04:31Z).

| Metric | mean | std | first | last | min | max |
|---|---|---|---|---|---|---|
| bias | 0.0002 | 0.0058 | 0.0079 | -0.0001 | -0.0175 | 0.0142 |
| ent_bpb | 7.8056 | 0.0180 | 7.8250 | 7.8003 | 7.7449 | 7.8505 |
| chi_pct | 45.8707 | 28.8476 | 67.8900 | 30.5100 | 0.2800 | 99.1800 |
| lag1_bits | 0.0027 | 0.0113 | -0.0216 | -0.0065 | -0.0294 | 0.0380 |
| mean_dt_ms | 104.5689 | 3.2183 | 103.6300 | 101.6700 | 91.1500 | 113.0700 |
| lag1_dt | 0.0020 | 0.0317 | 0.0531 | -0.0281 | -0.0766 | 0.0968 |
| pileup_pct | 4.4324 | 0.6630 | 4.1000 | 4.3900 | 2.5400 | 5.9600 |



![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)



11781 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 | 11776 | – |
| n pass | 11776 | – |
| n fail | 0 | – |
| count mean | 256.58 | 256.00 |
| count std | 11.25 | 11.31 |


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



**RCT failures logged:** 4



---

## E · Battery history (L3)



26 runs from 2026-05-07T22:45:52Z to 2026-05-21T02:04:53Z.
**19 pass / 7 fail.** Current pass-streak: **2**.

| Metric | Value |
|---|---|
| ent mean | 7.9970 bits/byte |
| ent range | 7.9965 – 7.9977 |
| Rabbit pass-rate | 76.92% |
| Alphabit pass-rate | 80.77% |


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


**Recent runs:**

| ts | ent | chi% | rabbit | alphabit | failures |
|---|---|---|---|---|---|
| 2026-05-17T19:03:37Z | 7.9975 | 86.31 | 0 | 0 | 2 |
| 2026-05-18T02:02:37Z | 7.9975 | 91.37 | 0 | 0 | 2 |
| 2026-05-19T02:02:37Z | 7.9970 | 22.42 | 0 | 0 | 3 |
| 2026-05-20T02:00:32Z | 7.9967 | 2.58 | 1 | 1 | 0 |
| 2026-05-21T02:04:53Z | 7.9974 | 82.68 | 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.5181 | pass | S_n = 468 |
| Block Frequency | 0.4597 | pass | M=128, N=4096, χ²=4104.50 |
| Runs | 0.1879 | pass | V_n = 261667 (expected 262144) |
| Longest Run of 1s | 0.8982 | pass | M=128, N=49, χ²=1.62 |


![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.
