# Geiger TRNG randomness analysis

**Generated:** 2026-05-28T03:03:56Z (duration 12.93 s)
**Git SHA:** edf8f63a7d099d1f03f94f07b3c5bd1c3383eba0  ·  **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 | 34295 |
| `metrics.tsv` rows | 62 |
| `health.csv` rows | 14975 |
| `battery_history.tsv` rows | 36 |

---

## 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,295 |
| mean Δt | 104970.6 µs |
| median Δt | 72658.8 µs |
| min Δt | 245.7 µs |
| max Δt | 1151487 µs |
| estimated rate | 9.53 Hz (572 CPM) |

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

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


![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,775 (49.930%) | 50% |
| bias | -0.00070 | 0 |
| bias 1σ (sampling) | ±0.00069 | – |
| Shannon entropy | 7.9975 bits/byte | 8.0 |
| χ² statistic | 224.49 | ~255 (df) |
| χ² percentile | 91.61% | 5–95% |

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


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

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

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




---

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



62 samples over the trailing 24.0 h
(2026-05-27T03:05:41Z → 2026-05-28T03:01:48Z).

| Metric | mean | std | first | last | min | max |
|---|---|---|---|---|---|---|
| bias | -0.0005 | 0.0058 | 0.0039 | -0.0015 | -0.0161 | 0.0095 |
| ent_bpb | 7.8123 | 0.0192 | 7.8063 | 7.8292 | 7.7756 | 7.8640 |
| chi_pct | 51.1763 | 30.6171 | 38.4700 | 90.0200 | 0.7700 | 99.9800 |
| lag1_bits | -0.0049 | 0.0110 | -0.0182 | -0.0223 | -0.0335 | 0.0184 |
| mean_dt_ms | -2477.2044 | 20162.4665 | 99.0000 | 107.8400 | -159951.1000 | 111.3800 |
| lag1_dt | 0.0037 | 0.0323 | 0.0102 | -0.0087 | -0.0677 | 0.0725 |
| pileup_pct | 4.5145 | 0.8819 | 4.0000 | 4.9800 | 3.1200 | 9.7700 |



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



14975 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 | 14969 | – |
| n pass | 14969 | – |
| n fail | 0 | – |
| count mean | 256.63 | 256.00 |
| count std | 11.29 | 11.31 |


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



**RCT failures logged:** 5



---

## E · Battery history (L3)



36 runs from 2026-05-07T22:45:52Z to 2026-05-28T02:04:11Z.
**29 pass / 7 fail.** Current pass-streak: **12**.

| Metric | Value |
|---|---|
| ent mean | 7.9971 bits/byte |
| ent range | 7.9965 – 7.9977 |
| Rabbit pass-rate | 83.33% |
| Alphabit pass-rate | 86.11% |


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


**Recent runs:**

| ts | ent | chi% | rabbit | alphabit | failures |
|---|---|---|---|---|---|
| 2026-05-26T02:03:54Z | 7.9975 | 90.18 | 1 | 1 | 0 |
| 2026-05-27T02:03:40Z | 7.9977 | 98.59 | 1 | 1 | 0 |
| 2026-04-30T22:49:08Z | 7.9974 | 79.33 | 1 | 1 | 0 |
| 2026-05-27T22:22:58Z | 7.9974 | 80.66 | 1 | 1 | 0 |
| 2026-05-28T02:04:11Z | 7.9975 | 87.56 | 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.3081 | pass | S_n = -738 |
| Block Frequency | 0.3055 | pass | M=128, N=4096, χ²=4141.53 |
| Runs | 0.3526 | pass | V_n = 262480 (expected 262143) |
| Longest Run of 1s | 0.3630 | pass | M=128, N=49, χ²=5.45 |


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