File size: 2,302 Bytes
d36206f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | # Thermodynamic Feedback Loop β recreation
C11 recreation of the SEIT research item:
> ERE constraint friction feeds back into ANU sampling. High friction
> (many failures) = hot system = contracted sampling window toward
> sovereign center. Low friction = cool system = full stochastic range.
> Haskell proves lo < hi is an invariant, not an assertion. The system
> reshapes its own quantum source.
## Mapping to the original
| SEIT concept | Recreation |
|---|---|
| ANU quantum source | `entropy_draw()` β pluggable; ships with xorshift64*, ANU QRNG hooks in at one function |
| ERE constraint battery | 4 forbidden zones; a sample fails every zone it lands in |
| Friction | EWMA (Ξ±=0.10) of the per-decision failure rate β a decision violating any constraint is a friction event |
| Hot β contract to sovereign center | `window_adjust()`: `lo,hi` pulled toward 0.5 β friction |
| Cool β full stochastic range | `window_adjust()`: `lo,hi` relaxed toward `[0,1]` β (1βfriction) |
| `lo < hi` proved, not asserted | Windows can only be built via `window_make()` / `window_adjust()`, which repair a collapsed window by construction (+ debug `assert`) |
The driver runs three phases β calm β thermal shock β calm β so both
halves of the description are visible: high friction contracts the
window toward center, low friction lets it re-expand. The loop closes
through the sample itself: a wide window lands in forbidden zones β
friction rises β window contracts toward center β failures starve β
friction decays β window re-expands. The result is homeostasis β the
window breathes instead of settling.
## Build & run
```sh
make
./thermodynamic_loop # default seed
./thermodynamic_loop 12345 # custom seed
```
Sample output (default seed): calm phase runs COOL with a wide window;
the thermal shock drives friction to ~0.68 (HOT) and the window
contracts from width 0.66 to 0.25 around the sovereign center; when the
shock ends, friction decays and the window re-expands. The invariant
`lo < hi` holds by construction on every tick.
## Going live on ANU
Replace the body of `entropy_draw()` with a fetch from
`https://qrng.anu.edu.au/API/jsonI.php?length=1&type=uint8` scaled to
`[0,1)`. Nothing downstream changes β the loop is source-agnostic.
|