portal-rng: 9-cell cross-impl stream matches independent Python baseline

Closes tickets 0001 (portal-rng) and 0002 (os-entropy-seed).

Ticket 0001 goal 4 called for proof that seeding with k, drawing N,
saving, clearing, resuming in any impl, and drawing M more produces a
full stream matching a single-process Python baseline bit-for-bit.
Prior tests/portal-cross-test.sh exercised producer-consumer agreement
but used a producer-side self-computed baseline; it did not compare
against an independent Python run that never saves or resumes.

tests/portal-rng-cross-test.sh computes a single-process Python baseline
once (seed=42, N+M=10 draws, no portal), then runs all 9 producer x
consumer cells (Python, C, asm each side) and checks that producer's
first N plus consumer's M equals the independent baseline. All 12
assertions pass.

Wired into make test-all. Ticket status updated to resolved on both
0001 and 0002 with dated one-line resolution notes.
This commit is contained in:
russell@unturf.com 2026-04-23 20:19:16 -04:00
parent 9dee0d02ee
commit d2866f486d
4 changed files with 156 additions and 5 deletions

View file

@ -1,9 +1,10 @@
# 0001 — Portal preserves RNG state across processes
**Status:** open
**Status:** resolved
**Reporter:** Zoe (via fox)
**Implementer:** blackops
**Opened:** 2026-04-20
**Resolved:** 2026-04-24 — xoshiro256\*\* shipped in Python, C, asm; portal round-trips RNG state; `tests/portal-rng-cross-test.sh` proves all 9 producer×consumer cells reproduce the independent single-process Python baseline bit-for-bit. Wired into `make test-all`.
## Problem

View file

@ -1,9 +1,10 @@
# 0002 — `(random-seed-from-os!)` pulls kernel entropy
**Status:** open
**Status:** resolved
**Reporter:** fox (response to 0001 follow-up)
**Implementer:** blackops
**Opened:** 2026-04-20
**Resolved:** 2026-04-24 — `(random-seed-from-os!)` shipped in all three impls, reads 8 LE bytes from `/dev/urandom`, fails loud on short read. Entropic + replay checks in `tests/functional.lsp` and `asm/test.sh`; OS-seeded state plugs cleanly into the 0001 portal path.
## Problem