# Geiger TRNG randomness analysis

**Generated:** 2026-06-20T04:42:44Z (duration 13.25 s)
**Git SHA:** ab89fdbb9f87bdc43c21abbf351f86eaf44677d0  ·  **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) | 51896 bytes |
| `events.csv` deltas | 2642 |
| `metrics.tsv` rows | 232 |
| `health.csv` rows | 812 |
| `battery_history.tsv` rows | 86 |

---

## 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 | 2,642 |
| mean Δt | 97364.8 µs |
| median Δt | 57509.1 µs |
| min Δt | 265.3 µs |
| max Δt | 8126369 µs |
| estimated rate | 10.27 Hz (616 CPM) |

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

**Pile-up cluster** (Δt < 5000 µs, the GM tube + NE555 recovery floor):
144 of 2,642
(5.45%).


![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 | 415,168 | – |
| ones | 207,517 (49.984%) | 50% |
| bias | -0.00016 | 0 |
| bias 1σ (sampling) | ±0.00078 | – |
| Shannon entropy | 7.9965 bits/byte | 8.0 |
| χ² statistic | 249.01 | ~255 (df) |
| χ² percentile | 59.39% | 5–95% |

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


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

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

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




---

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



232 samples over the trailing 24.0 h
(2026-06-19T04:45:32Z → 2026-06-20T04:41:36Z).

| Metric | mean | std | first | last | min | max |
|---|---|---|---|---|---|---|
| bias | -0.0006 | 0.0055 | 0.0039 | -0.0018 | -0.0144 | 0.0107 |
| ent_bpb | 7.8091 | 0.0193 | 7.8015 | 7.7938 | 7.7535 | 7.8573 |
| chi_pct | 50.6885 | 30.0707 | 51.4800 | 11.8000 | 0.2800 | 99.8800 |
| lag1_bits | -0.0027 | 0.0122 | 0.0128 | 0.0152 | -0.0322 | 0.0259 |
| mean_dt_ms | 101.5758 | 18.3781 | 85.3100 | 84.3100 | 77.4300 | 131.4300 |
| lag1_dt | -0.0017 | 0.0324 | 0.0008 | 0.0131 | -0.0875 | 0.0891 |
| pileup_pct | 4.8535 | 1.0731 | 5.1800 | 5.4700 | 2.6400 | 7.6200 |



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



812 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 | 810 | – |
| n pass | 810 | – |
| n fail | 0 | – |
| count mean | 255.77 | 256.00 |
| count std | 11.43 | 11.31 |


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



**RCT failures logged:** 1



---

## E · Battery history (L3)



86 runs from 2026-05-07T22:45:52Z to 2026-06-20T04:38:39Z.
**32 pass / 54 fail.** Current pass-streak: **3**.

| Metric | Value |
|---|---|
| ent mean | 7.9972 bits/byte |
| ent range | 7.9947 – 7.9977 |
| Rabbit pass-rate | 68.60% |
| Alphabit pass-rate | 91.86% |


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


**Recent runs:**

| ts | ent | chi% | rabbit | alphabit | failures |
|---|---|---|---|---|---|
| 2026-06-18T17:30:35Z | 7.9973 | 65.63 | 1 | 0 | 2 |
| 2026-06-18T17:33:35Z | 7.9973 | 65.63 | 1 | 0 | 2 |
| 2026-06-19T15:54:27Z | 7.9947 | 61.77 | 1 | 1 | 0 |
| 2026-04-30T22:49:08Z | 7.9966 | 62.86 | 1 | 1 | 0 |
| 2026-06-20T04:38:39Z | 7.9966 | 62.86 | 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 (415,168
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.8353 | pass | S_n = -134 |
| Block Frequency | 0.9300 | pass | M=128, N=3243, χ²=3124.97 |
| Runs | 0.0502 | pass | V_n = 208215 (expected 207584) |
| Longest Run of 1s | 0.5207 | pass | M=128, N=49, χ²=4.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.
