Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/patches/eddcda2e85970148 # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers ## feat(physics0): handwritten .om deterministic stream primitive and consumer merged `eddcda2e85970148` #692 · opened 2026-10-24 14:09 UTC · closed 2026-10-24 14:33 UTC · merged 2026-10-24 14:33 UTC Imported from GitHub aien-dev/omega-mv#692, by drakestapleton Labels: alpha-candidate, qualification-pending Base `72dd67769e62b2c29d550d93d0ed9234bc63ce09` · Head `f54f7da5fcea120c309babfc5a153964d330b0dd` Merged on GitHub as `2cfe7855fcf5d614a1e7744e7fc924bc9ecf69a9`; reachable from main `c7acd2607139eedfabeac16b6042cefe8ede431f` (observed 2026-11-18T16:35:45Z) drakestapleton wrote on 2026-10-24 14:09 UTC ## Owner-approved Alpha publication This is research-source publication, not qualified release. Native compilation/execution and signed Spark verification remain NOT_RUN. The owner explicitly approved this exception on 2026-10-24 in reply to the exact #691/#692 merge question. User-requested bounded C-to-.om implementation, following the source-backed inventory in #691. Ports the deterministic stream slice of src/physics0/pd0_rng.c: FNV-1a64 tag hashing, SplitMix64 state/next and uniform micro-units. Adds a bounded little-endian stdin/stdout consumer and handwritten .om known-answer/refusal tests. No generated C, source-extension rename, shared compiler edit or hidden runtime. Unsigned wrapping is implemented explicitly with bounded limbs because seeded arithmetic traps overflow. Tags are an explicit 0..256 nonzero-byte subset, not a claim of complete C-string API compatibility. C world/planner/scorer/fixed-point/noise callers are NOT switched or deleted. This is a candidate successor slice, not whole PD0 migration or production qualification. PASS (host/source evidence): actual pinned C reference versus checked-integer model, 10,000 add/multiply pairs, 1,000 tags and 32,000 sequential words/state comparisons; all 38 committed KAT next-word constants; independent 100,000-pair/1,500-tag/48,000-word-state comparison; source review caught and fixed overlong globals, reserved-word identifier and added mixed-byte endian control. Whitespace, documented shell syntax and pinned crumb verification: 157 current. NOT_RUN: .om compilation, compiled unit/consumer positive/refusal/I/O/mutation tests, compiler regression/security gates, signed Spark qualification, real production consumer cutover. No compiled/native PASS is claimed. Existing compiler owner profile pinned at #676 head `8921a65204c2daf6d66a61813e89854c145713da`; reconstruction and fail-closed replay instructions in seed/physics0/README.md. Refs #599, aien-dev/aien-architecture-mv#300. New first-party implementation and tests are .om. Historical evidence and C consumers remain untouched pending actual qualification. Owner explicitly approved merging #691 and #692 into main before signed Spark verification, as visibly unqualified Alpha work. No deployment, C deletion or test result relabeling is authorized. Labels remain alpha-candidate and qualification-pending. Integration update: current main (#691) was merged into this branch. Generated root metadata was regenerated, both attribution entries preserved, and README links this explicitly unqualified candidate. All five seed/physics0 files are byte-identical to reviewed head `75e7f3d6891b252fe5e9726e40d2b74a189cd974`. Pinned crumbs157 current and diff check pass at integration head `f54f7da5fcea120c309babfc5a153964d330b0dd`; fresh native tests remain NOT_RUN. ### Fetch it A git bundle of the pull request's head, 9387 bytes. ``` curl -fsSL https://interplane.io/drakestapleton/omega-mv/patches/eddcda2e85970148.bundle -o eddcda2e85970148.bundle git fetch eddcda2e85970148.bundle refs/pull/692/head ``` Raw bundle · Diff ### Provenance This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record: ``` github-import 1 aien-dev/omega-mv 692 f54f7da5fcea120c309babfc5a153964d330b0dd ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"omega-mv","number":692,"url":"https://github.com/aien-dev/omega-mv/pull/692","export_sha256":"7319147b350ad908bf0b731068ec3be7b8dee848041dc862f71455e8e4680140","imported_utc":"2026-11-18T16:35:45Z"} ``` ### Changes ``` diff --git a/.crumb b/.crumb index cf561dfaa..558eef4b1 100644 --- a/.crumb +++ b/.crumb @@ -96,14 +96,14 @@ } ], "children_root": "sha256:07ec46e75124b276e132d19023359a448b204946365dc45c197d7c1086853b7b", - "compiled_at": "2026-10-24T14:00:34Z", + "compiled_at": "2026-10-24T14:31:12Z", "compiler": "crumb-compile/1", - "digest": "sha256:8be2b152bb691a79f2d02e33194517b9c5f4932969470e58706c065360f86833", + "digest": "sha256:a3e777cdea4c4d05087bb6790a9114cd4d76b8f7b7639a9bdbd44e584454aa05", "evidence_files": 11127, "evidence_root": "sha256:4528085ec1661c442b64fb5dc8def65067ea2620ff88e42bcf52d58b7642ea6e", - "files": 14103, - "generated_at_commit": "d863780eb42bd940349eba61a3d1c78b0b819941", - "source_tree": "sha256:973e5435caf877b7e187902deea9e180f165d6d109e1e5c8889ba468bd514a22" + "files": 14108, + "generated_at_commit": "75e7f3d6891b252fe5e9726e40d2b74a189cd974", + "source_tree": "sha256:5e530ef9e76ec9eb59aded7dd44f0154d44cd3bf1f139ee695150c4cc7e3ed08" }, "owner_lane": "", "provenance": { diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 136921230..56c6af878 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -5,6 +5,7 @@ Every model below did real work. A model is listed only for work it did. The orc | Model | What it did | |---|---| +| Codex | Handwritten bounded PD0 stream primitive and binary consumer in Omega, native tests, and host-reference/source review (native execution NOT_RUN) | | Codex | Current .om front-page status and source-backed C migration inventory | | Codex | BUILD receipt cleanliness enforcement and optional diagnostic pointer regression fixes | | Claude Opus 5.5 | Numeric GB10 operations (LDS_STS, REDUCE_SUM), the independent CPU oracle, the Gate 5 qualifier and its receipts, and the fixes from review | diff --git a/README.md b/README.md index bd9f0fd90..c337c6eeb 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ - [The Omega programme: seed to model](https://github.com/aien-dev/omega-mv/issues/599) - [Seeded compiler/native-host candidate](https://github.com/aien-dev/omega-mv/pull/678) and [checked device/mapping candidate](https://github.com/aien-dev/omega-mv/pull/676) - [Remaining C source/header inventory](docs/migration/C-TO-OM-INVENTORY.md) +- [Experimental `.om` deterministic-stream successor](seed/physics0/README.md): source/host checks passed; native compilation and execution NOT_RUN. - [Alpha model/platform qualification](https://github.com/aien-dev/aien-architecture-mv/issues/305) ### Why GitHub still shows C diff --git a/seed/physics0/README.md b/seed/physics0/README.md new file mode 100644 index 000000000..331567e50 --- /dev/null +++ b/seed/physics0/README.md @@ -0,0 +1,138 @@ +# PD0 deterministic streams in Omega + +This is a handwritten, additive `.om` successor for the **stream primitive +slice** of [`src/physics0/pd0_rng.c`](../../src/physics0/pd0_rng.c): FNV-1a64 tag +hashing, SplitMix64 state/next, stream initialization, and uniform micro-units. +`stream.om` is an actual native consumer of that primitive, not generated C or +a source-extension rename. It is designed to run without a C runtime when compiled with the +pinned seeded compiler below. Native compilation/execution of this candidate +is **NOT_RUN**; that runtime property still requires qualification. + +The C world, planner, scorer, fixed-point arithmetic, constant sampling and +noise consumers are **not switched or deleted**. This is not a whole PD0 port, +a drop-in C ABI, a cryptographic RNG, or a production qualification claim. +The existing PD0 owner and tests remain authoritative for those consumers. + +## Contract + +- `rngtag[256]` holds bytes. `rnginit(seed, n)` accepts `n` in 0..256 and exactly + `n` **nonzero** bytes. Empty tags are valid. High-bit bytes are unsigned. + These valid tags match the C string consisting of those bytes plus a trailing + NUL. Longer strings and embedded NULs are deliberately outside the bounded + adapter contract, not claimed to have the C function's truncation behavior. +- Initialization returns 0 and sets `rngstate[0] = seed XOR FNV1a64(tag)`, or + returns 2 on a bad tag without changing the prior state. The 256-byte buffer + is caller-owned; its unused tail is ignored. One global stream is supported; + it is not reentrant or thread-safe. All 64-bit seeds are accepted. +- `rngnext()` increments state by `0x9e3779b97f4a7c15` modulo 2^64, stores that + incremented state, then applies the exact existing SplitMix64 mixing steps. + `rnguniform()` consumes exactly one next word and returns word `% 1000001`. +- Omega's arithmetic must not accidentally replace C unsigned wrapping with + overflow traps: `rngadd` uses 32-bit halves, `rngmul` four base-65536 columns. + Addition intermediates are below 2^34. A multiplication column contains at + most four products <=65535^2 plus carry <262144, hence is below 2^35. Masked + digits alone are shifted into their final positions; no shift is by 64. +- `request.om` adapts a request of **8 little-endian seed bytes followed by + 0..256 nonzero tag bytes**. `rngreqok(n)` validates length before indexing and + preserves stream state on refusal. No terminator, count, or newline is sent. +- `stream.om` reads that request through EOF and emits **eight consecutive + little-endian 64-bit words** (64 bytes). It handles partial reads/writes; + a 265th byte detects oversized requests. Exit 0 means success, 2 malformed + or oversized input, 4 I/O error. Malformed input produces no output. An I/O + error during output can leave a partial response; it is not transactional. + +## Source and compiler pins + +C baseline and PR base: `d863780eb42bd940349eba61a3d1c78b0b819941`. +`src/physics0/pd0_rng.c` SHA-256: +`957efcd03de3d3153e4e46347969bd3649ebc84af95cf9f2e8c616a4e20ebf24`. +The contract is also recorded in `src/physics0/pd0_rng.h`; generators remain +isolated in `pd0_gen.c` and are not linked into this work. + +Use the existing compiler owner's Linux AArch64 seed profile, not an old C +frontend or a new compiler implementation: + +- Repository commit `8921a65204c2daf6d66a61813e89854c145713da` (PR #676). +- `seed/omc/omc.om` Git blob `8e73c4f2c1d6736222f27ecd6dfdf796c27b4213`. +- Compiler source SHA-256 + `fe67a0c31e42fcf6d86fce786b0a16b46a95daf3c7da1af7b6974df68ecfe400`. +- Follow that checkout's `seed/README.md`, `seed/host/README.md`, and existing + `seed/omega-from-seed.sh` reconstruction/fixpoint procedure in a disposable + compiler checkout. The initial loader is the existing documented exception; + no C compiler, assembler or linker builds this candidate. + +This source uses only integer scalars, bounded global byte/word arrays, +functions, loops, shifts, and read/write. Global/text/local identifiers stay +within eight bytes. It adds no host operations, shared compiler changes, +compiler binaries or bootstrap scripts to main. A correctly rebuilt/pinned +compiler is a prerequisite, not supplied or certified by this PR. + +## Native qualification procedure (NOT_RUN here) + +On authorized Linux AArch64 hardware, after checking the compiler pin and +successfully reconstructing the existing compiler, set `OMC` to its absolute +`seed/out/omc` path. From this candidate checkout, compose the handwritten +sources in dependency order into a disposable directory: + +```sh +( +set -eu +[ "$(uname -m)" = aarch64 ] +: "${OMC:?Set OMC to the qualified pinned compiler's absolute path}" +B=$(mktemp -d) +cat seed/physics0/rng.om seed/physics0/request.om seed/physics0/unit.om > "$B/unit.om" +"$OMC" < "$B/unit.om" > "$B/unit" +LC_ALL=C readelf -h "$B/unit" > "$B/unit.elf" +grep -q 'Class:.*ELF64' "$B/unit.elf" +grep -q 'Machine:.*AArch64' "$B/unit.elf" +grep -q 'Type:.*EXEC' "$B/unit.elf" +chmod +x "$B/unit" +"$B/unit" # require exit 0, not just successful compilation +cat seed/physics0/rng.om seed/physics0/request.om seed/physics0/stream.om > "$B/stream.om" +"$OMC" < "$B/stream.om" > "$B/stream" +LC_ALL=C readelf -h "$B/stream" > "$B/stream.elf" +grep -q 'Class:.*ELF64' "$B/stream.elf" +grep -q 'Machine:.*AArch64' "$B/stream.elf" +grep -q 'Type:.*EXEC' "$B/stream.elf" +chmod +x "$B/stream" +printf 'Candidate test artifacts: %s\n' "$B" +) +``` + +Stop on any failing command; do not run a partially emitted executable. The +shell here only composes/launches files, not implements the primitive. No new +shell/Python/C automation is added. The current x86_64 authoring environment +has **not** run these commands or any bundled AArch64 program. + +`unit.om` checks raw state 0/max (including increment wrap), modular carries +and products, both seed extremes for empty/ASCII/high-bit/capacity tags, +38 fixed C next-word answers, state advancement, one-draw uniform behavior, +refusal-state preservation, short/oversized/NUL requests, a mixed-byte seed, +and response packing with independently fixed first-word bytes. + +Before qualification, also exercise the compiled stream via real stdin/stdout: +empty/7-byte requests -> exit 2 and zero bytes; 8 zero bytes -> exit 0 and 64 +bytes beginning `30 ff a4 6b 01 7c 81 c3`; all-FF seed with 256 `a` bytes -> +exit 0; a 265-byte request or NUL tag -> exit 2 and zero bytes. Check interrupted +and partial I/O, and descriptor failures (exit 4), under the existing owner's +native I/O test facilities. In a disposable source copy, alter the increment, +first FNV multiplier, or seed byte order separately; the unchanged unit test +must return nonzero. Retain exact source/compiler hashes and outcomes. These +native positive, refusal, I/O and mutation runs remain **NOT_RUN**. + +## Checks actually performed + +On x86_64, the unmodified pinned C source was compiled with GCC solely as a +disposable reference. A separate checked-integer host model of the handwritten +limb formulas matched 10,000 modular add/multiply pairs, 1,000 nonzero byte tags +of lengths 0..256, and 32,000 sequential C words **and states**. All 38 committed +next-word constants were compared with that actual C baseline; identifier +bounds and whitespace checks passed. The disposable model/harness is not a +product implementation, compiler, or substitute for running `.om`. + +Independent review also compared 100,000 arithmetic pairs and 48,000 words and +states across 1,500 tags against a separately GCC-built C baseline. This is +source/model evidence only. Native compile, native unit/consumer execution, +compiler regression gates, signed hardware evidence, and production-consumer +qualification are **NOT_RUN**. Do not delete C or claim migration completion +until the existing owners qualify and switch the real consumers. diff --git a/seed/physics0/request.om b/seed/physics0/request.om new file mode 100644 index 000000000..cb93d5c5c --- /dev/null +++ b/seed/physics0/request.om @@ -0,0 +1,29 @@ +note SPDX-License-Identifier: Apache-2.0 +note Binary request adapter for the native stream consumer, also exercised by unit.om. +global rngreq uchar 265 +global rngout uchar 64 + +fn rngreqok n ulong to int +if or lt n 8 gt n 264 +ret 2 +end +seed = ulong 0 +for i ulong 8 +seed = or seed shl ulong get rngreq i mul i 8 +end +size = sub n 8 +for i ulong size +put rngtag i get rngreq add i 8 +end +ret rnginit seed size +end + +fn rngpack to void +for word ulong 8 +v = rngnext +for octet ulong 8 +put rngout add mul word 8 octet uchar and shr v mul octet 8 255 +end +end +ret +end diff --git a/seed/physics0/rng.om b/seed/physics0/rng.om new file mode 100644 index 000000000..a1496c1d6 --- /dev/null +++ b/seed/physics0/rng.om @@ -0,0 +1,61 @@ +note SPDX-License-Identifier: Apache-2.0 +note Handwritten PD0 stream primitive. See README.md for the bounded byte-tag API. +note Single stream, explicit global storage; no allocator, C call or implicit wrapping. +global rngtag uchar 256 +global rngstate ulong 1 + +note Low 64 bits of addition: each intermediate is less than 2^34. +fn rngadd a ulong b ulong to ulong +lo = add and a 4294967295 and b 4294967295 +hi = add add shr a 32 shr b 32 shr lo 32 +ret or shl and hi 4294967295 32 and lo 4294967295 +end + +note Low 64 bits of multiplication in base 65536. +note Each column has at most four 16-bit products plus carry, below 2^35. +note Only the masked digit is shifted, so every shift fits ulong exactly. +fn rngmul a ulong b ulong to ulong +out = ulong 0 +carry = ulong 0 +for k ulong 4 +sum = carry +for j ulong add k 1 +av = and shr a mul j 16 65535 +bv = and shr b mul sub k j 16 65535 +sum = add sum mul av bv +end +out = or out shl and sum 65535 mul k 16 +carry = shr sum 16 +end +ret out +end + +note Return 2 for capacity or embedded NUL, preserving state on refusal. +note Valid tags are exactly n nonzero bytes, equivalent to a C tag plus terminator. +fn rnginit seed ulong n ulong to int +if gt n len rngtag +ret 2 +end +hash = ulong 14695981039346656037 +for i ulong n +c = get rngtag i +if eq c uchar 0 +ret 2 +end +hash = rngmul xor hash ulong c 1099511628211 +end +put rngstate 0 xor seed hash +ret 0 +end + +fn rngnext to ulong +state = rngadd get rngstate 0 11400714819323198485 +put rngstate 0 state +z = rngmul xor state shr state 30 13787848793156543929 +z = rngmul xor z shr z 27 10723151780598845931 +ret xor z shr z 31 +end + +fn rnguniform to ulong +ret rem rngnext 1000001 +end diff --git a/seed/physics0/stream.om b/seed/physics0/stream.om new file mode 100644 index 000000000..777b17597 --- /dev/null +++ b/seed/physics0/stream.om @@ -0,0 +1,34 @@ +note SPDX-License-Identifier: Apache-2.0 +note Concatenate rng.om, request.om then this consumer before compilation. +note Request: 8-byte little-endian seed, then 0..256 nonzero tag bytes, then EOF. +note Response: eight successive little-endian 64-bit words, exactly 64 bytes. +note Exit 2 malformed/capacity, 4 I/O failure; no output before validation. +fn main to int +used = ulong 0 +reading = true +while and reading lt used len rngreq +n = read 0 rngreq used sub len rngreq used +if lt n 0 +ret 4 +end +if eq n 0 +reading = false +else +used = add used ulong n +end +end +status = rngreqok used +if ne status 0 +ret status +end +rngpack +sent = ulong 0 +while lt sent len rngout +n = write 1 rngout sent sub len rngout sent +if le n 0 +ret 4 +end +sent = add sent ulong n +end +ret 0 +end diff --git a/seed/physics0/unit.om b/seed/physics0/unit.om new file mode 100644 index 000000000..81227cf71 --- /dev/null +++ b/seed/physics0/unit.om @@ -0,0 +1,339 @@ +note SPDX-License-Identifier: Apache-2.0 +note Concatenate rng.om, request.om, unit.om. Exit 0 only if all checks pass. +note Expected values from the unmodified C baseline at d863780eb42bd940349eba61a3d1c78b0b819941. +text world "world" +fn main to int +note Modular arithmetic carries and maximum products. +if ne rngadd 18446744073709551615 1 0 +ret 1 +end +if ne rngadd 18446744073709551615 18446744073709551615 18446744073709551614 +ret 2 +end +if ne rngmul 18446744073709551615 18446744073709551615 1 +ret 3 +end +if ne rngmul 4294967296 4294967296 0 +ret 4 +end +if ne rngmul 18446744073709551615 65536 18446744073709486080 +ret 5 +end +note Raw SplitMix state extremes, including increment wraparound. +put rngstate 0 0 +if ne rngnext 16294208416658607535 +ret 6 +end +if ne get rngstate 0 11400714819323198485 +ret 7 +end +put rngstate 0 18446744073709551615 +if ne rngnext 16490336266968443936 +ret 8 +end +if ne get rngstate 0 11400714819323198484 +ret 9 +end +note Empty tag, zero seed, eight consecutive outputs and post-draw state. +if ne rnginit 0 0 0 +ret 10 +end +if ne get rngstate 0 14695981039346656037 +ret 11 +end +if ne rngnext 14087677454934409008 +ret 12 +end +if ne rngnext 1156539639830188822 +ret 13 +end +if ne rngnext 6107907394010225435 +ret 14 +end +if ne rngnext 3199123669689638002 +ret 15 +end +if ne rngnext 7288325018142838421 +ret 16 +end +if ne rngnext 17866453389242143151 +ret 17 +end +if ne rngnext 8177402106386418192 +ret 18 +end +if ne rngnext 7327937117123367831 +ret 19 +end +if ne get rngstate 0 13667979225384485837 +ret 20 +end +if ne rnginit 18446744073709551615 0 0 +ret 21 +end +if ne rngnext 3526150024844925518 +ret 22 +end +if ne rngnext 11731478886250893314 +ret 23 +end +note One byte and multibyte ASCII, both seed extremes. +put rngtag 0 97 +if ne rnginit 0 1 0 +ret 24 +end +if ne get rngstate 0 12638187200555641996 +ret 25 +end +if ne rngnext 6857225946766476583 +ret 26 +end +if ne rngnext 18412106973715859535 +ret 27 +end +if ne rnginit 18446744073709551615 1 0 +ret 28 +end +if ne rngnext 15365624696913284058 +ret 29 +end +if ne rngnext 14384683269263029524 +ret 30 +end +for i ulong len world +put rngtag i get world i +end +if ne rnginit 0 len world 0 +ret 31 +end +if ne get rngstate 0 5717881983045765875 +ret 32 +end +if ne rngnext 17513863605490730988 +ret 33 +end +if ne rngnext 9401024372741141497 +ret 34 +end +if ne rnginit 18446744073709551615 len world 0 +ret 35 +end +if ne rngnext 5751318989716258026 +ret 36 +end +if ne rngnext 12984362597069512417 +ret 37 +end +note High-bit bytes are unsigned, not sign-extended. +put rngtag 0 128 +put rngtag 1 255 +if ne rnginit 0 2 0 +ret 40 +end +if ne get rngstate 0 713197150969623264 +ret 41 +end +if ne rngnext 11707748180763584890 +ret 42 +end +if ne rngnext 14667845794806978071 +ret 43 +end +if ne rngnext 7581507163619784878 +ret 44 +end +if ne rngnext 6812334620058058772 +ret 45 +end +if ne rngnext 793927904360208106 +ret 46 +end +if ne rngnext 1256370476000318575 +ret 47 +end +if ne rngnext 14222632400573449213 +ret 48 +end +if ne rngnext 4532184365850327507 +ret 49 +end +if ne get rngstate 0 18131939410717004680 +ret 50 +end +if ne rnginit 18446744073709551615 2 0 +ret 51 +end +if ne rngnext 15903987064210817861 +ret 52 +end +if ne rngnext 7962989993763865288 +ret 53 +end +note Capacity boundary, last byte included, and both seed extremes. +for i ulong len rngtag +put rngtag i 97 +end +if ne rnginit 0 256 0 +ret 60 +end +if ne get rngstate 0 18242136092491110437 +ret 61 +end +if ne rngnext 1543074406968970713 +ret 62 +end +if ne rngnext 16439775865296349378 +ret 63 +end +if ne rnginit 18446744073709551615 256 0 +ret 64 +end +if ne rngnext 6955825034878021046 +ret 65 +end +if ne rngnext 8540932145809807677 +ret 66 +end +note Uniform consumes exactly one draw, preserving the following word. +if ne rnginit 0 0 0 +ret 70 +end +if ne rnguniform 41737 +ret 71 +end +if ne rngnext 1156539639830188822 +ret 72 +end +note Invalid tags must refuse before changing the prior stream state. +old = get rngstate 0 +if ne rnginit 0 257 2 +ret 80 +end +if ne rnginit 0 18446744073709551615 2 +ret 81 +end +put rngtag 0 0 +if ne rnginit 0 1 2 +ret 82 +end +put rngtag 0 97 +put rngtag 255 0 +if ne rnginit 0 256 2 +ret 83 +end +if ne get rngstate 0 old +ret 84 +end +note Request framing rejects short and oversized lengths without indexing. +if ne rngreqok 0 2 +ret 90 +end +if ne rngreqok 7 2 +ret 91 +end +if ne rngreqok 265 2 +ret 92 +end +if ne rngreqok 18446744073709551615 2 +ret 93 +end +if ne get rngstate 0 old +ret 94 +end +for i ulong 8 +put rngreq i 0 +end +put rngreq 8 0 +if ne rngreqok 9 2 +ret 95 +end +if ne get rngstate 0 old +ret 96 +end +note Valid request, full response packing, repeated-call determinism. +if ne rngreqok 8 0 +ret 100 +end +rngpack +if ne get rngstate 0 13667979225384485837 +ret 101 +end +note Independently fixed byte order for the first response word. +if ne get rngout 0 48 +ret 109 +end +if ne get rngout 1 255 +ret 110 +end +if ne get rngout 2 164 +ret 111 +end +if ne get rngout 3 107 +ret 112 +end +if ne get rngout 4 1 +ret 113 +end +if ne get rngout 5 124 +ret 114 +end +if ne get rngout 6 129 +ret 115 +end +if ne get rngout 7 195 +ret 116 +end +if ne rnginit 0 0 0 +ret 102 +end +for word ulong 8 +v = rngnext +for octet ulong 8 +if ne get rngout add mul word 8 octet uchar and shr v mul octet 8 255 +ret 103 +end +end +end +for i ulong 8 +put rngreq i 255 +end +put rngreq 8 128 +put rngreq 9 255 +if ne rngreqok 10 0 +ret 104 +end +if ne get rngstate 0 17733546922739928351 +ret 105 +end +if ne rngnext 15903987064210817861 +ret 106 +end +for i ulong 256 +put rngreq add i 8 97 +end +if ne rngreqok 264 0 +ret 107 +end +if ne rngnext 6955825034878021046 +ret 108 +end +note Mixed seed bytes detect reversed or permuted seed decoding. +put rngreq 0 1 +put rngreq 1 35 +put rngreq 2 69 +put rngreq 3 103 +put rngreq 4 137 +put rngreq 5 171 +put rngreq 6 205 +put rngreq 7 239 +if ne rngreqok 8 0 +ret 117 +end +if ne get rngstate 0 2611867254004318244 +ret 118 +end +if ne rngnext 7292048037619145208 +ret 119 +end +ret 0 +end ```