# Geiger TRNG randomness analysis

**Generated:** 2026-06-22T03:05:25Z (duration 10.77 s)
**Git SHA:** 45c8a589782b28f05740606df31c6b77b9698f23  ·  **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 | 35636 |
| `metrics.tsv` rows | 262 |
| `health.csv` rows | 1609 |
| `battery_history.tsv` rows | 90 |

---

## 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 | 35,636 |
| mean Δt | 101021.3 µs |
| median Δt | 71328.5 µs |
| min Δt | 176.2 µs |
| max Δt | 1160750 µs |
| estimated rate | 9.90 Hz (594 CPM) |

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

**Pile-up cluster** (Δt < 5000 µs, the GM tube + NE555 recovery floor):
1688 of 35,636
(4.74%).


![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,558 (50.079%) | 50% |
| bias | +0.00079 | 0 |
| bias 1σ (sampling) | ±0.00069 | – |
| Shannon entropy | 7.9976 bits/byte | 8.0 |
| χ² statistic | 221.12 | ~255 (df) |
| χ² percentile | 93.85% | 5–95% |

**Autocorrelation** at lag 1..32 —
maximum |ρ| = 0.0026 at lag 21.


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

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

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




---

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



262 samples over the trailing 24.0 h
(2026-06-21T03:10:20Z → 2026-06-22T03:05:20Z).

| Metric | mean | std | first | last | min | max |
|---|---|---|---|---|---|---|
| bias | -0.0004 | 0.0056 | 0.0007 | -0.0016 | -0.0144 | 0.0146 |
| ent_bpb | 7.8099 | 0.0176 | 7.8243 | 7.8159 | 7.7573 | 7.8498 |
| chi_pct | 51.4477 | 30.1157 | 80.4200 | 50.5900 | 0.1100 | 99.1200 |
| lag1_bits | -0.0020 | 0.0101 | -0.0023 | 0.0038 | -0.0288 | 0.0281 |
| mean_dt_ms | 101.8933 | 3.0951 | 100.1800 | 104.1900 | 92.8700 | 109.3500 |
| lag1_dt | 0.0019 | 0.0320 | -0.0053 | 0.0508 | -0.0864 | 0.1041 |
| pileup_pct | 4.7304 | 0.7141 | 4.4900 | 3.8100 | 2.9300 | 6.8400 |



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



1609 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 | 1607 | – |
| n pass | 1607 | – |
| n fail | 0 | – |
| count mean | 256.59 | 256.00 |
| count std | 11.17 | 11.31 |


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



**RCT failures logged:** 1



---

## E · Battery history (L3)



90 runs from 2026-05-07T22:45:52Z to 2026-06-22T02:04:54Z.
**35 pass / 55 fail.** Current pass-streak: **2**.

| Metric | Value |
|---|---|
| ent mean | 7.9971 bits/byte |
| ent range | 7.9943 – 7.9977 |
| Rabbit pass-rate | 68.89% |
| Alphabit pass-rate | 92.22% |


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


**Recent runs:**

| ts | ent | chi% | rabbit | alphabit | failures |
|---|---|---|---|---|---|
| 2026-06-20T04:38:39Z | 7.9966 | 62.86 | 1 | 1 | 0 |
| 2026-04-30T22:49:08Z | 7.9943 | 26.28 | 1 | 1 | 0 |
| 2026-06-20T18:16:54Z | 7.9943 | 26.68 | 0 | 1 | 1 |
| 2026-06-21T02:02:53Z | 7.9960 | 12.22 | 1 | 1 | 0 |
| 2026-06-22T02:04:54Z | 7.9975 | 85.85 | 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.2528 | pass | S_n = 828 |
| Block Frequency | 0.8673 | pass | M=128, N=4096, χ²=3995.38 |
| Runs | 0.6512 | pass | V_n = 262307 (expected 262143) |
| Longest Run of 1s | 0.6687 | pass | M=128, N=49, χ²=3.20 |


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