# Geiger TRNG randomness analysis

**Generated:** 2026-05-14T20:05:09Z (duration 28.07 s)
**Git SHA:** 1d4c8acd17d8c829f6089a5c85ba1dc5b215bd90  ·  **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 | 7845395 |
| `metrics.tsv` rows | 262 |
| `health.csv` rows | 7071 |
| `battery_history.tsv` rows | 9 |

---

## 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 | 7,845,395 |
| mean Δt | -3405.9 µs |
| median Δt | 54229.7 µs |
| min Δt | -598073912705.4 µs |
| max Δt | 14436858 µs |
| estimated rate | 0.00 Hz (0 CPM) |

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

**Pile-up cluster** (Δt < 5000 µs, the GM tube + NE555 recovery floor):
608111 of 7,845,395
(7.75%).


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

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


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



262 samples over the trailing 24.0 h
(2026-05-13T02:05:53Z → 2026-05-14T02:01:23Z).

| Metric | mean | std | first | last | min | max |
|---|---|---|---|---|---|---|
| bias | 0.0015 | 0.0056 | -0.0059 | -0.0092 | -0.0148 | 0.0155 |
| ent_bpb | 7.8057 | 0.0170 | 7.8130 | 7.8126 | 7.7475 | 7.8450 |
| chi_pct | 46.0529 | 28.1326 | 49.7100 | 59.4100 | 0.0600 | 96.5500 |
| lag1_bits | -0.0007 | 0.0116 | 0.0034 | -0.0017 | -0.0330 | 0.0300 |
| mean_dt_ms | 75.6089 | 2.2102 | 76.7900 | 76.1200 | 69.4900 | 81.9900 |
| lag1_dt | -0.0023 | 0.0306 | -0.0018 | 0.0042 | -0.0773 | 0.0787 |
| pileup_pct | 9.1824 | 0.9791 | 9.2800 | 9.6700 | 6.5400 | 12.6000 |



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



7071 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 | 7067 | – |
| n pass | 7067 | – |
| n fail | 0 | – |
| count mean | 256.38 | 256.00 |
| count std | 11.17 | 11.31 |


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



**RCT failures logged:** 3



---

## E · Battery history (L3)



9 runs from 2026-05-07T22:45:52Z to 2026-04-30T22:49:10Z.
**9 pass / 0 fail.** Current pass-streak: **9**.

| 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-05-10T02:03:30Z | 7.9971 | 31.76 | 1 | 1 | 0 |
| 2026-05-11T02:04:26Z | 7.9973 | 64.23 | 1 | 1 | 0 |
| 2026-05-12T02:00:31Z | 7.9969 | 15.79 | 1 | 1 | 0 |
| 2026-05-13T02:00:26Z | 7.9972 | 51.96 | 1 | 1 | 0 |
| 2026-04-30T22:49:10Z | 7.9970 | 19.58 | 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.0339 | pass | S_n = 1536 |
| Block Frequency | 0.4357 | pass | M=128, N=4096, χ²=4110.00 |
| Runs | 0.6923 | pass | V_n = 262285 (expected 262142) |
| Longest Run of 1s | 0.6368 | pass | M=128, N=49, χ²=3.41 |


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