# Geiger TRNG randomness analysis

**Generated:** 2026-05-19T09:06:28Z (duration 10.83 s)
**Git SHA:** 80c87827706c917c589979f97272e5651bd452be  ·  **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 | 34058 |
| `metrics.tsv` rows | 270 |
| `health.csv` rows | 10407 |
| `battery_history.tsv` rows | 24 |

---

## 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,058 |
| mean Δt | 105701.1 µs |
| median Δt | 73368.2 µs |
| min Δt | 238.3 µs |
| max Δt | 1239001 µs |
| estimated rate | 9.46 Hz (568 CPM) |

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

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


![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 | 261,609 (49.898%) | 50% |
| bias | -0.00102 | 0 |
| bias 1σ (sampling) | ±0.00069 | – |
| Shannon entropy | 7.9972 bits/byte | 8.0 |
| χ² statistic | 256.94 | ~255 (df) |
| χ² percentile | 45.42% | 5–95% |

**Autocorrelation** at lag 1..32 —
maximum |ρ| = 0.0037 at lag 30.


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

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

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




---

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



270 samples over the trailing 24.0 h
(2026-05-18T09:02:18Z → 2026-05-19T09:01:47Z).

| Metric | mean | std | first | last | min | max |
|---|---|---|---|---|---|---|
| bias | -0.0012 | 0.0059 | 0.0050 | 0.0034 | -0.0167 | 0.0167 |
| ent_bpb | 7.8071 | 0.0151 | 7.8100 | 7.8201 | 7.7561 | 7.8481 |
| chi_pct | 47.8699 | 26.7795 | 60.2800 | 83.5000 | 0.4400 | 99.1800 |
| lag1_bits | -0.0006 | 0.0106 | 0.0061 | -0.0036 | -0.0283 | 0.0265 |
| mean_dt_ms | 105.4456 | 3.2454 | 103.9300 | 105.6700 | 96.4400 | 113.2200 |
| lag1_dt | -0.0041 | 0.0296 | -0.0344 | -0.0201 | -0.0893 | 0.0888 |
| pileup_pct | 4.4728 | 0.5969 | 4.9800 | 4.2000 | 2.9300 | 6.6400 |



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



10407 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 | 10402 | – |
| n pass | 10402 | – |
| n fail | 0 | – |
| count mean | 256.54 | 256.00 |
| count std | 11.20 | 11.31 |


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



**RCT failures logged:** 4



---

## E · Battery history (L3)



24 runs from 2026-05-07T22:45:52Z to 2026-05-19T02:02:37Z.
**17 pass / 7 fail.** Current pass-streak: **0**.

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


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


**Recent runs:**

| ts | ent | chi% | rabbit | alphabit | failures |
|---|---|---|---|---|---|
| 2026-05-17T18:28:20Z | 7.9975 | 86.11 | 1 | 1 | 0 |
| 2026-04-30T22:49:08Z | 7.9975 | 86.31 | 0 | 0 | 2 |
| 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 |




---

## 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.1395 | pass | S_n = -1070 |
| Block Frequency | 0.7469 | pass | M=128, N=4096, χ²=4035.47 |
| Runs | 0.7530 | pass | V_n = 262029 (expected 262143) |
| Longest Run of 1s | 0.2663 | pass | M=128, N=49, χ²=6.43 |


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