# Geiger TRNG randomness analysis

**Generated:** 2026-05-15T12:32:01Z (duration 36.86 s)
**Git SHA:** 5931c7c934c1c9d56631aec59553c5d8248af279  ·  **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 | 35983 |
| `metrics.tsv` rows | 180 |
| `health.csv` rows | 7602 |
| `battery_history.tsv` rows | 16 |

---

## 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,983 |
| mean Δt | 100047.2 µs |
| median Δt | 69559.6 µs |
| min Δt | 78.8 µs |
| max Δt | 1038245 µs |
| estimated rate | 10.00 Hz (600 CPM) |

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

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


![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,550 (50.077%) | 50% |
| bias | +0.00077 | 0 |
| bias 1σ (sampling) | ±0.00069 | – |
| Shannon entropy | 7.9970 bits/byte | 8.0 |
| χ² statistic | 272.83 | ~255 (df) |
| χ² percentile | 21.15% | 5–95% |

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


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

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

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




---

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



180 samples over the trailing 24.0 h
(2026-05-14T20:07:07Z → 2026-05-15T12:31:39Z).

| Metric | mean | std | first | last | min | max |
|---|---|---|---|---|---|---|
| bias | 0.0003 | 0.0064 | -0.0087 | -0.0016 | -0.0123 | 0.0161 |
| ent_bpb | 7.8067 | 0.0169 | 7.7943 | 7.7796 | 7.7396 | 7.8419 |
| chi_pct | 46.7971 | 27.1712 | 31.2700 | 6.0100 | 0.0400 | 97.8200 |
| lag1_bits | 0.0023 | 0.0108 | 0.0010 | -0.0194 | -0.0266 | 0.0294 |
| mean_dt_ms | 91.3969 | 109.2169 | 18.7600 | 96.6200 | -1364.6100 | 110.0400 |
| lag1_dt | -0.0006 | 0.0304 | 0.0705 | -0.0115 | -0.0787 | 0.0729 |
| pileup_pct | 5.6571 | 3.5208 | 36.0400 | 5.6600 | 3.1200 | 39.0600 |



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



7602 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 | 7598 | – |
| n pass | 7598 | – |
| n fail | 0 | – |
| count mean | 256.39 | 256.00 |
| count std | 11.18 | 11.31 |


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



**RCT failures logged:** 3



---

## E · Battery history (L3)



16 runs from 2026-05-07T22:45:52Z to 2026-05-15T02:02:12Z.
**15 pass / 1 fail.** Current pass-streak: **3**.

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


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


**Recent runs:**

| ts | ent | chi% | rabbit | alphabit | failures |
|---|---|---|---|---|---|
| 2026-04-30T22:49:08Z | 7.9969 | 14.04 | 1 | 1 | 0 |
| 2026-05-14T20:45:43Z | 7.9969 | 13.86 | 1 | 1 | 1 |
| 2026-04-30T22:49:13Z | 7.9970 | 21.93 | 1 | 1 | 0 |
| 2026-05-14T21:25:50Z | 7.9970 | 22.34 | 1 | 1 | 0 |
| 2026-05-15T02:02:12Z | 7.9970 | 26.30 | 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.2621 | pass | S_n = 812 |
| Block Frequency | 0.3234 | pass | M=128, N=4096, χ²=4136.94 |
| Runs | 0.1152 | pass | V_n = 261573 (expected 262143) |
| Longest Run of 1s | 0.8752 | pass | M=128, N=49, χ²=1.81 |


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