Browse documentation
Guides

Experimental physical entropy

Try finite draws from coin observations and bubble timestamps, inspect the experimental code and validation results, and keep physical source assumptions separate from seeded scientific simulation.

Experimental guideImplemented

Part B is experimental. Use the physical observation lab to import coin observations or bubble event timestamps, extract a finite pool of bits, and request integers from that pool. The lab exports a transcript that preserves each draw. This does not change the Aner runtime or the formal random number and seed policy. Part A remains the approach for reproducible scientific simulation.

For an observation based random function, uncertainty must come from the observed physical process. Deterministic software can transform recorded uncertainty; it cannot create new entropy from a seed, clock, counter, hash, or repeatable formula. A computer can acquire physical noise through an appropriate sensor. The relevant distinction is the source and its evidence, rather than whether a computer participates.

No hardware is connected or validated by this implementation. A physical-recording label records the operator's assertion. It does not authenticate an instrument, prove that a coin was tossed or a bubble was detected, or establish independence. Every capture retains zero validated entropy bits. This records that entropy has not been established, rather than declaring that every physical source has no entropy. The supplied examples are deliberately predictable software fixtures.

Two separate experimental paths

PathImplemented behaviorMeaning of the result
Observation draws, aner.observed-random/v1Coin pairs or bubble interval pairs become bits, consumed with an explicit cursor and rejection sampling.Finite observation derived integers, whose randomness depends on the physical source assumptions. No seed or pseudorandom expansion.
Original recording to seed bridgeA completed byte recording is checked, retained and hashed into an explicit seed.Aner draws after that seed are deterministic pseudorandom output. This remains a separate tool, with its original version 1 derivation unchanged.

Neither path is a certified entropy source or cryptographic random number service. Replaying either path repeats the same capture. Reopening a file does not acquire new physical observations.

Try the observation lab

Open the experimental browser lab. Choose coin observations or bubble timestamps, state whether the input is a predictable fixture or an asserted physical recording, and identify the source. Paste the completed observations or load a local text file. Prepare the pool, then request an integer with an exclusive upper bound. The result is in [0, upperExclusive).

The lab processes input locally in the browser. Its code sends no observations to a server, places no observations in URLs, and does not persist them in browser storage. Download the transcript if you need to retain it; it contains the raw observations and source description, so review it before sharing. Ordinary website access still follows the site's privacy policy.

Preparing a pool fixes its input and source description for that session. Changing inputs requires a new preparation. Each draw records its start and end cursor, rejected candidates, bound, result and exhaustion status. A reset or reimport starts a replay of the same data. The session cursor prevents reuse within that session; it is not a global registry of previous recordings.

Read the protocol and the validation record. The recorded fixtures are available in the evidence inventory.

Coin observations

Record every toss in the declared acquisition order. Use H and T, or 0 and 1; H maps to 0 and T maps to 1. Case does not matter. Symbols can touch or be separated by ASCII space, tab, line feed, carriage return, form feed or vertical tab. Other characters, including punctuation and other Unicode whitespace, are errors.

The extractor takes consecutive nonoverlapping pairs:

Observed pairExtracted bit
HT or 010
TH or 101
HH, TT, 00 or 11Discard the pair

An odd final symbol remains unused. This is the von Neumann pair method. For independent identically distributed tosses with a fixed probability of heads, HT and TH have equal probability. That removes a fixed marginal bias under those assumptions. Correlation, changing bias, selective reporting or deterministic patterns can invalidate the assumptions. A manually typed alternating sequence produces predictable bits even though pairs are accepted. Acceptance is not a health certificate.

Before collecting a physical run, declare the toss procedure, recording order, planned sample count and treatment of ambiguous landings. Record failures without replacing inconvenient outcomes. Preserve the original acquisition notes. A source description is an assertion for audit, not software verification that the experiment occurred.

Bubble event timestamps

The bubble adapter imports event times after an external recorder has identified arrivals. It does not detect bubbles in video or connect to a camera, serial port or sensor. Supply nonnegative integer nanoseconds separated by the same ASCII whitespace. Values must be canonical decimal integers, strictly increasing, and at most 9223372036854775807. At least three timestamps are required. Relative nanoseconds from the start of a run avoid unnecessary absolute time range limits. A timestamp unit does not imply that the instrument has nanosecond resolution.

For times t0, t1, t2, ..., form intervals d0=t1-t0, d1=t2-t1, and so on. Compare nonoverlapping interval pairs:

Interval pairExtracted bit
First interval less than second0
First interval greater than second1
Equal intervalsDiscard the pair

An unpaired final interval remains unused. The observation count is the number of timestamps; unusedObservations counts unpaired intervals for this adapter. Ties remain visible in the discard count. The predictable timestamps 0 1 3 6 8 12 16 have intervals 1 2 3 2 4 4, so the extracted pool is 01, with one tied pair discarded. This is a software fixture, not a bubble measurement.

Equal probability of the two interval orderings requires a suitable source model, such as independent identically distributed intervals. Symmetry within each pair alone does not establish independence across pairs. Pump cycles, shared drift, sensor debounce, frame timing, quantization, missed or duplicate events and correlated arrivals can dominate the extracted bits. A clock by itself provides no entropy claim. Preserve the raw sensor or video record, detector version, event selection policy, resolution, apparatus settings, acquisition failures and restart conditions alongside the imported timestamp file.

A useful physical study must declare acquisition duration or count before looking at output, stop visibly on sensor failure, examine raw intervals before extraction, and investigate dependence across separate runs and environmental settings. Live acquisition and source specific startup and continuous health checks remain future work.

Finite integer draws

The observation lab takes extracted bits, an explicit cursor, and upperExclusive as a canonical decimal string from 2 through 9223372036854775808. Results and bounds remain decimal strings in JSON to preserve all integer bits.

Let k be the bit length of upperExclusive - 1. Read k consecutive bits, most significant bit first. Accept a candidate smaller than the bound. Otherwise discard that full candidate and try the next block. Modulo reduction would favor some outputs when the bound is not a power of two, so it is not used.

If fewer than k bits remain, return exhausted: true and value: null. Rejected full blocks stay consumed; a final short tail stays available for a later smaller request. There is no automatic replenishment, seed expansion, hash expansion, operating system generator or PRNG fallback. For example, bits 110001, bound 3, and cursor 0 discard 11, accept 00 as value 0, and finish at cursor 4.

Rejection sampling yields uniform integers conditional on success when its consumed bits are independent and fair, with an acquisition plan independent of desired results. The algorithm does not make correlated or predictable source bits fair. The interface deliberately says observation derived, rather than claiming verified true randomness.

Input is limited to 1 MiB of UTF-8 text and 100,000 observations. Parsing is exact and bounded. Empty or fully discarded coin input cannot supply a draw. These resource and syntax checks establish a well formed protocol input, not physical source quality.

Inspect a coin pair in Aner

Different faces contribute one bit. Equal pairs are discarded. This Aner function shows the extraction rule for a recorded pair.

aner
fn coin_pair(first: String, second: String) -> String {
    if first == "H" && second == "T" { return "0" }
    if first == "T" && second == "H" { return "1" }
    return ""
}
print(coin_pair("H", "T"))

Read the complete historical software validation results for fixture counts and replay checks.

Physical validation remains a separate milestone

Before claiming useful physical entropy, characterize the noise source, digitization, dependence, environmental influence, conservative min entropy, restarts and source specific health tests. NIST SP 800 to 90B separates a noise source, optional conditioning and health testing; it provides a framework, not certification for this prototype. Consult the NIST publication and current errata notice and full recommendation. NIST also explains the limits of statistical tests: tests alone cannot certify a generator.

For repeatable simulation, keep explicit seeds and the formal Part A policy. For a physical study, retain fresh observations and their acquisition evidence. Reusing a capture is useful replay, but it is not another independent physical experiment. Keep these experimental outputs out of cryptographic keys, authentication tokens and any service that promises certified randomness.

Separate recording to seed bridge

The archived seed study exercised capture and replay with a deliberately predictable fixture. Its capture rules and seed derivation are recorded below.

capture requires a new output directory and refuses to replace an existing capture. Its parent directory must exist. The source file must be a completed regular file containing 1,024 through 1,048,576 bytes inclusive. Symbolic links, directories, FIFOs, and device files are rejected. Allocation and byte count are bounded; this is not a wall clock timeout for an unresponsive filesystem. The tool never waits for a stream to fill a requested length.

For a physical experiment, the operator supplies a completed recording from the apparatus. Source identity is limited to 256 characters and acquisition notes to 2,048. Metadata rejects control characters. Keep more detailed instrument records alongside the capture.

The archived study recorded results as JSON and exported verified seeds as decimal integers. Errors return a nonzero exit code, report the cause on stderr, and print no seed on stdout. A capture that fails smoke checks produces no output directory. A failed write removes the partial files when filesystem permissions permit; a missing manifest always means the capture is incomplete. There is no fallback to a clock, operating system generator, built in fixture, or PRNG.

Retention, verification, and use in Aner

Each successful capture retains:

File or manifest fieldMeaning
raw.binExact imported bytes, in order; no filtering or silent replacement.
manifest.jsonVersioned format, UTC import time, supplied source metadata, byte count, raw SHA-256, smoke report, derivation digest, and decimal seed.
source.kindExplicit fixture or physical-recording classification, supplied by the operator.
source.identity_verifiedAlways false; the tool cannot authenticate an apparatus.
health.entropy_credit_bits and conditioning.entropy_credit_bitsAlways 0; no validated entropy claim.

verify and replay read the retained bytes, enforce the same limits, repeat smoke checks, and recompute the raw hash, derivation digest, and seed. Missing files, malformed/oversized manifests, duplicate JSON keys, unknown formats, and inconsistent computed fields fail. The raw filename is fixed; a manifest cannot redirect verification to another path. Corrupt bytes, altered seeds, altered smoke results, and inflated entropy claims fail verification.

SHA-256 checks consistency with the manifest, not authenticity. Someone who can replace both files can construct a different internally consistent capture or relabel its source. Identity, notes, and import time are descriptive metadata without a signature or external trust anchor. Archive the capture and the repository/recorder revisions under the same access and audit controls as the experiment's other inputs.

To use a verified seed, copy the verified decimal seed from the capture into an explicit seed argument, for example tensor.random(rows: 2, cols: 3, seed: VERIFIED_DECIMAL, scale: 1.0). Replace VERIFIED_DECIMAL with that integer before running Aner. Import aner.tensor for this example. Keep the seed and capture hash in the experiment record. APIs that add stage/epoch offsets to a seed can impose further bounds; their documented limits still apply.

Aner output after that seed is deterministic pseudorandom output. Replaying the same capture yields the same seed; requesting replay repeatedly does not acquire fresh physical samples. Changing an instrument label also does not create a new seed. Use a new physical recording when the experiment calls for a new acquisition, and retain it for replay.

Exact version 1 derivation

Prefix the exact recording bytes with the ASCII text Aner.experimental-entropy.seed.v1 followed by one zero byte. Hash the combined bytes with SHA-256. Interpret the first eight digest bytes as an unsigned big endian integer and clear its top bit.

The resulting seed is in [0, 2^63 - 1], which fits Aner's nonnegative Int64 seed contracts. The full SHA-256 derivation digest and raw file SHA-256 are both retained. The seed is a decimal string in JSON to avoid rounding in consumers with only 53 bits of exact integer precision.

This is a deterministic compression/conditioning experiment. Its output has at most 63 bits of capacity, regardless of input length. Hashing does not establish an entropy estimate, recover missing physical entropy, authenticate an instrument, or make deterministic fixtures unpredictable. This construction has not been validated as a NIST entropy source or an approved random bit generator.

What the smoke checks establish

The custom custom-byte-smoke-v1 rules reject a recording when:

  • An identical byte run reaches 32 bytes.
  • One byte value occurs more than one quarter of the time.
  • The fraction of one bits lies outside the inclusive interval [1/4, 3/4].

These fixed prototype thresholds catch some stuck or extremely biased byte streams. They are deliberately not called the NIST Repetition Count Test or Adaptive Proportion Test. They are not calibrated to a physical source's failure modes or assessed entropy, and they may reject useful but biased raw physical measurements. They also accept many predictable inputs: the ascending byte fixture above passes. Neither passing these checks nor a uniform looking histogram proves randomness or independence.

The source's sampling and byte encoding must be understood before interpreting these results. A video container, compressed file, timestamps, or encoded sensor metadata can look varied while reflecting deterministic structure. Do not hide those effects with a hash and then interpret the hash's appearance as evidence about the source.

Bubble experiment investigation

A useful next experiment records an observable such as bubble arrival intervals or image region changes, together with sample times, sensor settings, and the unmodified measurements. Before proposing an extractor, characterize periodic pumping, camera frame synchronization, quantization, shared drift, correlations, restart behavior, sensor saturation, and missing samples. Device specific start up and ongoing fault checks belong before conditioning.

An experimental adapter should have an explicit acquisition duration/byte limit, stop on disconnect or sensor fault, preserve acquisition failures, and emit a completed file only after a successful bounded capture. A separate repeatable digitization step should document exactly how raw measurements become bytes. Preserve the original measurements as well as the byte file consumed by this tool. No live acquisition adapter is implemented or claimed here. The separate timestamp importer described above operates only after an external recorder completes acquisition.

Before claiming useful physical entropy, investigate the source model, environmental effects, dependence, conservative min entropy estimation, restart behavior, and source specific health tests. NIST SP 800 to 90B separates noise sources, optional conditioning, and health testing; source validation requires evidence beyond simple statistical checks. Its sections 2.2, 3, 4, and 6 provide the reference framework, not a certification conferred on this prototype. See the NIST publication and current errata notice and full SP 800 to 90B. The source must provide uncertainty before deterministic conditioning can preserve or concentrate it.

This experiment is for scientific investigation and reproducible seed import. Do not use its seeds or Aner's scientific PRNG output for cryptographic keys, authentication tokens, or a certified randomness service.

Recorded software validation

The validation record documents the fixtures, regression checks and measured results.

Aner documentation · Reference and guides